|
14 | 14 |
|
15 | 15 | import sys
|
16 | 16 | import os
|
17 |
| -# import os.path as osp |
18 | 17 | from pathlib import Path
|
19 | 18 | # import subprocess
|
20 | 19 |
|
@@ -44,19 +43,15 @@ def _get_shortcut_data(target, current=True):
|
44 | 43 | wpgroup = utils.create_winpython_start_menu_folder(
|
45 | 44 | current=current
|
46 | 45 | )
|
47 |
| - # wpdir = osp.join(target, os.pardir) |
48 | 46 | wpdir = str(Path(target).parent)
|
49 | 47 | data = []
|
50 | 48 | for name in os.listdir(wpdir):
|
51 |
| - # bname, ext = osp.splitext(name) |
52 | 49 | bname, ext = Path(name).stem, Path(name).suffix
|
53 | 50 | if ext == '.exe':
|
54 | 51 | data.append(
|
55 | 52 | (
|
56 |
| - # osp.join(wpdir, name), |
57 | 53 | str(Path(wpdir) / name),
|
58 | 54 | bname,
|
59 |
| - # osp.join(wpgroup, bname), |
60 | 55 | str(Path(wpgroup) / bname),
|
61 | 56 | )
|
62 | 57 | )
|
@@ -118,24 +113,11 @@ def register(target, current=True):
|
118 | 113 | )
|
119 | 114 |
|
120 | 115 | # Verbs
|
121 |
| - # python = osp.abspath(osp.join(target, 'python.exe')) |
122 |
| - # python = osp.abspath(str(Path(target) / 'python.exe')) |
123 | 116 | python = str((Path(target) / 'python.exe').resolve())
|
124 |
| - # pythonw = osp.abspath(osp.join(target, 'pythonw.exe')) |
125 |
| - #pythonw = osp.abspath(str(Path(target) / 'pythonw.exe')) |
126 | 117 | pythonw = str((Path(target) / 'pythonw.exe').resolve())
|
127 |
| - #spyder = osp.abspath( |
128 |
| - # # osp.join(target, os.pardir, 'Spyder.exe') |
129 |
| - # str(Path(target).parent / 'Spyder.exe') |
130 |
| - #) |
131 | 118 | spyder = str((Path(target).parent / 'Spyder.exe').resolve())
|
132 | 119 |
|
133 |
| - # if not osp.isfile(spyder): |
134 | 120 | if not Path(spyder).is_file():
|
135 |
| - #spyder = '%s" "%s\Scripts\spyder' % ( |
136 |
| - # pythonw, |
137 |
| - # target, |
138 |
| - #) |
139 | 121 | spyder = f'{pythonw}" "{target}\Scripts\spyder'
|
140 | 122 | winreg.SetValueEx(
|
141 | 123 | winreg.CreateKey(root, KEY_C2 % ("", "open")),
|
@@ -202,7 +184,6 @@ def register(target, current=True):
|
202 | 184 | handler,
|
203 | 185 | )
|
204 | 186 | # Icons
|
205 |
| - # dlls = osp.join(target, 'DLLs') |
206 | 187 | dlls = str(Path(target) / 'DLLs')
|
207 | 188 | winreg.SetValueEx(
|
208 | 189 | winreg.CreateKey(root, KEY_I % ""),
|
@@ -374,7 +355,6 @@ def unregister(target, current=True):
|
374 | 355 | for path, desc, fname in _get_shortcut_data(
|
375 | 356 | target, current=current
|
376 | 357 | ):
|
377 |
| - # if osp.exists(fname): |
378 | 358 | if Path(fname).exists():
|
379 | 359 | os.remove(fname)
|
380 | 360 |
|
|
0 commit comments