pingwizard 1.0.24__tar.gz → 1.0.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pingwizard-1.0.24 → pingwizard-1.0.26}/PKG-INFO +1 -1
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard/create_shortcut.py +1 -2
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard/gui_wizard.py +76 -28
- pingwizard-1.0.26/pingwizard/version.py +1 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard.egg-info/PKG-INFO +1 -1
- pingwizard-1.0.24/pingwizard/version.py +0 -1
- {pingwizard-1.0.24 → pingwizard-1.0.26}/LICENSE +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/README.md +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard/__init__.py +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard/__main__.py +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard/assets/PINGMapper_Logo_small.png +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard/check_available_updates.py +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard.egg-info/SOURCES.txt +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard.egg-info/dependency_links.txt +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/pingwizard.egg-info/top_level.txt +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/setup.cfg +0 -0
- {pingwizard-1.0.24 → pingwizard-1.0.26}/setup.py +0 -0
|
@@ -3,8 +3,7 @@ import os, sys
|
|
|
3
3
|
import platform
|
|
4
4
|
import subprocess
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
import PySimpleGUI as sg
|
|
6
|
+
import FreeSimpleGUI as sg
|
|
8
7
|
|
|
9
8
|
# Get user's home directory
|
|
10
9
|
home_path = os.path.expanduser('~')
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import sys, os
|
|
3
3
|
import time
|
|
4
|
-
import
|
|
4
|
+
import subprocess
|
|
5
5
|
from pingwizard.version import __version__ as pwversion
|
|
6
6
|
from pingwizard.check_available_updates import check
|
|
7
7
|
|
|
8
8
|
from pingmapper.version import __version__ as pmversion
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
try:
|
|
12
|
-
import PySimpleGUI as sg
|
|
13
|
-
# Import freesimplegui if available for better performance, otherwise fall back to PySimpleGUI
|
|
14
|
-
except ImportError:
|
|
15
|
-
try:
|
|
16
|
-
import FreeSimpleGUI as sg
|
|
17
|
-
except ImportError:
|
|
18
|
-
print("Neither PySimpleGUI nor FreeSimpleGUI is installed. Please install one of these packages to run the PING Wizard.")
|
|
19
|
-
sys.exit(1)
|
|
10
|
+
import FreeSimpleGUI as sg
|
|
20
11
|
|
|
21
12
|
# Script directory
|
|
22
13
|
# Add 'pingmapper' to the path, may not need after pypi package...
|
|
@@ -39,9 +30,6 @@ def wizard():
|
|
|
39
30
|
if 'PINGINSTALLER_VERBOSITY' not in os.environ:
|
|
40
31
|
os.environ['PINGINSTALLER_VERBOSITY'] = 'debug'
|
|
41
32
|
|
|
42
|
-
# Save the original sys.argv
|
|
43
|
-
original_argv = sys.argv
|
|
44
|
-
|
|
45
33
|
##########################
|
|
46
34
|
# Define the layout blocks
|
|
47
35
|
|
|
@@ -98,15 +86,73 @@ def wizard():
|
|
|
98
86
|
|
|
99
87
|
layout2 =[[sg.Column(layout, scrollable=True, vertical_scroll_only=True, size_subsample_height=1)]]
|
|
100
88
|
window = sg.Window('PING Wizard', layout2, resizable=True)
|
|
89
|
+
pre_minimize_state = {'state': 'normal'}
|
|
90
|
+
|
|
91
|
+
def _minimize_wizard(win):
|
|
92
|
+
# Force a repaint before blocking on subprocess so minimize is visible.
|
|
93
|
+
try:
|
|
94
|
+
win.refresh()
|
|
95
|
+
except Exception:
|
|
96
|
+
pass
|
|
97
|
+
|
|
98
|
+
try:
|
|
99
|
+
pre_minimize_state['state'] = win.TKroot.state()
|
|
100
|
+
except Exception:
|
|
101
|
+
pre_minimize_state['state'] = 'normal'
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
win.minimize()
|
|
105
|
+
except Exception:
|
|
106
|
+
try:
|
|
107
|
+
win.TKroot.iconify()
|
|
108
|
+
except Exception:
|
|
109
|
+
win.Disappear()
|
|
110
|
+
|
|
111
|
+
# Give the window manager a moment to process minimize events.
|
|
112
|
+
time.sleep(0.1)
|
|
113
|
+
|
|
114
|
+
def _restore_wizard(win):
|
|
115
|
+
restored = False
|
|
116
|
+
try:
|
|
117
|
+
win.TKroot.deiconify()
|
|
118
|
+
win.Reappear()
|
|
119
|
+
win.TKroot.lift()
|
|
120
|
+
win.TKroot.focus_force()
|
|
121
|
+
restored = True
|
|
122
|
+
except Exception:
|
|
123
|
+
pass
|
|
124
|
+
|
|
125
|
+
if not restored:
|
|
126
|
+
try:
|
|
127
|
+
win.normal()
|
|
128
|
+
restored = True
|
|
129
|
+
except Exception:
|
|
130
|
+
pass
|
|
131
|
+
|
|
132
|
+
if not restored:
|
|
133
|
+
try:
|
|
134
|
+
win.Reappear()
|
|
135
|
+
except Exception:
|
|
136
|
+
pass
|
|
137
|
+
|
|
138
|
+
try:
|
|
139
|
+
win.refresh()
|
|
140
|
+
except Exception:
|
|
141
|
+
pass
|
|
101
142
|
|
|
102
143
|
|
|
103
144
|
#################
|
|
104
145
|
# Open the wizard
|
|
105
146
|
while True:
|
|
106
|
-
|
|
147
|
+
read_result = window.read()
|
|
148
|
+
if read_result is None:
|
|
149
|
+
break
|
|
150
|
+
event, values = read_result
|
|
107
151
|
if event == "exit_pingwizard" or event == "Submit":
|
|
108
152
|
break
|
|
109
|
-
|
|
153
|
+
|
|
154
|
+
module_name = None
|
|
155
|
+
module_args = []
|
|
110
156
|
|
|
111
157
|
# Launch PINGMapper GUI
|
|
112
158
|
if event == "launch_pingmapper_gui":
|
|
@@ -140,7 +186,6 @@ def wizard():
|
|
|
140
186
|
print("A new window will open to run the installer from base.")
|
|
141
187
|
print("The wizard will close to release environment locks.")
|
|
142
188
|
|
|
143
|
-
import subprocess
|
|
144
189
|
import tempfile
|
|
145
190
|
|
|
146
191
|
conda_base = os.environ.get('CONDA_PREFIX', '').split('envs')[0].rstrip(os.sep)
|
|
@@ -186,17 +231,20 @@ pause
|
|
|
186
231
|
module_name = "pinginstaller"
|
|
187
232
|
module_args = ["check"]
|
|
188
233
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
234
|
+
# Ignore non-launch events so the wizard does not re-minimize/relaunch unexpectedly.
|
|
235
|
+
if module_name is None:
|
|
236
|
+
continue
|
|
237
|
+
|
|
238
|
+
_minimize_wizard(window)
|
|
239
|
+
try:
|
|
240
|
+
# Run the selected module in a child process to avoid GUI state conflicts.
|
|
241
|
+
cmd = [sys.executable, '-m', module_name, *module_args]
|
|
242
|
+
result = subprocess.run(cmd, env=os.environ.copy())
|
|
243
|
+
if result.returncode != 0:
|
|
244
|
+
print(f"Warning: {module_name} exited with code {result.returncode}")
|
|
245
|
+
finally:
|
|
246
|
+
time.sleep(1)
|
|
247
|
+
_restore_wizard(window)
|
|
200
248
|
|
|
201
249
|
# window.close()
|
|
202
250
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.0.26'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.0.24'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|