Skip to content

Commit e85ad68

Browse files
authored
Merge pull request #676 from mathoudebine/fix/675-theme-editor-does-not-work-with-windows-installer-for-release-380
Fix installer not opening Theme Editor because of spaces in paths
2 parents 60b4f9d + fc542aa commit e85ad68

File tree

3 files changed

+138
-3
lines changed

3 files changed

+138
-3
lines changed

configure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,16 @@ def on_weatherping_click(self):
440440
self.more_config_window.show()
441441

442442
def on_theme_editor_click(self):
443-
subprocess.Popen(MAIN_DIRECTORY + glob.glob("theme-editor.*", root_dir=MAIN_DIRECTORY)[0] + " \"" + self.theme_cb.get() + "\"", shell=True)
443+
subprocess.Popen(
444+
f'"{MAIN_DIRECTORY}{glob.glob("theme-editor.*", root_dir=MAIN_DIRECTORY)[0]}" "{self.theme_cb.get()}"',
445+
shell=True)
444446

445447
def on_save_click(self):
446448
self.save_config_values()
447449

448450
def on_saverun_click(self):
449451
self.save_config_values()
450-
subprocess.Popen(MAIN_DIRECTORY + glob.glob("main.*", root_dir=MAIN_DIRECTORY)[0], shell=True)
452+
subprocess.Popen(f'"{MAIN_DIRECTORY}{glob.glob("main.*", root_dir=MAIN_DIRECTORY)[0]}"', shell=True)
451453
self.window.destroy()
452454

453455
def on_brightness_change(self, e=None):

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def on_signal_caught(signum, frame=None):
116116

117117
def on_configure_tray(tray_icon, item):
118118
logger.info("Configure from tray icon")
119-
subprocess.Popen(MAIN_DIRECTORY + glob.glob("configure.*", root_dir=MAIN_DIRECTORY)[0], shell=True)
119+
subprocess.Popen(f'"{MAIN_DIRECTORY}{glob.glob("configure.*", root_dir=MAIN_DIRECTORY)[0]}"', shell=True)
120120
clean_stop(tray_icon)
121121

122122

turing-system-monitor_debug.spec

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
# Configuration Wizard
4+
5+
configure_a = Analysis(
6+
['configure.py'],
7+
pathex=[],
8+
binaries=[],
9+
datas=[('res', 'res'), ('config.yaml', '.'), ('external', 'external')],
10+
hiddenimports=[],
11+
hookspath=[],
12+
hooksconfig={},
13+
runtime_hooks=[],
14+
excludes=[],
15+
noarchive=False,
16+
optimize=0,
17+
)
18+
configure_pyz = PYZ(configure_a.pure)
19+
20+
configure_exe = EXE(
21+
configure_pyz,
22+
configure_a.scripts,
23+
[],
24+
exclude_binaries=True,
25+
name='configure',
26+
debug=True,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
console=True,
31+
disable_windowed_traceback=False,
32+
argv_emulation=False,
33+
target_arch=None,
34+
codesign_identity=None,
35+
entitlements_file=None,
36+
icon=['res\\icons\\monitor-icon-17865\\icon.ico'],
37+
contents_directory='.',
38+
version='tools\\windows-installer\\pyinstaller-version-info.txt',
39+
)
40+
41+
# System Monitor main program
42+
43+
main_a = Analysis(
44+
['main.py'],
45+
pathex=[],
46+
binaries=[],
47+
datas=[('res', 'res'), ('config.yaml', '.'), ('external', 'external')],
48+
hiddenimports=[],
49+
hookspath=[],
50+
hooksconfig={},
51+
runtime_hooks=[],
52+
excludes=[],
53+
noarchive=False,
54+
optimize=0,
55+
)
56+
main_pyz = PYZ(main_a.pure)
57+
58+
main_exe = EXE(
59+
main_pyz,
60+
main_a.scripts,
61+
[],
62+
exclude_binaries=True,
63+
name='main',
64+
debug=True,
65+
bootloader_ignore_signals=False,
66+
strip=False,
67+
upx=True,
68+
console=True,
69+
disable_windowed_traceback=False,
70+
argv_emulation=False,
71+
target_arch=None,
72+
codesign_identity=None,
73+
entitlements_file=None,
74+
icon=['res\\icons\\monitor-icon-17865\\icon.ico'],
75+
contents_directory='.',
76+
version='tools\\windows-installer\\pyinstaller-version-info.txt',
77+
)
78+
79+
# Theme Editor
80+
81+
editor_a = Analysis(
82+
['theme-editor.py'],
83+
pathex=[],
84+
binaries=[],
85+
datas=[('res', 'res'), ('config.yaml', '.'), ('external', 'external')],
86+
hiddenimports=[],
87+
hookspath=[],
88+
hooksconfig={},
89+
runtime_hooks=[],
90+
excludes=[],
91+
noarchive=False,
92+
optimize=0,
93+
)
94+
editor_pyz = PYZ(editor_a.pure)
95+
96+
editor_exe = EXE(
97+
editor_pyz,
98+
editor_a.scripts,
99+
[],
100+
exclude_binaries=True,
101+
name='theme-editor',
102+
debug=True,
103+
bootloader_ignore_signals=False,
104+
strip=False,
105+
upx=True,
106+
console=True,
107+
disable_windowed_traceback=False,
108+
argv_emulation=False,
109+
target_arch=None,
110+
codesign_identity=None,
111+
entitlements_file=None,
112+
icon=['res\\icons\\monitor-icon-17865\\icon.ico'],
113+
contents_directory='.',
114+
version='tools\\windows-installer\\pyinstaller-version-info.txt',
115+
)
116+
117+
# Common collect task
118+
119+
coll = COLLECT(
120+
configure_exe,
121+
configure_a.binaries,
122+
configure_a.datas,
123+
main_exe,
124+
main_a.binaries,
125+
main_a.datas,
126+
editor_exe,
127+
editor_a.binaries,
128+
editor_a.datas,
129+
strip=False,
130+
upx=True,
131+
upx_exclude=[],
132+
name='turing-system-monitor',
133+
)

0 commit comments

Comments
 (0)