-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
93 lines (81 loc) · 1.74 KB
/
setup.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/python2
# -*- coding: utf8 -*-
"""
----------------------
Autor : Anarchy
Date : 16/02/2019
Name : setup.py
Version : 0.0.8-a
----------------------
"""
import sys, os
from cx_Freeze import setup, Executable
if(False in ["build" in sys.argv]):
os.system("python2 setup.py build")
exit(1)
properties = {
"binpathincludes": [],
"includeFiles": [
'assets/',
'conf.json'
],
"includes": [
'core',
],
"excludes": [],
"packages": []
}
if(sys.platform == "win32"):
pass
elif(sys.platform == "linux2"):
properties["binpathincludes"].append("/usr/lib")
pass
else:
pass
for i, txt in enumerate(properties):
print("{}\t: {} element(s)".format(txt, len(properties[txt])))
for output in properties[txt]:
print(" [*] {}".format(output))
options = {
"path": sys.path,
"includes": properties["includes"],
"excludes": properties["excludes"],
"packages": properties["packages"],
"include_files": properties["includeFiles"],
"bin_path_includes": properties["binpathincludes"],
"optimize": 0,
"silent": False
}
base, pic = None, None
if(sys.platform == "win32"):
base = "Win32GUI" # "Win32GUI". Graph | "Console". Shell
pic = "icone.ico"
options["include_msvcr"] = True
app = [
Executable(
script = "service.py",
base = base,
icon = pic
)
]
confirm = raw_input("\n>>> Confirm ? [Y/n] ")
if(confirm in ['Y', 'y']):
try:
setup(
name = "service.exe",
version = "0.0.8-a",
description = "Outils d'interface d'accès aux Services Web Linux",
author = "Anarchy",
options = { "build_exe": options },
executables = [app[0]]
)
print(" [ INFO ] - Compilation Success\n")
except:
print(" [ INFO ] - Compilation Failed\n")
else:
print(" [ INFO ] - Compilation Aborted\n")
"""
-----
END
-----
"""