PluginPyLint.py

changeset 38
bf234b8941d9
parent 35
c3ca6d580760
child 43
298822c933d8
diff -r c3ca6d580760 -r bf234b8941d9 PluginPyLint.py
--- a/PluginPyLint.py	Wed Apr 30 19:58:17 2014 +0200
+++ b/PluginPyLint.py	Sun Jul 06 17:08:41 2014 +0200
@@ -18,19 +18,12 @@
 import copy
 import platform
 
-from PyQt4.QtCore import QObject, QTranslator, QCoreApplication, QProcess
-from PyQt4.QtGui import QDialog
+from PyQt5.QtCore import QObject, QTranslator, QCoreApplication, QProcess
+from PyQt5.QtWidgets import  QDialog
 
-try:
-    from E5Gui.E5Application import e5App
-    from E5Gui.E5Action import E5Action
-    from E5Gui import E5MessageBox
-    error = ""
-except ImportError:
-    error = QCoreApplication.translate(
-        "PyLintPlugin",
-        """Your version of Eric5 is not supported."""
-        """ At least version 5.1.0 of Eric5 is needed.""")
+from E5Gui.E5Application import e5App
+from E5Gui.E5Action import E5Action
+from E5Gui import E5MessageBox
 
 from Project.ProjectBrowserModel import ProjectBrowserFileItem
 
@@ -42,7 +35,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "5.4.1"
+version = "6.0.0"
 className = "PyLintPlugin"
 packageName = "PyLint"
 shortDescription = "Show the PyLint dialogs."
@@ -54,6 +47,8 @@
 python2Compatible = True
 # End-of-Header
 
+error = ""
+
 exePy2 = []
 exePy3 = []
 
@@ -317,45 +312,45 @@
         menu = e5App().getObject("Project").getMenu("Checks")
         if menu:
             self.__projectAct = E5Action(
-                self.trUtf8('Run PyLint'),
-                self.trUtf8('Run &PyLint...'), 0, 0,
+                self.tr('Run PyLint'),
+                self.tr('Run &PyLint...'), 0, 0,
                 self, 'project_check_pylint')
             self.__projectAct.setStatusTip(
-                self.trUtf8('Check project, packages or modules with pylint.'))
-            self.__projectAct.setWhatsThis(self.trUtf8(
+                self.tr('Check project, packages or modules with pylint.'))
+            self.__projectAct.setWhatsThis(self.tr(
                 """<b>Run PyLint...</b>"""
                 """<p>This checks the project, packages or modules using"""
                 """ pylint.</p>"""
             ))
-            self.__projectAct.triggered[()].connect(self.__projectPylint)
+            self.__projectAct.triggered.connect(self.__projectPylint)
             e5App().getObject("Project").addE5Actions([self.__projectAct])
             menu.addAction(self.__projectAct)
             
             self.__projectShowAct = E5Action(
-                self.trUtf8('Show PyLint Dialog'),
-                self.trUtf8('Show Py&Lint Dialog...'), 0, 0,
+                self.tr('Show PyLint Dialog'),
+                self.tr('Show Py&Lint Dialog...'), 0, 0,
                 self, 'project_check_pylintshow')
-            self.__projectShowAct.setStatusTip(self.trUtf8(
+            self.__projectShowAct.setStatusTip(self.tr(
                 'Show the PyLint dialog with the results of the last run.'))
-            self.__projectShowAct.setWhatsThis(self.trUtf8(
+            self.__projectShowAct.setWhatsThis(self.tr(
                 """<b>Show PyLint Dialog...</b>"""
                 """<p>This shows the PyLint dialog with the results"""
                 """ of the last run.</p>"""
             ))
-            self.__projectShowAct.triggered[()].connect(
+            self.__projectShowAct.triggered.connect(
                 self.__projectPylintShow)
             e5App().getObject("Project").addE5Actions([self.__projectShowAct])
             menu.addAction(self.__projectShowAct)
         
         self.__editorAct = E5Action(
-            self.trUtf8('Run PyLint'),
-            self.trUtf8('Run &PyLint...'), 0, 0,
+            self.tr('Run PyLint'),
+            self.tr('Run &PyLint...'), 0, 0,
             self, "")
-        self.__editorAct.setWhatsThis(self.trUtf8(
+        self.__editorAct.setWhatsThis(self.tr(
             """<b>Run PyLint...</b>"""
             """<p>This checks the loaded module using pylint.</p>"""
         ))
-        self.__editorAct.triggered[()].connect(self.__editorPylint)
+        self.__editorAct.triggered.connect(self.__editorPylint)
         
         e5App().getObject("Project").showMenu.connect(self.__projectShowMenu)
         e5App().getObject("ProjectBrowser").getProjectBrowser("sources")\
@@ -461,28 +456,28 @@
             self.__projectBrowserMenu = menu
             if self.__projectBrowserAct is None:
                 self.__projectBrowserAct = E5Action(
-                    self.trUtf8('Run PyLint'),
-                    self.trUtf8('Run &PyLint...'), 0, 0,
+                    self.tr('Run PyLint'),
+                    self.tr('Run &PyLint...'), 0, 0,
                     self, '')
-                self.__projectBrowserAct.setWhatsThis(self.trUtf8(
+                self.__projectBrowserAct.setWhatsThis(self.tr(
                     """<b>Run PyLint...</b>"""
                     """<p>This checks the project, packages or modules"""
                     """ using pylint.</p>"""
                 ))
-                self.__projectBrowserAct.triggered[()].connect(
+                self.__projectBrowserAct.triggered.connect(
                     self.__projectBrowserPylint)
             
             if self.__projectBrowserShowAct is None:
                 self.__projectBrowserShowAct = E5Action(
-                    self.trUtf8('Show PyLint Dialog'),
-                    self.trUtf8('Show Py&Lint Dialog...'), 0, 0,
+                    self.tr('Show PyLint Dialog'),
+                    self.tr('Show Py&Lint Dialog...'), 0, 0,
                     self, '')
-                self.__projectBrowserShowAct.setWhatsThis(self.trUtf8(
+                self.__projectBrowserShowAct.setWhatsThis(self.tr(
                     """<b>Show PyLint Dialog...</b>"""
                     """<p>This shows the PyLint dialog with the results"""
                     """ of the last run.</p>"""
                 ))
-                self.__projectBrowserShowAct.triggered[()].connect(
+                self.__projectBrowserShowAct.triggered.connect(
                     self.__projectBrowserPylintShow)
             
             if not self.__projectBrowserAct in menu.actions():
@@ -518,14 +513,14 @@
         if exe == '':
             E5MessageBox.critical(
                 None,
-                self.trUtf8("pylint"),
-                self.trUtf8("""The pylint executable could not be found."""))
+                self.tr("pylint"),
+                self.tr("""The pylint executable could not be found."""))
             return
         elif version < '0.23.0':
             E5MessageBox.critical(
                 None,
-                self.trUtf8("pylint"),
-                self.trUtf8("PyLint version < 0.23.0."))
+                self.tr("pylint"),
+                self.tr("PyLint version < 0.23.0."))
             return
         
         from PyLint.PyLintConfigDialog import PyLintConfigDialog

eric ide

mercurial