Skip to content

Commit

Permalink
Update build script & fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kawashirov committed Oct 12, 2022
1 parent 05dfe69 commit 437401b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion vrc2webp/assets/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ randomize-scan: true
# It's hard to detect if file just stored or being written right now. Scanning every handle for every file is overkill.
# So vrc2webp just wait this given time and if file size is changed, then wait again and again in loop.
# Note: While watching and waiting for one file, vrc2webp *CAN* process other files, so this timeout won't stack:
# if you have 1k+ files overall delay will *NOT* be 10k+ sec (1hr+), it will be insensible.
# if you have 1k+ files overall delay will *NOT* be 5k+ sec (1hr+), it will be insensible.
new-files-timeout: 5.0

# Extensions of original files to convert to WEBP.
Expand Down
27 changes: 19 additions & 8 deletions vrc2webp_build_nuitka.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import subprocess
import sys
import signal
import time
import datetime

if __name__ == '__main__':
from vrc2webp.version import APP_VERION
Expand All @@ -20,24 +22,33 @@
'--warn-unusual-code',
'--show-progress',
'--show-modules',
#
'--windows-company-name=kawashirov',
'--windows-product-name=vrc2webp',
f'--windows-file-description={url}',
f'--windows-file-version={APP_VERION}',
f'--windows-product-version={APP_VERION}',
'--windows-icon-from-ico=logo\\logo.ico',
'--onefile-tempdir-spec=%TEMP%\\vrc2webp_%PID%_%TIME%',
#
'--include-package=vrc2webp',
'--include-package-data=vrc2webp',
'--python-flag=-OO',
'--onefile-tempdir-spec=%TEMP%\\vrc2webp_%PID%_%TIME%',
'--windows-icon-from-ico=logo\\logo.ico',
'--follow-stdlib',
*(f'--nofollow-import-to={m}' for m in nofollow),
#
'--onefile', 'vrc2webp',
'-o', 'vrc2webp.exe'
]

with subprocess.Popen(nuitka_cmd, stdin=subprocess.DEVNULL) as proc:
while proc.poll() is None:
try:
proc.wait()
except KeyboardInterrupt:
proc.send_signal(signal.SIGBREAK)
time_begin = time.monotonic()
try:
with subprocess.Popen(nuitka_cmd, stdin=subprocess.DEVNULL) as proc:
while proc.poll() is None:
try:
proc.wait()
except KeyboardInterrupt:
proc.send_signal(signal.SIGBREAK)
finally:
dt = datetime.timedelta(seconds=time.monotonic() - time_begin)
print(f'Nuitka building time spent: {dt!s}')

0 comments on commit 437401b

Please sign in to comment.