Skip to content

Commit

Permalink
0.9pre
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Mar 2, 2024
1 parent 3e60e1c commit c9eb5b7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
14 changes: 10 additions & 4 deletions src/pygbag/optimizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def optimize(folder, filenames, **kw):

def optimize(folder, filenames, **kw):
global BAD
print("optimizing", folder)
if "--no_opt" in sys.argv:
print("NOT optimizing", folder)
else:
print("optimizing", folder)
png_quality = 50

done_list = []
Expand All @@ -57,10 +60,13 @@ def optimize(folder, filenames, **kw):
except ImportError:
warnings.warn(f"Black not found for processing {folder=}")

if os.popen("pngquant 2>&1").read().count("pngfile"):
print(f" -> with pngquant --quality {png_quality}", folder)
if "--no_opt" in sys.argv:
pass
else:
png_quality = -1
if os.popen("pngquant 2>&1").read().count("pngfile"):
print(f" -> with pngquant --quality {png_quality}", folder)
else:
png_quality = -1

has_ffmpeg = os.popen("ffmpeg -version").read().count("version")

Expand Down
9 changes: 3 additions & 6 deletions src/pygbag/support/cpythonrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,6 @@ def __eq__(self, other):
platform.fopen = aio.filelike.fopen
platform.sopen = aio.filelike.sopen


if not aio.cross.simulator:

def fix_url(maybe_url):
Expand Down Expand Up @@ -1130,8 +1129,6 @@ class TopLevel_async_handler(aio.toplevel.AsyncInteractiveConsole):

from pathlib import Path

# repodata = "repodata.json"

def eval(self, source):
for count, line in enumerate(source.split("\n")):
if not count:
Expand All @@ -1143,7 +1140,7 @@ def eval(self, source):
if count:
self.line = None
self.buffer.insert(0, "#")
# self.buffer.append("")

DBG(f"1039: {count} lines queued for async eval")

@classmethod
Expand Down Expand Up @@ -1208,13 +1205,13 @@ def list_imports(cls, code=None, file=None, hint=""):
if not len(aio.pep0723.Config.pkg_repolist):
print(
"""
1170: pep0723 REPOSITORY MISSING
1208: pep0723 REPOSITORY MISSING
"""
)
else:
DBG(
f"""
1175: list_imports {len(code)=} {file=} {hint=}")
1214: list_imports {len(code)=} {file=} {hint=}")
{aio.pep0723.Config.pkg_repolist[0]['-CDN-']=}
"""
Expand Down
2 changes: 1 addition & 1 deletion src/pygbag/support/cross/aio/pep0723.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async def async_repos():
if apitag.find("mvp") > 0:
idx = f"{repo}index.json"
else:
idx = f"{repo}index-bi.json"
idx = f"{repo}index-090bi.json"
async with fopen(idx, "r", encoding="UTF-8") as index:
try:
data = index.read()
Expand Down
2 changes: 1 addition & 1 deletion static/default.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html lang="en-us"><script src="{{cookiecutter.cdn}}pythons.js" type=module id="site" data-python="python{{cookiecutter.PYBUILD}}" data-os="vtx,fs,snd,gui" async defer>#<!--
<html lang="en-us"><script src="{{cookiecutter.cdn}}pythons.js" type=module id=site data-LINES={{cookiecutter.LINES}} data-CONSOLE={{cookiecutter.CONSOLE}} data-python=python{{cookiecutter.PYBUILD}} data-os=vtx,fs,snd,gui async defer>#<!--

print("""
Loading {{cookiecutter.title}} from {{cookiecutter.archive}}.apk
Expand Down

0 comments on commit c9eb5b7

Please sign in to comment.