-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathWPKG-GP Client.spec
71 lines (60 loc) · 2.03 KB
/
WPKG-GP Client.spec
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
# -*- mode: python -*-
base_path = os.path.abspath(SPECPATH)
myicon = base_path + os.sep + 'icon.ico'
myversion = base_path + os.sep + 'version.txt'
def addTranslations():
lng_files = [os.path.join(dp, f) for dp, dn, fn in os.walk(os.path.expanduser(base_path + os.sep + 'locale')) for f in fn if f.endswith('.mo')]
extraDatas = []
for src_path in lng_files:
extraDatas.append((src_path.replace(base_path + os.sep, ''), src_path, ''))
return extraDatas
def addImages():
img_path = base_path + os.sep + "img" + os.sep
extraDatas = []
for file in os.listdir(img_path):
extraDatas.append(('img\\' + file, img_path + file, ''))
return extraDatas
def addHelpFiles():
help_path = base_path + os.sep + "help" + os.sep
extraDatas = []
for file in os.listdir(help_path):
extraDatas.append(('help\\' + file, help_path + file, ''))
return extraDatas
block_cipher = None
a = Analysis(['WPKG-GP-Client.py'],
pathex=[base_path],
binaries=None,
datas=None,
hiddenimports=[],
hookspath=None,
runtime_hooks=None,
excludes=None,
win_no_prefer_redirects=None,
win_private_assemblies=None,
cipher=block_cipher)
# Add data to dist
a.datas += addImages()
a.datas += addHelpFiles()
a.datas += addTranslations()
a.datas += [('wpkg-gp_client_example.ini', base_path + os.sep + 'wpkg-gp_client_example.ini', ''),
('help.html', base_path + os.sep + 'help.html', '')]
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='WPKG-GP-Client',
debug=False,
strip=None,
upx=True,
console=True,
icon=myicon,
version=myversion
)
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='WPKG-GP-Client')