Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py

changeset 40
c2e5472b112c
parent 28
dde24fc7f7ba
child 53
c3eb7cc1ff8b
equal deleted inserted replaced
39:ce735122a1fb 40:c2e5472b112c
18 18
19 from .Ui_TabnannyDialog import Ui_TabnannyDialog 19 from .Ui_TabnannyDialog import Ui_TabnannyDialog
20 20
21 from . import Tabnanny 21 from . import Tabnanny
22 import Utilities 22 import Utilities
23 import Preferences
23 24
24 class TabnannyDialog(QDialog, Ui_TabnannyDialog): 25 class TabnannyDialog(QDialog, Ui_TabnannyDialog):
25 """ 26 """
26 Class implementing a dialog to show the results of the tabnanny check run. 27 Class implementing a dialog to show the results of the tabnanny check run.
27 """ 28 """
69 (string or list of strings) 70 (string or list of strings)
70 """ 71 """
71 if isinstance(fn, list): 72 if isinstance(fn, list):
72 files = fn 73 files = fn
73 elif os.path.isdir(fn): 74 elif os.path.isdir(fn):
74 # TODO: make this dependant on configured extensions 75 files = []
75 files = Utilities.direntries(fn, 1, '*.py', 0) 76 for ext in Preferences.getPython("Python3Extensions"):
76 files += Utilities.direntries(fn, 1, '*.pyw', 0) 77 files.extend(Utilities.direntries(fn, 1, '*%s' % ext, 0))
77 files += Utilities.direntries(fn, 1, '*.ptl', 0)
78 else: 78 else:
79 files = [fn] 79 files = [fn]
80 # TODO: make this dependant on configured extensions
81 files = [f for f in files \ 80 files = [f for f in files \
82 if f.endswith(".py") or f.endswith(".pyw") or f.endswith(".ptl")] 81 if f.endswith(tuple(Preferences.getPython("Python3Extensions")))]
83 82
84 if len(files) > 0: 83 if len(files) > 0:
85 self.checkProgress.setMaximum(len(files)) 84 self.checkProgress.setMaximum(len(files))
86 QApplication.processEvents() 85 QApplication.processEvents()
87 86

eric ide

mercurial