diff --git a/configure.py b/configure.py index 5bad40eb..4f0f49bd 100755 --- a/configure.py +++ b/configure.py @@ -440,14 +440,16 @@ def on_weatherping_click(self): self.more_config_window.show() def on_theme_editor_click(self): - subprocess.Popen(MAIN_DIRECTORY + glob.glob("theme-editor.*", root_dir=MAIN_DIRECTORY)[0] + " \"" + self.theme_cb.get() + "\"", shell=True) + subprocess.Popen( + f'"{MAIN_DIRECTORY}{glob.glob("theme-editor.*", root_dir=MAIN_DIRECTORY)[0]}" "{self.theme_cb.get()}"', + shell=True) def on_save_click(self): self.save_config_values() def on_saverun_click(self): self.save_config_values() - subprocess.Popen(MAIN_DIRECTORY + glob.glob("main.*", root_dir=MAIN_DIRECTORY)[0], shell=True) + subprocess.Popen(f'"{MAIN_DIRECTORY}{glob.glob("main.*", root_dir=MAIN_DIRECTORY)[0]}"', shell=True) self.window.destroy() def on_brightness_change(self, e=None): diff --git a/main.py b/main.py index bf4be1a9..a58520c2 100755 --- a/main.py +++ b/main.py @@ -116,7 +116,7 @@ def on_signal_caught(signum, frame=None): def on_configure_tray(tray_icon, item): logger.info("Configure from tray icon") - subprocess.Popen(MAIN_DIRECTORY + glob.glob("configure.*", root_dir=MAIN_DIRECTORY)[0], shell=True) + subprocess.Popen(f'"{MAIN_DIRECTORY}{glob.glob("configure.*", root_dir=MAIN_DIRECTORY)[0]}"', shell=True) clean_stop(tray_icon) diff --git a/turing-system-monitor_debug.spec b/turing-system-monitor_debug.spec new file mode 100644 index 00000000..205f6baf --- /dev/null +++ b/turing-system-monitor_debug.spec @@ -0,0 +1,133 @@ +# -*- mode: python ; coding: utf-8 -*- + +# Configuration Wizard + +configure_a = Analysis( + ['configure.py'], + pathex=[], + binaries=[], + datas=[('res', 'res'), ('config.yaml', '.'), ('external', 'external')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +configure_pyz = PYZ(configure_a.pure) + +configure_exe = EXE( + configure_pyz, + configure_a.scripts, + [], + exclude_binaries=True, + name='configure', + debug=True, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['res\\icons\\monitor-icon-17865\\icon.ico'], + contents_directory='.', + version='tools\\windows-installer\\pyinstaller-version-info.txt', +) + +# System Monitor main program + +main_a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[('res', 'res'), ('config.yaml', '.'), ('external', 'external')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +main_pyz = PYZ(main_a.pure) + +main_exe = EXE( + main_pyz, + main_a.scripts, + [], + exclude_binaries=True, + name='main', + debug=True, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['res\\icons\\monitor-icon-17865\\icon.ico'], + contents_directory='.', + version='tools\\windows-installer\\pyinstaller-version-info.txt', +) + +# Theme Editor + +editor_a = Analysis( + ['theme-editor.py'], + pathex=[], + binaries=[], + datas=[('res', 'res'), ('config.yaml', '.'), ('external', 'external')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +editor_pyz = PYZ(editor_a.pure) + +editor_exe = EXE( + editor_pyz, + editor_a.scripts, + [], + exclude_binaries=True, + name='theme-editor', + debug=True, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['res\\icons\\monitor-icon-17865\\icon.ico'], + contents_directory='.', + version='tools\\windows-installer\\pyinstaller-version-info.txt', +) + +# Common collect task + +coll = COLLECT( + configure_exe, + configure_a.binaries, + configure_a.datas, + main_exe, + main_a.binaries, + main_a.datas, + editor_exe, + editor_a.binaries, + editor_a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='turing-system-monitor', +)