Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

changeset 4556
25d1fa006bf0
parent 4514
e410e76d6538
child 4563
881340f4bd0c
child 4632
ca310db386ed
equal deleted inserted replaced
4555:861e1741985c 4556:25d1fa006bf0
24 import UI.PixmapCache 24 import UI.PixmapCache
25 import Preferences 25 import Preferences
26 import Utilities 26 import Utilities
27 27
28 from . import pep8 28 from . import pep8
29
30 try:
31 basestring
32 except:
33 basestring = str # define for Python3
29 34
30 35
31 class CodeStyleCheckerDialog(QDialog, Ui_CodeStyleCheckerDialog): 36 class CodeStyleCheckerDialog(QDialog, Ui_CodeStyleCheckerDialog):
32 """ 37 """
33 Class implementing a dialog to show the results of the code style check. 38 Class implementing a dialog to show the results of the code style check.
448 @param source source text (list of str or str) 453 @param source source text (list of str or str)
449 @return list of checker options 454 @return list of checker options
450 """ 455 """
451 options = self.__options[:] 456 options = self.__options[:]
452 flags = Utilities.extractFlags(source) 457 flags = Utilities.extractFlags(source)
453 if "noqa" in flags and isinstance(flags["noqa"], str): 458 if "noqa" in flags and isinstance(flags["noqa"], basestring):
454 excludeMessages = \ 459 excludeMessages = \
455 options[0].strip().rstrip(",") 460 options[0].strip().rstrip(",")
456 if excludeMessages: 461 if excludeMessages:
457 excludeMessages += "," 462 excludeMessages += ","
458 excludeMessages += flags["noqa"] 463 excludeMessages += flags["noqa"]

eric ide

mercurial