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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingwizard
3
- Version: 1.0.24
3
+ Version: 1.0.26
4
4
  Summary: Light-weight interface for running PING ecosystem (PINGMapper, etc.)
5
5
  Author: Cameron Bodine
6
6
  Author-email: bodine.cs@gmail.email
@@ -3,8 +3,7 @@ import os, sys
3
3
  import platform
4
4
  import subprocess
5
5
 
6
- PySimpleGUI_License = 'e3yAJ9MVaOWANplCbmndNNl2VwHvlCwpZTSjIl6DIjkiRGpYc53aRty8aBWpJF1qdwGLlzv9bUiHILs3Inkyxpp5Yq2OVku8cg2ZVrJ7RNCQI66bMcTLcnyKMbTRMK57OCTPMGxGNtS8whirTBGTlLjxZEWg5DzWZdUXRUlLcDGfxnv7eiWB1jlOb6nqR8WTZ2XsJVzbabW19ouWI6j0oXiKN0Si4AwtI7iFw8iGTBmtFftjZEUxZMpYcLncNk0rIJj4oyisQq2uFCtqZnXWJvvqbEiCICsSIbkC5jhKbvWTVqM2YtX6Ni0XIJjloji1QEmU9Ak5ayWp5nlnIwi3wiiOQK279ytqcKGwFGuvepS6IH6iIOiYIGs7I4kYNQ13cY33RkvIbqWkVyypSKUOQoiZO2ijIFzaMNTEAp0bNxyWI1sLIwkRRjhZdNGBVoJkcZ3MNN1yZMWTQtihOiieIYyXMDDIIF0ILaTyAt36LKTREj5JI1iYwcixRgGuFk0BZGU5VZ4dciGUl3ykZ3XtMbilOMiBIhy1M5DtId1mL6T1A935LYTLEN5iI3iJwoirR8Wa12h5a0WtxkBNZdGiRJyYZXX9N5zZI2jSoZizYpmp9YkHaIWz5YluLTmcNXzNQmGZd0twYGW6l3sALZmTNWvubcSEItsPITk6lFQgQUWZRrkfcEmAVxz0c9y7IG6sILjZEYyzO8Cf4c0WLDj3QCwSLwjPEt2BMMi0J69p854e39898f71ea82d3a530f7a6ed8a02a4eea9ffd2c7b1279074b491c71b411f392e6d726a2d2f9dbf63388356cf4e083e358fe428852d676073e128607b9ad194c15e34a4feb463a749fd3295606caa293b823d102e854cd845b79b5ec5eaec0b2ef7f9cf0c87b2dfcad3f14cd0d66a2da97e6b38a535eb8707b4486c9802a4bfeb09703382e157449096f0e3551af9f444197cacb3f3d42187cea97ab61978985ddeecd086b9cb86c4ec1c08082d47b3ed0ae9c044d9aa65e5c9bf6e00238f78ed858cfdaf0021fb95d636e0cce84d84d2c2da7ac57f2e54fe793fce44a8b8abf96ce7c381f4b7eeb55dc4b68768e8172a4dffc1b683e62a108b2dfc2ef340dab058e6ee5c1f525f93e89d39258862f099987a8ec7022db5aecb5a58e81d02370d5717d18498ae58749aa5e463cf757ab7fa84efe49c1b770da397eef22423696ad433e7232646e279906bef084b21714ac5fc2af564a03ebc789123aed44531765b3e72c6165131feab68e35e0276a64760ee9abf043bece1e3cd148bcec97ab835395391387ff9d2b74a835a15ea5bac9c7e1218c217481a3999a91e037a138aaf5dddadb2247141242140b130e273aab5e1e6855fae8b7ee80d64be2d09a46f3d49555f53a7a849138fc3b9d2323658ea7e86a0039c40f3c15fd3647f99ec98232d9734a5933177c48c6575a1415e2808640cfb27773e728fe128b99757'
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 runpy
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
- PySimpleGUI_License = 'e3yAJ9MVaOWANplCbmndNNl2VwHvlCwpZTSjIl6DIjkiRGpYc53aRty8aBWpJF1qdwGLlzv9bUiHILs3Inkyxpp5Yq2OVku8cg2ZVrJ7RNCQI66bMcTLcnyKMbTRMK57OCTPMGxGNtS8whirTBGTlLjxZEWg5DzWZdUXRUlLcDGfxnv7eiWB1jlOb6nqR8WTZ2XsJVzbabW19ouWI6j0oXiKN0Si4AwtI7iFw8iGTBmtFftjZEUxZMpYcLncNk0rIJj4oyisQq2uFCtqZnXWJvvqbEiCICsSIbkC5jhKbvWTVqM2YtX6Ni0XIJjloji1QEmU9Ak5ayWp5nlnIwi3wiiOQK279ytqcKGwFGuvepS6IH6iIOiYIGs7I4kYNQ13cY33RkvIbqWkVyypSKUOQoiZO2ijIFzaMNTEAp0bNxyWI1sLIwkRRjhZdNGBVoJkcZ3MNN1yZMWTQtihOiieIYyXMDDIIF0ILaTyAt36LKTREj5JI1iYwcixRgGuFk0BZGU5VZ4dciGUl3ykZ3XtMbilOMiBIhy1M5DtId1mL6T1A935LYTLEN5iI3iJwoirR8Wa12h5a0WtxkBNZdGiRJyYZXX9N5zZI2jSoZizYpmp9YkHaIWz5YluLTmcNXzNQmGZd0twYGW6l3sALZmTNWvubcSEItsPITk6lFQgQUWZRrkfcEmAVxz0c9y7IG6sILjZEYyzO8Cf4c0WLDj3QCwSLwjPEt2BMMi0J69p854e39898f71ea82d3a530f7a6ed8a02a4eea9ffd2c7b1279074b491c71b411f392e6d726a2d2f9dbf63388356cf4e083e358fe428852d676073e128607b9ad194c15e34a4feb463a749fd3295606caa293b823d102e854cd845b79b5ec5eaec0b2ef7f9cf0c87b2dfcad3f14cd0d66a2da97e6b38a535eb8707b4486c9802a4bfeb09703382e157449096f0e3551af9f444197cacb3f3d42187cea97ab61978985ddeecd086b9cb86c4ec1c08082d47b3ed0ae9c044d9aa65e5c9bf6e00238f78ed858cfdaf0021fb95d636e0cce84d84d2c2da7ac57f2e54fe793fce44a8b8abf96ce7c381f4b7eeb55dc4b68768e8172a4dffc1b683e62a108b2dfc2ef340dab058e6ee5c1f525f93e89d39258862f099987a8ec7022db5aecb5a58e81d02370d5717d18498ae58749aa5e463cf757ab7fa84efe49c1b770da397eef22423696ad433e7232646e279906bef084b21714ac5fc2af564a03ebc789123aed44531765b3e72c6165131feab68e35e0276a64760ee9abf043bece1e3cd148bcec97ab835395391387ff9d2b74a835a15ea5bac9c7e1218c217481a3999a91e037a138aaf5dddadb2247141242140b130e273aab5e1e6855fae8b7ee80d64be2d09a46f3d49555f53a7a849138fc3b9d2323658ea7e86a0039c40f3c15fd3647f99ec98232d9734a5933177c48c6575a1415e2808640cfb27773e728fe128b99757'
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
- event, values = window.read()
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
- window.Disappear()
190
- sys.argv = [module_name, *module_args]
191
-
192
- # Ensure environment is properly set for installer (mamba/conda detection)
193
- # The installer relies on CONDA_PREFIX to find mamba
194
- if 'CONDA_PREFIX' not in os.environ:
195
- os.environ['CONDA_PREFIX'] = os.environ.get('CONDA_DEFAULT_ENV', '')
196
-
197
- runpy.run_module(module_name, run_name="__main__")
198
- time.sleep(1)
199
- window.Reappear()
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingwizard
3
- Version: 1.0.24
3
+ Version: 1.0.26
4
4
  Summary: Light-weight interface for running PING ecosystem (PINGMapper, etc.)
5
5
  Author: Cameron Bodine
6
6
  Author-email: bodine.cs@gmail.email
@@ -1 +0,0 @@
1
- __version__ = '1.0.24'
File without changes
File without changes
File without changes
File without changes