forked from bitcraze/lps-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cx_setup.py
30 lines (25 loc) · 868 Bytes
/
cx_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
import glob
import os
import shutil
import sys
from os import path
from cx_Freeze import Executable
from cx_Freeze import setup
from setup_common import setup_options
files_to_copy = [
('lpstools\\assets\\*', 'assets\\')
]
setup(executables=[Executable("lpstools/gui.py", targetName="lpstool.exe",
base="Win32GUI", icon="bitcraze.ico")],
**setup_options)
print()
print("Custom copy:")
if len(sys.argv) > 1 and sys.argv[1] == "build":
for instr in files_to_copy:
destpath = "build\\exe.win32-3.7\\" + instr[1]
print("Making folder {}".format(destpath))
os.makedirs(destpath, exist_ok=True)
for filepath in glob.glob(instr[0]):
filename = path.sep.split(filepath)[-1]
print("Copying {} to {}".format(filepath, destpath))
shutil.copy(filepath, destpath)