mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-06 23:50:17 +00:00
Update compileall.py
This commit is contained in:
parent
5f7bf4924b
commit
134144e6fa
@ -10,10 +10,16 @@ source_dir = sys.argv[2]
|
|||||||
output_dir = sys.argv[3]
|
output_dir = sys.argv[3]
|
||||||
|
|
||||||
def do_compile(src_path, dst_path):
|
def do_compile(src_path, dst_path):
|
||||||
|
assert os.path.isfile(src_path)
|
||||||
|
assert os.path.isfile(dst_path)
|
||||||
cmd = f'{pkpy_exe} --compile "{src_path}" "{dst_path}"'
|
cmd = f'{pkpy_exe} --compile "{src_path}" "{dst_path}"'
|
||||||
print(src_path)
|
print(src_path)
|
||||||
assert os.system(cmd) == 0
|
assert os.system(cmd) == 0
|
||||||
|
|
||||||
|
if os.path.isfile(source_dir):
|
||||||
|
do_compile(source_dir, output_dir)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
for root, _, files in os.walk(source_dir):
|
for root, _, files in os.walk(source_dir):
|
||||||
for file in files:
|
for file in files:
|
||||||
if not file.endswith('.py'):
|
if not file.endswith('.py'):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user