-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__main__.py
More file actions
38 lines (34 loc) · 1.14 KB
/
Copy path__main__.py
File metadata and controls
38 lines (34 loc) · 1.14 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Entry point to compiled program"""
import argparse
import sys
from tkinter import messagebox
from modules import application
if __name__ == "__main__":
import psutil
processes = [p.name() for p in psutil.process_iter()]
if processes.count("DownloaderGUI.exe") < 2:
parser = argparse.ArgumentParser()
parser.add_argument(
"-d",
"--debug",
"--verbose",
action="store_true",
help="set program to debug mode for more info printed",
dest="debug",
default=False,
)
parser.add_argument(
"-v",
"--version",
action="version",
help="show version message and exit",
version="%(prog)s v" + application.APP_VERSION,
)
parser.add_argument(
"path", nargs="?", help="path to a .ytdl file containing a list of URLs for the editor", default=None
)
args = parser.parse_args()
application.main(args)
else:
messagebox.showwarning("Program Running", "The program is already running...")
sys.exit("Already Running...")