@@ -130,7 +130,7 @@ def register(target, current=True, verbose=True):
130
130
spyder = str ((Path (target ).parent / "Spyder.exe" ).resolve ())
131
131
132
132
if not Path (spyder ).is_file ():
133
- spyder = f '{ pythonw } " "{ target } \Scripts\spyder'
133
+ spyder = rf '{ pythonw } " "{ target } \Scripts\spyder'
134
134
winreg .SetValueEx (
135
135
winreg .CreateKey (root , KEY_C2 % ("" , "open" )),
136
136
"" ,
@@ -157,14 +157,14 @@ def register(target, current=True, verbose=True):
157
157
"" ,
158
158
0 ,
159
159
winreg .REG_SZ ,
160
- '"%s " "%s \Lib\idlelib\idle.pyw" -n -e "%% 1"' % ( pythonw , target ) ,
160
+ rf'" { pythonw } " "{ target } \Lib\idlelib\idle.pyw" -n -e "%1"' ,
161
161
)
162
162
winreg .SetValueEx (
163
163
winreg .CreateKey (root , KEY_C2 % ("NoCon" , EWI )),
164
164
"" ,
165
165
0 ,
166
166
winreg .REG_SZ ,
167
- '"%s " "%s \Lib\idlelib\idle.pyw" -n -e "%% 1"' % ( pythonw , target ) ,
167
+ rf'" { pythonw } " "{ target } \Lib\idlelib\idle.pyw" -n -e "%1"' ,
168
168
)
169
169
winreg .SetValueEx (
170
170
winreg .CreateKey (root , KEY_C2 % ("" , EWS )),
@@ -338,9 +338,9 @@ def register(target, current=True, verbose=True):
338
338
339
339
# Create start menu entries for all WinPython launchers
340
340
spec = importlib .util .find_spec ('pythoncom' )
341
- if verbose and spec is None :
342
- print (f"Can't create WinPython menu as pywin32 package is not installed " )
343
- if verbose and spec is not None :
341
+ if spec is None :
342
+ print (f"Registered WinPython, but not start menu as pywin32 package is needed " )
343
+ if spec is not None :
344
344
print (f'Creating WinPython menu for all icons in { target } ' )
345
345
for path , desc , fname in _get_shortcut_data (target , current = current ):
346
346
utils .create_shortcut (path , desc , fname , verbose = verbose )
@@ -414,8 +414,8 @@ def unregister(target, current=True, verbose=True):
414
414
)
415
415
# remove menu shortcuts
416
416
spec = importlib .util .find_spec ('pythoncom' )
417
- if verbose and spec is None :
418
- print (f"Can't remove WinPython menu as pywin32 package is not installed " )
417
+ if spec is None :
418
+ print (f"un-Registered WinPython, but not start menu as pywin32 package is needed " )
419
419
if verbose and spec is not None :
420
420
print (f'Removing WinPython menu for all icons in { target } ' )
421
421
_remove_start_menu_folder (target , current = current )
0 commit comments