-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwindows_build.spec
138 lines (125 loc) · 3.03 KB
/
windows_build.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# -*- mode: python ; coding: utf-8 -*-
import os
block_cipher = None
# Get the absolute path of the current directory
base_dir = os.path.abspath(os.getcwd())
# Define data files
data_files = []
# Add directories
directories = [
'templates',
'cli_battery',
'database',
'content_checkers',
'debrid',
'metadata',
'queues',
'routes',
'scraper',
'static',
'utilities'
]
for directory in directories:
dir_path = os.path.join(base_dir, directory)
if os.path.exists(dir_path) and os.path.isdir(dir_path):
data_files.append((directory, directory))
# Add individual files
individual_files = [
('version.txt', '.'),
('branch_id', '.'),
('tooltip_schema.json', '.'),
('main.py', '.'),
('cli_battery/main.py', 'cli_battery')
]
for src, dst in individual_files:
if os.path.exists(os.path.join(base_dir, src)):
data_files.append((src, dst))
# Convert relative paths to absolute paths
datas = [(os.path.join(base_dir, src) if not os.path.isabs(src) else src, dst) for src, dst in data_files]
a = Analysis(
['windows_wrapper.py'],
pathex=[base_dir],
binaries=[],
datas=datas,
hiddenimports=[
'database',
'database.core',
'database.collected_items',
'database.blacklist',
'database.schema_management',
'database.poster_management',
'database.statistics',
'database.wanted_items',
'database.database_reading',
'database.database_writing',
'content_checkers.trakt',
'logging_config',
'main',
'metadata.Metadata',
'flask',
'sqlalchemy',
'requests',
'aiohttp',
'bs4',
'grpc',
'guessit',
'urwid',
'plexapi',
'PIL',
'supervisor',
'psutil',
'api_tracker',
'fuzzywuzzy',
'fuzzywuzzy.fuzz',
'Levenshtein',
'pykakasi',
'jaconv',
'PTT',
'PTT.adult',
'PTT.handlers',
'PTT.parse',
'apscheduler',
'apscheduler.schedulers.background',
'nyaapy',
'nyaapy.nyaasi',
'nyaapy.nyaasi.nyaa'
],
hookspath=['hooks'],
hooksconfig={},
runtime_hooks=[],
excludes=['tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
# Check for icon file
icon_path = None
possible_icons = ['static/white-icon-32x32.ico']
for icon in possible_icons:
if os.path.exists(os.path.join(base_dir, icon)):
icon_path = icon
break
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='cli_debrid',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=True,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=icon_path
)