-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdmine.spec
76 lines (69 loc) · 1.89 KB
/
dmine.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
72
73
74
75
76
# -*- mode: python -*-
import os
import re
block_cipher = None
"""
Getting the scripts.
"""
scripts = []
scripts.append(os.path.join(os.getcwd(), 'src', 'main.py'))
spiders_dir = os.path.join(os.getcwd(), 'src', 'spiders')
for f in os.listdir(os.path.join(spiders_dir)):
fullpath = os.path.join(spiders_dir, f)
if os.path.isfile(fullpath) and not re.match('^__', f):
scripts.append(fullpath)
"""
Getting the paths.
"""
paths = []
paths.append(os.path.join(os.getcwd(), 'src'))
paths.append(os.path.join(os.getcwd(), 'dep-py'))
paths.append(os.path.join(os.getcwd(), 'dep-bin'))
"""
Getting the binaries.
"""
binaries = []
binary_dir = os.path.join(os.getcwd(), 'dep-bin')
for root, dirs, files in os.walk(binary_dir):
for f in files:
fullpath = os.path.join(root, f)
if os.access(fullpath, os.X_OK):
binaries.append((fullpath, os.path.join('./dep-bin')))
"""
Getting the datas.
"""
datas = []
datas.append((os.path.join(os.getcwd(), 'src', 'spiders'), './spiders'))
datas.append((os.path.join(os.getcwd(), 'dep-bin'), './dep-bin'))
"""
Hooks path.
"""
hookspath=[os.path.join(os.getcwd(), 'hooks')]
a = Analysis(scripts,
pathex=paths,
binaries=binaries,
datas=datas,
hiddenimports=[],
hookspath=hookspath,
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='dmine',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='dmine')