Skip to content

Commit 7b22aa0

Browse files
authored
Merge pull request #1160 from stonebig/master
check then cleanup osp comments
2 parents 21b1f73 + 75fd232 commit 7b22aa0

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

winpython/associate.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import sys
1616
import os
17-
# import os.path as osp
1817
from pathlib import Path
1918
# import subprocess
2019

@@ -44,19 +43,15 @@ def _get_shortcut_data(target, current=True):
4443
wpgroup = utils.create_winpython_start_menu_folder(
4544
current=current
4645
)
47-
# wpdir = osp.join(target, os.pardir)
4846
wpdir = str(Path(target).parent)
4947
data = []
5048
for name in os.listdir(wpdir):
51-
# bname, ext = osp.splitext(name)
5249
bname, ext = Path(name).stem, Path(name).suffix
5350
if ext == '.exe':
5451
data.append(
5552
(
56-
# osp.join(wpdir, name),
5753
str(Path(wpdir) / name),
5854
bname,
59-
# osp.join(wpgroup, bname),
6055
str(Path(wpgroup) / bname),
6156
)
6257
)
@@ -118,24 +113,11 @@ def register(target, current=True):
118113
)
119114

120115
# Verbs
121-
# python = osp.abspath(osp.join(target, 'python.exe'))
122-
# python = osp.abspath(str(Path(target) / 'python.exe'))
123116
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'))
126117
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-
#)
131118
spyder = str((Path(target).parent / 'Spyder.exe').resolve())
132119

133-
# if not osp.isfile(spyder):
134120
if not Path(spyder).is_file():
135-
#spyder = '%s" "%s\Scripts\spyder' % (
136-
# pythonw,
137-
# target,
138-
#)
139121
spyder = f'{pythonw}" "{target}\Scripts\spyder'
140122
winreg.SetValueEx(
141123
winreg.CreateKey(root, KEY_C2 % ("", "open")),
@@ -202,7 +184,6 @@ def register(target, current=True):
202184
handler,
203185
)
204186
# Icons
205-
# dlls = osp.join(target, 'DLLs')
206187
dlls = str(Path(target) / 'DLLs')
207188
winreg.SetValueEx(
208189
winreg.CreateKey(root, KEY_I % ""),
@@ -374,7 +355,6 @@ def unregister(target, current=True):
374355
for path, desc, fname in _get_shortcut_data(
375356
target, current=current
376357
):
377-
# if osp.exists(fname):
378358
if Path(fname).exists():
379359
os.remove(fname)
380360

winpython/controlpanel.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Created on Mon Aug 13 11:40:01 2012
1111
"""
1212

13-
# import os.path as osp
1413
from pathlib import Path
1514
import os
1615
import sys
@@ -249,7 +248,6 @@ def add_packages(self, fnames):
249248
notcompatible = []
250249
dist = self.distribution
251250
for fname in fnames:
252-
# bname = osp.basename(fname)
253251
bname = Path(fname).name
254252
try:
255253
package = wppm.Package(fname)
@@ -356,7 +354,7 @@ def dropEvent(self, event):
356354
fnames = [
357355
path
358356
for path in mimedata2url(source)
359-
if Path(path).is_file() # if osp.isfile(path)
357+
if Path(path).is_file()
360358
]
361359
self.add_packages(fnames)
362360
event.acceptProposedAction()
@@ -408,7 +406,6 @@ def select_directory(self):
408406
"""Select directory"""
409407
# basedir = to_text_string(self.line_edit.text())
410408
basedir = str(self.line_edit.text())
411-
# if not osp.isdir(basedir):
412409
if not Path(basedir).is_dir():
413410
basedir = str(Path.cwd()) # getcwd()
414411
while True:
@@ -426,8 +423,6 @@ def select_directory(self):
426423
)
427424
basedir = directory
428425
continue
429-
# directory = osp.abspath(osp.normpath(directory))
430-
# directory = str(Path(osp.normpath(directory)).resolve())
431426
directory = str(Path(directory).resolve(strict=False))
432427
self.set_distribution(directory)
433428
# PyQt4 old SIGNAL: self.emit(SIGNAL('selected_distribution(QString)'), directory)
@@ -672,7 +667,6 @@ def setup_window(self):
672667
),
673668
)
674669
open_console_action.setEnabled(
675-
# osp.exists(self.command_prompt_path)
676670
Path(self.command_prompt_path).exists()
677671
)
678672
add_actions(
@@ -816,11 +810,6 @@ def unregister_distribution(self):
816810

817811
@property
818812
def command_prompt_path(self):
819-
# return osp.join(
820-
# self.distribution.target,
821-
# osp.pardir,
822-
# "WinPython Command Prompt.exe",
823-
# )
824813
return str(Path(self.distribution.target).parent /
825814
"WinPython Command Prompt.exe")
826815

@@ -850,7 +839,6 @@ def add_packages(self):
850839
filters='*.exe *.zip *.tar.gz *.whl',
851840
)
852841
if fnames:
853-
# self.basedir = osp.dirname(fnames[0])
854842
self.basedir = str(Path(fnames[0]).parent)
855843
self.table.add_packages(fnames)
856844

0 commit comments

Comments
 (0)