-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
62 lines (47 loc) · 1.39 KB
/
setup.py
File metadata and controls
62 lines (47 loc) · 1.39 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""Django Desktop Application Setup Module
This module freezes executables needed by this module.
Invoke with the following command:
>> python manage.py collectstatic --noinput --verbosity=0
>> python setup.py build_exe
"""
from cx_Freeze import setup, Executable
import sys
import os
import shutil
import manage
print("Pre-build cleanup.")
try:
#Clean up build directory.
shutil.rmtree("build")
except:
pass
try:
#Clean up install directory.
shutil.rmtree("install/bin/dda")
except:
pass
setup(
name = "dda",
version = manage.__version__,
description = manage.module_name,
executables = [Executable("manage.py", copyDependentFiles=True)]
)
print("Copy executable to install area...")
try:
#Copy executable to install staging area.
shutil.copytree("build/exe.win32-3.4", "install/bin/dda")
#Remove executable from freeze area.
shutil.rmtree("build")
except:
print("Error during executable copy to install area.")
#Exit with error.
sys.exit(1)
print("Copy executable to installer staging area...")
try:
os.makedirs("install/bin/dda/dda", exist_ok=True)
shutil.copy("dda/settings.py", "install/bin/dda/dda")
except:
print("Error during executable copy to binary repo area.")
#Exit with error.
sys.exit(1)
print("Done With It All...")