eric6/Plugins/PluginCodeStyleChecker.py

changeset 7256
4ef3b78ebb4e
parent 7229
53054eb5b15a
child 7360
9190402e4505
--- a/eric6/Plugins/PluginCodeStyleChecker.py	Sat Sep 21 18:30:02 2019 +0200
+++ b/eric6/Plugins/PluginCodeStyleChecker.py	Sat Sep 21 20:30:56 2019 +0200
@@ -29,12 +29,14 @@
 className = "CodeStyleCheckerPlugin"
 packageName = "__core__"
 shortDescription = "Show the Python Code Style Checker dialog."
-longDescription = """This plugin implements the Python Code Style""" \
-    """ Checker dialog. A PEP-8 checker is used to check Python source""" \
-    """ files for compliance to the code style conventions given in PEP-8.""" \
-    """ A PEP-257 checker is used to check Python source files for""" \
-    """ compliance to docstring conventions given in PEP-257 and an""" \
+longDescription = (
+    """This plugin implements the Python Code Style"""
+    """ Checker dialog. A PEP-8 checker is used to check Python source"""
+    """ files for compliance to the code style conventions given in PEP-8."""
+    """ A PEP-257 checker is used to check Python source files for"""
+    """ compliance to docstring conventions given in PEP-257 and an"""
     """ eric6 variant is used to check against eric conventions."""
+)
 pyqtApi = 2
 # End-Of-Header
 
@@ -226,8 +228,9 @@
             lineno (int), position (int), text (str), fixed (bool),
             autofixing (bool), fixedMsg (str))
         """
-        from CheckerPlugins.CodeStyleChecker.translations import \
+        from CheckerPlugins.CodeStyleChecker.translations import (
             getTranslatedMessage
+        )
         
         fixes = 0
         for result in results:
@@ -280,8 +283,8 @@
         self.__editorAct.triggered.connect(self.__editorCodeStyleCheck)
         
         e5App().getObject("Project").showMenu.connect(self.__projectShowMenu)
-        e5App().getObject("ProjectBrowser").getProjectBrowser("sources")\
-            .showMenu.connect(self.__projectBrowserShowMenu)
+        e5App().getObject("ProjectBrowser").getProjectBrowser(
+            "sources").showMenu.connect(self.__projectBrowserShowMenu)
         e5App().getObject("ViewManager").editorOpenedEd.connect(
             self.__editorOpened)
         e5App().getObject("ViewManager").editorClosedEd.connect(
@@ -298,8 +301,8 @@
         """
         e5App().getObject("Project").showMenu.disconnect(
             self.__projectShowMenu)
-        e5App().getObject("ProjectBrowser").getProjectBrowser("sources")\
-            .showMenu.disconnect(self.__projectBrowserShowMenu)
+        e5App().getObject("ProjectBrowser").getProjectBrowser(
+            "sources").showMenu.disconnect(self.__projectBrowserShowMenu)
         e5App().getObject("ViewManager").editorOpenedEd.disconnect(
             self.__editorOpened)
         e5App().getObject("ViewManager").editorClosedEd.disconnect(
@@ -343,9 +346,11 @@
         @param menuName name of the menu to be shown (string)
         @param menu reference to the menu (QMenu)
         """
-        if menuName == "Checks" and \
-           e5App().getObject("Project").getProjectLanguage() in \
-                ["Python3", "Python2", "Python", "MicroPython"]:
+        if (
+            menuName == "Checks" and
+            e5App().getObject("Project").getProjectLanguage() in
+                ["Python3", "Python2", "Python", "MicroPython"]
+        ):
             self.__projectBrowserMenu = menu
             if self.__projectBrowserAct is None:
                 self.__projectBrowserAct = E5Action(
@@ -375,9 +380,10 @@
                      tuple(Preferences.getPython("Python3Extensions")) +
                      tuple(Preferences.getPython("PythonExtensions")))]
         
-        from CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog import \
-            CodeStyleCheckerDialog
-        self.__projectCodeStyleCheckerDialog = CodeStyleCheckerDialog(self)
+        from CheckerPlugins.CodeStyleChecker import CodeStyleCheckerDialog
+        self.__projectCodeStyleCheckerDialog = (
+            CodeStyleCheckerDialog.CodeStyleCheckerDialog(self)
+        )
         self.__projectCodeStyleCheckerDialog.show()
         self.__projectCodeStyleCheckerDialog.prepare(files, project)
     
@@ -386,8 +392,9 @@
         Private method to handle the code style check context menu action of
         the project sources browser.
         """
-        browser = e5App().getObject("ProjectBrowser")\
-            .getProjectBrowser("sources")
+        browser = (
+            e5App().getObject("ProjectBrowser").getProjectBrowser("sources")
+        )
         if browser.getSelectedItemsCount([ProjectBrowserFileItem]) > 1:
             fn = []
             for itm in browser.getSelectedItems([ProjectBrowserFileItem]):
@@ -402,10 +409,10 @@
                 fn = itm.dirName()
                 isDir = True
         
-        from CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog import \
-            CodeStyleCheckerDialog
-        self.__projectBrowserCodeStyleCheckerDialog = CodeStyleCheckerDialog(
-            self)
+        from CheckerPlugins.CodeStyleChecker import CodeStyleCheckerDialog
+        self.__projectBrowserCodeStyleCheckerDialog = (
+            CodeStyleCheckerDialog.CodeStyleCheckerDialog(self)
+        )
         self.__projectBrowserCodeStyleCheckerDialog.show()
         if isDir:
             self.__projectBrowserCodeStyleCheckerDialog.start(
@@ -459,10 +466,12 @@
         editor = e5App().getObject("ViewManager").activeWindow()
         if editor is not None:
             if editor.checkDirty() and editor.getFileName() is not None:
-                from CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog \
-                    import CodeStyleCheckerDialog
-                self.__editorCodeStyleCheckerDialog = CodeStyleCheckerDialog(
-                    self)
+                from CheckerPlugins.CodeStyleChecker import (
+                    CodeStyleCheckerDialog
+                )
+                self.__editorCodeStyleCheckerDialog = (
+                    CodeStyleCheckerDialog.CodeStyleCheckerDialog(self)
+                )
                 self.__editorCodeStyleCheckerDialog.show()
                 self.__editorCodeStyleCheckerDialog.start(
                     editor.getFileName(),

eric ide

mercurial