diff --git a/pyscriptjs/examples/index.html b/pyscriptjs/examples/index.html index 6710acf..4f59504 100644 --- a/pyscriptjs/examples/index.html +++ b/pyscriptjs/examples/index.html @@ -42,6 +42,9 @@ WARNING: This examples takes a little longer to load. So be patient :)

+

Freedom Units!

+

A Toga application (a Fahrenheit to Celsius converter), rendered as a Single Page App

+

Simple d3 visualization

Minimal d3 demo demonstrating how to create a visualization

diff --git a/pyscriptjs/examples/toga/freedom.html b/pyscriptjs/examples/toga/freedom.html new file mode 100644 index 0000000..c664cf7 --- /dev/null +++ b/pyscriptjs/examples/toga/freedom.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + Loading... + + +
Loading...
+ + + + + + + +import asyncio +import micropip + +await micropip.install([ + './static/wheels/travertino-0.1.3-py3-none-any.whl', + './static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl', + './static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl', + './static/wheels/freedom-0.0.1-py3-none-any.whl', +]) + +from toga_web.dom import handle as dom_handle + +from freedom.__main__ import main + +app = main().main_loop(spa=True) + + + \ No newline at end of file diff --git a/pyscriptjs/examples/toga/freedom/fake-briefcase.sh b/pyscriptjs/examples/toga/freedom/fake-briefcase.sh index 3e143a2..df64f98 100755 --- a/pyscriptjs/examples/toga/freedom/fake-briefcase.sh +++ b/pyscriptjs/examples/toga/freedom/fake-briefcase.sh @@ -1,7 +1,7 @@ #!/bin/sh -mkdir -p ../server/static/wheels +mkdir -p ../static/wheels cd src unzip ../base-wheel.zip -zip ../../server/static/wheels/freedom-0.0.1-py3-none-any.whl -r freedom* +zip ../../static/wheels/freedom-0.0.1-py3-none-any.whl -r freedom* rm -rf freedom-0.0.1.dist-info diff --git a/pyscriptjs/examples/toga/server/demo.py b/pyscriptjs/examples/toga/server/demo.py index 780fd11..abd9065 100644 --- a/pyscriptjs/examples/toga/server/demo.py +++ b/pyscriptjs/examples/toga/server/demo.py @@ -4,7 +4,7 @@ from toga_flask import TogaApp from freedom import app as freedom -app = Flask(__name__) +app = Flask(__name__, static_folder='../static') app.add_url_rule('/', view_func=TogaApp.as_view("foo", app_module=freedom)) diff --git a/pyscriptjs/examples/toga/server/static/wheels/freedom-0.0.1-py3-none-any.whl b/pyscriptjs/examples/toga/server/static/wheels/freedom-0.0.1-py3-none-any.whl deleted file mode 100644 index ea5a1c7..0000000 Binary files a/pyscriptjs/examples/toga/server/static/wheels/freedom-0.0.1-py3-none-any.whl and /dev/null differ diff --git a/pyscriptjs/examples/toga/server/static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl b/pyscriptjs/examples/toga/server/static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl deleted file mode 100644 index ed0bf57..0000000 Binary files a/pyscriptjs/examples/toga/server/static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl and /dev/null differ diff --git a/pyscriptjs/examples/toga/server/static/logo-32.png b/pyscriptjs/examples/toga/static/logo-32.png similarity index 100% rename from pyscriptjs/examples/toga/server/static/logo-32.png rename to pyscriptjs/examples/toga/static/logo-32.png diff --git a/pyscriptjs/examples/toga/server/static/pyscript/pyscript.css b/pyscriptjs/examples/toga/static/pyscript/pyscript.css similarity index 100% rename from pyscriptjs/examples/toga/server/static/pyscript/pyscript.css rename to pyscriptjs/examples/toga/static/pyscript/pyscript.css diff --git a/pyscriptjs/examples/toga/server/static/pyscript/pyscript.js b/pyscriptjs/examples/toga/static/pyscript/pyscript.js similarity index 100% rename from pyscriptjs/examples/toga/server/static/pyscript/pyscript.js rename to pyscriptjs/examples/toga/static/pyscript/pyscript.js diff --git a/pyscriptjs/examples/toga/server/static/pyscript/pyscript.js.map b/pyscriptjs/examples/toga/static/pyscript/pyscript.js.map similarity index 100% rename from pyscriptjs/examples/toga/server/static/pyscript/pyscript.js.map rename to pyscriptjs/examples/toga/static/pyscript/pyscript.js.map diff --git a/pyscriptjs/examples/toga/server/static/toga.css b/pyscriptjs/examples/toga/static/toga.css similarity index 100% rename from pyscriptjs/examples/toga/server/static/toga.css rename to pyscriptjs/examples/toga/static/toga.css diff --git a/pyscriptjs/examples/toga/server/static/wheels/README.md b/pyscriptjs/examples/toga/static/wheels/README.md similarity index 100% rename from pyscriptjs/examples/toga/server/static/wheels/README.md rename to pyscriptjs/examples/toga/static/wheels/README.md diff --git a/pyscriptjs/examples/toga/static/wheels/freedom-0.0.1-py3-none-any.whl b/pyscriptjs/examples/toga/static/wheels/freedom-0.0.1-py3-none-any.whl new file mode 100644 index 0000000..8f71798 Binary files /dev/null and b/pyscriptjs/examples/toga/static/wheels/freedom-0.0.1-py3-none-any.whl differ diff --git a/pyscriptjs/examples/toga/server/static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl b/pyscriptjs/examples/toga/static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl similarity index 98% rename from pyscriptjs/examples/toga/server/static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl rename to pyscriptjs/examples/toga/static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl index 3ced3e1..fcc3ea3 100644 Binary files a/pyscriptjs/examples/toga/server/static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl and b/pyscriptjs/examples/toga/static/wheels/toga_core-0.3.0.dev33-py3-none-any.whl differ diff --git a/pyscriptjs/examples/toga/server/static/wheels/toga_flask-0.3.0.dev33-py3-none-any.whl b/pyscriptjs/examples/toga/static/wheels/toga_flask-0.3.0.dev33-py3-none-any.whl similarity index 84% rename from pyscriptjs/examples/toga/server/static/wheels/toga_flask-0.3.0.dev33-py3-none-any.whl rename to pyscriptjs/examples/toga/static/wheels/toga_flask-0.3.0.dev33-py3-none-any.whl index 8d19823..c8800b9 100644 Binary files a/pyscriptjs/examples/toga/server/static/wheels/toga_flask-0.3.0.dev33-py3-none-any.whl and b/pyscriptjs/examples/toga/static/wheels/toga_flask-0.3.0.dev33-py3-none-any.whl differ diff --git a/pyscriptjs/examples/toga/static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl b/pyscriptjs/examples/toga/static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl new file mode 100644 index 0000000..3d0bde0 Binary files /dev/null and b/pyscriptjs/examples/toga/static/wheels/toga_web-0.3.0.dev33-py3-none-any.whl differ diff --git a/pyscriptjs/examples/toga/server/static/wheels/travertino-0.1.3-py3-none-any.whl b/pyscriptjs/examples/toga/static/wheels/travertino-0.1.3-py3-none-any.whl similarity index 95% rename from pyscriptjs/examples/toga/server/static/wheels/travertino-0.1.3-py3-none-any.whl rename to pyscriptjs/examples/toga/static/wheels/travertino-0.1.3-py3-none-any.whl index 00f1a4c..f32ff59 100644 Binary files a/pyscriptjs/examples/toga/server/static/wheels/travertino-0.1.3-py3-none-any.whl and b/pyscriptjs/examples/toga/static/wheels/travertino-0.1.3-py3-none-any.whl differ