Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2574
9d6b6cf31ec6
parent 3004
c4bf32c791d0
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
11 11
12 import os 12 import os
13 import fnmatch 13 import fnmatch
14 14
15 from PyQt4.QtCore import pyqtSlot, Qt 15 from PyQt4.QtCore import pyqtSlot, Qt
16 from PyQt4.QtGui import QDialog, QDialogButtonBox, QTreeWidgetItem, QApplication, \ 16 from PyQt4.QtGui import QDialog, QDialogButtonBox, QTreeWidgetItem, \
17 QHeaderView 17 QApplication, QHeaderView
18 18
19 from E5Gui.E5Application import e5App 19 from E5Gui.E5Application import e5App
20 20
21 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog 21 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog
22 22
147 elif os.path.isdir(fn): 147 elif os.path.isdir(fn):
148 files = [] 148 files = []
149 extensions = set(Preferences.getPython("PythonExtensions") + 149 extensions = set(Preferences.getPython("PythonExtensions") +
150 Preferences.getPython("Python3Extensions")) 150 Preferences.getPython("Python3Extensions"))
151 for ext in extensions: 151 for ext in extensions:
152 files.extend(Utilities.direntries(fn, True, '*{0}'.format(ext), 0)) 152 files.extend(
153 Utilities.direntries(fn, True, '*{0}'.format(ext), 0))
153 else: 154 else:
154 files = [fn] 155 files = [fn]
155 156
156 if codestring == '' and len(files) > 0: 157 if codestring == '' and len(files) > 0:
157 self.checkProgress.setMaximum(len(files)) 158 self.checkProgress.setMaximum(len(files))
204 else: 205 else:
205 source = source.splitlines() 206 source = source.splitlines()
206 for warning in warnings: 207 for warning in warnings:
207 self.noResults = False 208 self.noResults = False
208 scr_line = source[warning[2]-1].strip() 209 scr_line = source[warning[2]-1].strip()
209 self.__createResultItem(warning[1], warning[2], 0, 210 self.__createResultItem(
211 warning[1], warning[2], 0,
210 warning[3], scr_line, True) 212 warning[3], scr_line, True)
211 213
212 progress += 1 214 progress += 1
213 self.checkProgress.setValue(progress) 215 self.checkProgress.setValue(progress)
214 QApplication.processEvents() 216 QApplication.processEvents()
311 index = citm.data(0, self.indexRole) 313 index = citm.data(0, self.indexRole)
312 error = citm.data(0, self.errorRole) 314 error = citm.data(0, self.errorRole)
313 if citm.data(0, self.warningRole): 315 if citm.data(0, self.warningRole):
314 editor.toggleFlakesWarning(lineno, True, error) 316 editor.toggleFlakesWarning(lineno, True, error)
315 else: 317 else:
316 editor.toggleSyntaxError(lineno, index, True, error, show=True) 318 editor.toggleSyntaxError(
319 lineno, index, True, error, show=True)
317 320
318 @pyqtSlot() 321 @pyqtSlot()
319 def on_showButton_clicked(self): 322 def on_showButton_clicked(self):
320 """ 323 """
321 Private slot to handle the "Show" button press. 324 Private slot to handle the "Show" button press.

eric ide

mercurial