From 1b45aac94545f40364443d77c72f74466180b513 Mon Sep 17 00:00:00 2001 From: pmp-p Date: Tue, 15 Nov 2022 02:18:32 +0100 Subject: [PATCH] 0.5 release --- README.md | 23 ++++++++++++----------- scripts/build-loader.sh | 9 +++++++-- setup.cfg | 2 +- static/pythons.html | 10 ++++++---- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index fac820c..6d3b068 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ async def main(): while True: # Do your rendering here, note that it's NOT an infinite loop, - # and it fired only when VSYNC occurs + # and it is fired only when VSYNC occurs # Usually 1/60 or more times per seconds on desktop, maybe less on some mobile devices print(f""" - Hello[{COUNT_DOWN}] from Python + Hello[{COUNT_DOWN}] from Python """) @@ -60,16 +60,13 @@ Example : ``` user@pp /data/git/pygbag $ python3 -m pygbag --help test - *pygbag 0.4.0* + *pygbag 0.5.0* Serving python files from [/data/git/pygbag/test/build/web] with no security/performance in mind, i'm just a test tool : don't rely on me -usage: __main__.py [-h] [--bind ADDRESS] [--directory DIRECTORY] - [--PYBUILD PYBUILD] [--app_name APP_NAME] [--ume_block UME_BLOCK] - [--can_close CAN_CLOSE] [--cache CACHE] [--package PACKAGE] [--title TITLE] - [--version VERSION] [--build] [--html] [--no_opt] [--archive] [--icon ICON] - [--cdn CDN] [--template TEMPLATE] [--ssl SSL] [--port [PORT]] +usage: __main__.py [-h] [--bind ADDRESS] [--directory DIRECTORY] [--PYBUILD PYBUILD] [--app_name APP_NAME] [--ume_block UME_BLOCK] [--can_close CAN_CLOSE] [--cache CACHE] [--package PACKAGE] [--title TITLE] [--version VERSION] [--build] [--html] [--no_opt] + [--archive] [--icon ICON] [--cdn CDN] [--template TEMPLATE] [--ssl SSL] [--port [PORT]] options: -h, --help show this help message and exit @@ -85,13 +82,13 @@ options: --cache CACHE md5 based url cache directory --package PACKAGE package name, better make it unique --title TITLE App nice looking name - --version VERSION override prebuilt version path [default:0.4.0] + --version VERSION override prebuilt version path [default:0.5.0] --build build only, do not run test server --html build as html with embedded assets (pygame-script) --no_opt turn off assets optimizer --archive make build/web.zip archive for itch.io --icon ICON icon png file 32x32 min should be favicon.png - --cdn CDN web site to cache locally [default:https://pygame-web.github.io/archives/0.4/] + --cdn CDN web site to cache locally [default:https://pygame-web.github.io/archives/0.5/] --template TEMPLATE index.html template [default:default.tmpl] --ssl SSL enable ssl with server.pem and key.pem --port [PORT] Specify alternate port [default: 8000] @@ -101,7 +98,7 @@ Now navigate to http://localhost:8000 with a modern Browser. Use http://localhost:8000#debug for getting a terminal and a sized down canvas. -For pygame-script go to http://localhost:8000/your.app.folder.html. +For pygame-script go to http://localhost:8000/test.html for a game folder named "test". @@ -139,6 +136,10 @@ https://github.com/pygame-web/pygbag Default prebuilts (pygame) used by pygbag are stored on github from the repo https://github.com/pygame-web/archives under versioned folders. +TEST REPL: + + [interactive repl](http://pygame-web.github.io/showroom/python310.html?-d&noapp#pygame-scripts/hello.py%20arg1%20arg2) + ADDING STATIC MODULES: diff --git a/scripts/build-loader.sh b/scripts/build-loader.sh index 9aa0b48..b6176f1 100755 --- a/scripts/build-loader.sh +++ b/scripts/build-loader.sh @@ -30,7 +30,8 @@ echo " SDKROOT=$SDKROOT PYTHONPYCACHEPREFIX=$PYTHONPYCACHEPREFIX HPY=$HPY -" + LD_VENDOR=$LD_VENDOR +" 1>&2 # SDL2_image turned off : -ltiff @@ -220,7 +221,11 @@ then LDFLAGS="$LDFLAGS $cpylib" done - echo LDFLAGS=$LDFLAGS + echo " + + LDFLAGS=$LDFLAGS + + " 1>&2 if emcc $FINAL_OPTS $LOPTS -std=gnu99 -D__PYDK__=1 -DNDEBUG\ -s TOTAL_MEMORY=256MB -s ALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH \ diff --git a/setup.cfg b/setup.cfg index 14a8926..7bca5af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ name = pygbag version = attr: pygbag.__version__ author = Paul Peny description = pygame wasm, package and run python/pygame directly in modern web browsers. -long_description = file: packages.d/pygame/README.md +long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/pygame-web/pygbag project_urls = diff --git a/static/pythons.html b/static/pythons.html index 206cf8f..1e1a209 100644 --- a/static/pythons.html +++ b/static/pythons.html @@ -64,7 +64,7 @@ - async def sitecustomize(): + async def custom_site(): global PyConfig, con # reset term @@ -90,7 +90,7 @@ await asyncio.sleep(1) if await TopLevel_async_handler.async_imports("matplotlib"): import matplotlib - if 1: + if 0: import sys from urllib.parse import urlencode import asyncio @@ -180,13 +180,14 @@ # def post(self, url, data=None): # return await self._post(url, data) - if 1: #not pygame: + if not pygame: return rng = 10 # resolution of progress bar slot = ux(.060)/rng # 60% async def compose(delay=0): + import asyncio global screen pygame.display.update() platform.window.chromakey(None, *screen.get_colorkey(), 40) @@ -200,8 +201,9 @@ await compose(1) + embed.prompt() - asyncio.run(sitecustomize()) + asyncio.run(custom_site())