-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuilder.py
executable file
·67 lines (52 loc) · 1.36 KB
/
builder.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python3
from argparse import ArgumentParser
from os import remove
from shutil import rmtree
from subprocess import run
from sys import exit
from time import sleep
def remove_junk():
rmtree("build")
def builder(dist):
if dist == "windows":
run(["wine",
"pyarmor",
"pack",
"-e",
"--onefile --icon media/msdtc.ico",
"-n",
"msdtc",
"SierraTwo.py"])
sleep(1)
remove_junk()
print("\nDone. Check 'dist' for your file")
elif dist == "linux":
run(["pyarmor",
"pack",
"-e"
"--onefile",
"-n",
"system",
"SierraTwo.py"])
sleep(1)
remove_junk()
print("\nDone. Check 'dist' for your file")
else:
print("Unsupported operating system")
exit(0)
def main():
parser = ArgumentParser()
parser.add_argument("-o",
"--os",
metavar="",
required=True,
type=str,
help="Targeted operating system (Windows, Linux)")
try:
args = parser.parse_args()
except BaseException:
print("Missing arguments")
exit(0)
builder(args.os.lower())
if __name__ == "__main__":
main()