PluginPyLint.py

changeset 31
d8e6de5a0cb7
parent 30
de4b620a6e88
child 32
b0a6368042b9
equal deleted inserted replaced
30:de4b620a6e88 31:d8e6de5a0cb7
30 error = QCoreApplication.translate( 30 error = QCoreApplication.translate(
31 "PyLintPlugin", 31 "PyLintPlugin",
32 """Your version of Eric5 is not supported.""" 32 """Your version of Eric5 is not supported."""
33 """ At least version 5.1.0 of Eric5 is needed.""") 33 """ At least version 5.1.0 of Eric5 is needed.""")
34 34
35 from Project.ProjectBrowserModel import ProjectBrowserFileItem
36
35 import Preferences 37 import Preferences
36 import Utilities 38 import Utilities
37 39
38 # Start-of-Header 40 # Start-of-Header
39 name = "PyLint Plugin" 41 name = "PyLint Plugin"
40 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 42 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
41 autoactivate = True 43 autoactivate = True
42 deactivateable = True 44 deactivateable = True
43 version = "5.3.1" 45 version = "5.3.2"
44 className = "PyLintPlugin" 46 className = "PyLintPlugin"
45 packageName = "PyLint" 47 packageName = "PyLint"
46 shortDescription = "Show the PyLint dialogs." 48 shortDescription = "Show the PyLint dialogs."
47 longDescription = """This plug-in implements the PyLint dialogs.""" \ 49 longDescription = """This plug-in implements the PyLint dialogs.""" \
48 """ PyLint is used to check Python source files according to various""" \ 50 """ PyLint is used to check Python source files according to various""" \
483 485
484 if not self.__projectBrowserAct in menu.actions(): 486 if not self.__projectBrowserAct in menu.actions():
485 menu.addAction(self.__projectBrowserAct) 487 menu.addAction(self.__projectBrowserAct)
486 if not self.__projectBrowserShowAct in menu.actions(): 488 if not self.__projectBrowserShowAct in menu.actions():
487 menu.addAction(self.__projectBrowserShowAct) 489 menu.addAction(self.__projectBrowserShowAct)
488 self.__projectBrowserShowAct.setEnabled( 490
491 enable = e5App().getObject("ProjectBrowser")\
492 .getProjectBrowser("sources")\
493 .getSelectedItemsCount([ProjectBrowserFileItem]) == 1
494 self.__projectBrowserAct.setEnabled(enable)
495 self.__projectBrowserShowAct.setEnabled(enable and
489 self.__pylintPsbDialog is not None) 496 self.__pylintPsbDialog is not None)
490 497
491 def __pyLint(self, project, mpName, forProject, forEditor=False): 498 def __pyLint(self, project, mpName, forProject, forEditor=False):
492 """ 499 """
493 Private method used to perform a PyLint run. 500 Private method used to perform a PyLint run.

eric ide

mercurial