Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 16eb23b

Browse filesBrowse files
committed
tweak associate.py, manual step
1 parent 35e5f2d commit 16eb23b
Copy full SHA for 16eb23b

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed

‎winpython/associate.py

Copy file name to clipboardExpand all lines: winpython/associate.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def register(target, current=True, verbose=True):
130130
spyder = str((Path(target).parent / "Spyder.exe").resolve())
131131

132132
if not Path(spyder).is_file():
133-
spyder = f'{pythonw}" "{target}\Scripts\spyder'
133+
spyder = rf'{pythonw}" "{target}\Scripts\spyder'
134134
winreg.SetValueEx(
135135
winreg.CreateKey(root, KEY_C2 % ("", "open")),
136136
"",
@@ -157,14 +157,14 @@ def register(target, current=True, verbose=True):
157157
"",
158158
0,
159159
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"',
161161
)
162162
winreg.SetValueEx(
163163
winreg.CreateKey(root, KEY_C2 % ("NoCon", EWI)),
164164
"",
165165
0,
166166
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"',
168168
)
169169
winreg.SetValueEx(
170170
winreg.CreateKey(root, KEY_C2 % ("", EWS)),
@@ -338,9 +338,9 @@ def register(target, current=True, verbose=True):
338338

339339
# Create start menu entries for all WinPython launchers
340340
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:
344344
print(f'Creating WinPython menu for all icons in {target}')
345345
for path, desc, fname in _get_shortcut_data(target, current=current):
346346
utils.create_shortcut(path, desc, fname, verbose=verbose)
@@ -414,8 +414,8 @@ def unregister(target, current=True, verbose=True):
414414
)
415415
# remove menu shortcuts
416416
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")
419419
if verbose and spec is not None:
420420
print(f'Removing WinPython menu for all icons in {target}')
421421
_remove_start_menu_folder(target, current=current)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.