Commit Graph

56 Commits

Author SHA1 Message Date
Madhur Tandon
006d161a32 cleanup leftovers such as mode and pyodideReadyPromise (#649)
* remove usage of mode

* clean up pyodideReadyPromise
2022-08-02 20:44:41 +05:30
Fabio Pliger
8e1cd0b268 minor changes to make linting happier (#598)
* minor changes to make linting happy

* remove cast since linter wasn't happy

* address PR comments
2022-07-28 15:30:03 -05:00
woxtu
9102768366 Improve with string interpolations (#604)
* Use string interpolations

* Fix the key in py-env
2022-07-28 11:07:10 -04:00
woxtu
c7942d7d8f Use the type definition of pyodide (#535)
* Import the type definition

* Add type annotations
2022-06-24 14:25:14 -05:00
woxtu
3b68e1b27d Bundle the Python files into the output file (#441)
* Bundle the Python files into the output file

* Remove unused functions
2022-05-22 16:30:19 -05:00
Jeff Glass
b767a78b05 Provide Visible Error if <py-env> paths is used in a local HTML file (#311)
* Add onscreen error when using py-env paths in local HTTP files without file server

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove redundant code, fix error handling, add 404 error

* Lint and Format

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* manage errors loading files

* use handleFetchError for handling fetch errors in env

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-05-17 23:48:02 -05:00
Philipp Rudiger
1e8aa87b0a Ensure minified pyscript is captured by query selector (#393) 2022-05-16 09:40:23 -05:00
woxtu
86eb771cdc Use substring() instead of substr() (#341) 2022-05-12 14:54:35 -05:00
Fabio Pliger
363f3751f9 support different pyodide versions (#328)
* add PyLoader class

* create global loader during app creation time and remove it when pyscript loading operations are done

* make the loader global and open/close when apps is starting. Also add concept of app config so users can set if they want to autoclose the loader of handle it themselves

* add pyconfig file

* auto add global config if there's no config set in the page

* export initializer type

* define type for config

* move initialization out of svelte file, into app config

* change runtimes from strings to objects

* fix typo
2022-05-11 16:59:13 -05:00
Fabio Pliger
b7d748c96a Moves Python code out of interpreter file (#207)
* make copy of .py files part of build process

* move code out ofinterpreter file and make it download and load code during initialization

* fix double ; in interpreter

* remove debugging print

* update dependencies

* fix project name and version

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* change fmt-py

* lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove extra content

* define missing strict type

* create build folder if doesn't exist

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-05 23:12:54 -05:00
Roman Yurchak
8490b88386 Don't load distutils in the Python standard library (#234) 2022-05-05 19:19:10 -05:00
woxtu
454934c2cd Set to stderr 2022-05-05 06:12:38 +09:00
woxtu
57a4601bfb Fix typo 2022-05-05 06:06:25 +09:00
Christian Clauss
4cef872a6a interpreter.ts: Typo functions 2022-05-04 18:07:52 +02:00
Philipp Rudiger
7534b79fd6 Small fix 2022-05-02 19:48:15 +02:00
Philipp Rudiger
4df9a7e06d Fix rendering for simple types 2022-05-02 18:39:28 +02:00
Philipp Rudiger
3457d4313a Handle repr of types 2022-05-02 18:30:33 +02:00
Fabio Pliger
62737bf868 disable lint on specific line 2022-04-28 15:06:50 -06:00
Fabio Pliger
3f05d33ebc remove unused code in App 2022-04-28 12:12:24 -06:00
Philipp Rudiger
2781792073 Loading module from file should not auto-import 2022-04-26 16:02:58 +02:00
Fabio Pliger
d309a6c974 Merge branch 'main' into rb/prettier 2022-04-25 22:03:37 -05:00
Ross Bermudez
27deee3f86 [PYS-12] Format and lint 2022-04-25 15:00:14 +02:00
Philipp Rudiger
3eb41d73ed Handle strings 2022-04-23 00:02:04 +02:00
Philipp Rudiger
4e022e37b4 Cleanup whitespace 2022-04-22 23:50:30 +02:00
Philipp Rudiger
0b6fe08663 Various mime rendering fixes 2022-04-22 23:50:30 +02:00
Philipp Rudiger
b5bfffe912 Abort rendering if no element found 2022-04-22 23:50:30 +02:00
Philipp Rudiger
ec968a6081 Fix typo 2022-04-22 23:50:30 +02:00
Philipp Rudiger
ca92e58c37 Clean up 2022-04-22 23:50:30 +02:00
Philipp Rudiger
97aa4513f7 Add MIME renderer support 2022-04-22 23:50:30 +02:00
Fabio Pliger
71873b6b50 clean pylist.py and add a very hacky sync between list items and it's rendered versions 2022-04-20 20:03:23 -05:00
Fabio Pliger
7c71ba6fde add margin to widgets and add item template to PyList 2022-04-20 18:17:58 -05:00
Fabio Pliger
ac64b2aaa3 add handlers to input box as well 2022-04-20 16:32:11 -05:00
Fabio Pliger
44afda7aa8 add inputbox and clearn todo html even more 2022-04-20 16:12:01 -05:00
Fabio Pliger
f5b168a45e add better support for new widgets 2022-04-20 15:41:28 -05:00
Fabio Pliger
ee1db16bcf move templates to interpreter 2022-04-20 13:30:08 -05:00
Fabio Pliger
a702cbdf10 add support for custom widgets registration in Python 2022-04-19 19:24:22 -05:00
Fabio Pliger
4831c19a06 call micropip installed of loading packages 2022-04-19 14:52:09 -05:00
Fabio Pliger
3c2ca6d68c fix error when trying to output to non existing element 2022-04-18 23:10:41 -05:00
Fabio Pliger
00b571d3df change OutputManager to actually have separate contexts for out and err to scripts can manage both in one place 2022-04-18 15:54:59 -05:00
Fabio Pliger
955fb6fd37 fix missing initialization in outputmanager 2022-04-18 12:06:05 -05:00
Fabio Pliger
441a2c6e9e introduce outputmanager to redirect output in repl 2022-04-15 18:42:16 -05:00
Fabio Pliger
a9e1b7c5d6 remove unused import 2022-04-13 09:48:37 -05:00
Fabio Pliger
67be46f224 add support for paths on py-env so that we can load local (sort of) scripts into the environment 2022-04-12 19:04:26 -05:00
Fabio Pliger
c29144d69c improve some of the demos font and removes repr for when objects are outputted to a div 2022-04-12 15:42:44 -05:00
Fabio Pliger
46690ca1a8 remove pyscript being loaded externally for now 2022-04-12 13:09:44 -05:00
Fabio Pliger
973a14baea allow pyscript to specify source and try loading pyscript python injections from file 2022-04-11 23:13:06 -05:00
Fabio Pliger
7fd2b56bfe remove old files and old code references 2022-04-08 18:19:34 -05:00
Fabio Pliger
9d64a9f126 add pyenv and allow to load packages to the loaded pyodide runtime 2022-04-06 14:45:34 -05:00
Fabio Pliger
5ec85695b9 add initializers that run before py-script scripts run and post initializers that run after. Also add function to unescape some of the characters when read form html tags 2022-04-01 10:45:52 -05:00
Fabio Pliger
5edf76f3d2 point stdout and stderr to console.log 2022-03-29 14:22:08 -05:00