diff --git a/vrc2webp/assets/default.yaml b/vrc2webp/assets/default.yaml index 9d91ae4..15a1c64 100644 --- a/vrc2webp/assets/default.yaml +++ b/vrc2webp/assets/default.yaml @@ -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. diff --git a/vrc2webp_build_nuitka.py b/vrc2webp_build_nuitka.py index 708d883..214c745 100644 --- a/vrc2webp_build_nuitka.py +++ b/vrc2webp_build_nuitka.py @@ -1,6 +1,8 @@ import subprocess import sys import signal +import time +import datetime if __name__ == '__main__': from vrc2webp.version import APP_VERION @@ -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}')