Skip to content

Commit

Permalink
0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Nov 15, 2022
1 parent 154955a commit 1b45aac
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
""")

Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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".



Expand Down Expand Up @@ -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:

Expand Down
9 changes: 7 additions & 2 deletions scripts/build-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ echo "
SDKROOT=$SDKROOT
PYTHONPYCACHEPREFIX=$PYTHONPYCACHEPREFIX
HPY=$HPY
"
LD_VENDOR=$LD_VENDOR
" 1>&2


# SDL2_image turned off : -ltiff
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
10 changes: 6 additions & 4 deletions static/pythons.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@



async def sitecustomize():
async def custom_site():
global PyConfig, con

# reset term
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -200,8 +201,9 @@
await compose(1)


embed.prompt()

asyncio.run(sitecustomize())
asyncio.run(custom_site())



Expand Down

0 comments on commit 1b45aac

Please sign in to comment.