-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
25 lines (22 loc) · 953 Bytes
/
Copy pathrun.py
File metadata and controls
25 lines (22 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys
import argparse
from multiprocessing import freeze_support
from aidocsynth.app import main
if __name__ == "__main__":
# Important: call freeze_support() BEFORE parsing CLI args.
# In PyInstaller-frozen apps, multiprocessing spawns child processes
# by re-invoking the executable with special flags such as
# --multiprocessing-fork or Python interpreter flags (-B -S -I -c ...).
# freeze_support() handles these cases. We also use parse_known_args()
# to ignore any unknown flags that are intended for the MP bootstrap.
freeze_support()
parser = argparse.ArgumentParser(description="AIDocSynth")
parser.add_argument(
"--loglevel",
type=str.upper,
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
default="INFO",
help="Set the logging level (default: INFO)",
)
args, _unknown = parser.parse_known_args()
sys.exit(main(loglevel=args.loglevel))