10
10
Created on Mon Aug 13 11:40:01 2012
11
11
"""
12
12
13
- # import os.path as osp
14
13
from pathlib import Path
15
14
import os
16
15
import sys
@@ -249,7 +248,6 @@ def add_packages(self, fnames):
249
248
notcompatible = []
250
249
dist = self .distribution
251
250
for fname in fnames :
252
- # bname = osp.basename(fname)
253
251
bname = Path (fname ).name
254
252
try :
255
253
package = wppm .Package (fname )
@@ -356,7 +354,7 @@ def dropEvent(self, event):
356
354
fnames = [
357
355
path
358
356
for path in mimedata2url (source )
359
- if Path (path ).is_file () # if osp.isfile(path)
357
+ if Path (path ).is_file ()
360
358
]
361
359
self .add_packages (fnames )
362
360
event .acceptProposedAction ()
@@ -408,7 +406,6 @@ def select_directory(self):
408
406
"""Select directory"""
409
407
# basedir = to_text_string(self.line_edit.text())
410
408
basedir = str (self .line_edit .text ())
411
- # if not osp.isdir(basedir):
412
409
if not Path (basedir ).is_dir ():
413
410
basedir = str (Path .cwd ()) # getcwd()
414
411
while True :
@@ -426,8 +423,6 @@ def select_directory(self):
426
423
)
427
424
basedir = directory
428
425
continue
429
- # directory = osp.abspath(osp.normpath(directory))
430
- # directory = str(Path(osp.normpath(directory)).resolve())
431
426
directory = str (Path (directory ).resolve (strict = False ))
432
427
self .set_distribution (directory )
433
428
# PyQt4 old SIGNAL: self.emit(SIGNAL('selected_distribution(QString)'), directory)
@@ -672,7 +667,6 @@ def setup_window(self):
672
667
),
673
668
)
674
669
open_console_action .setEnabled (
675
- # osp.exists(self.command_prompt_path)
676
670
Path (self .command_prompt_path ).exists ()
677
671
)
678
672
add_actions (
@@ -816,11 +810,6 @@ def unregister_distribution(self):
816
810
817
811
@property
818
812
def command_prompt_path (self ):
819
- # return osp.join(
820
- # self.distribution.target,
821
- # osp.pardir,
822
- # "WinPython Command Prompt.exe",
823
- # )
824
813
return str (Path (self .distribution .target ).parent /
825
814
"WinPython Command Prompt.exe" )
826
815
@@ -850,7 +839,6 @@ def add_packages(self):
850
839
filters = '*.exe *.zip *.tar.gz *.whl' ,
851
840
)
852
841
if fnames :
853
- # self.basedir = osp.dirname(fnames[0])
854
842
self .basedir = str (Path (fnames [0 ]).parent )
855
843
self .table .add_packages (fnames )
856
844
0 commit comments