Fixed some code style issues. release-5.3.1

Thu, 24 Oct 2013 18:56:00 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 24 Oct 2013 18:56:00 +0200
changeset 28
1dae294006e8
parent 27
ff4bcced7a34
child 29
512772773720

Fixed some code style issues.

ChangeLog file | annotate | diff | comparison | revisions
PluginPyLint.e4p file | annotate | diff | comparison | revisions
PluginPyLint.py file | annotate | diff | comparison | revisions
PluginPyLint.zip file | annotate | diff | comparison | revisions
PyLint/Documentation/source/Plugin_Checker_PyLint.PluginPyLint.html file | annotate | diff | comparison | revisions
PyLint/Documentation/source/Plugin_Checker_PyLint.PyLint.PyLintConfigDialog.html file | annotate | diff | comparison | revisions
PyLint/Documentation/source/Plugin_Checker_PyLint.PyLint.PyLintExecDialog.html file | annotate | diff | comparison | revisions
PyLint/Documentation/source/index-Plugin_Checker_PyLint.PyLint.html file | annotate | diff | comparison | revisions
PyLint/PyLintConfigDialog.py file | annotate | diff | comparison | revisions
PyLint/PyLintExecDialog.py file | annotate | diff | comparison | revisions
--- a/ChangeLog	Sun Oct 13 18:33:34 2013 +0200
+++ b/ChangeLog	Thu Oct 24 18:56:00 2013 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 5.3.1:
+- fixed some code style issues
+
 Version 5.3.0:
 (compatible with Eric5.1.0 or greater)
 - bug fixes
--- a/PluginPyLint.e4p	Sun Oct 13 18:33:34 2013 +0200
+++ b/PluginPyLint.e4p	Thu Oct 24 18:56:00 2013 +0200
@@ -1,15 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE Project SYSTEM "Project-5.1.dtd">
 <!-- eric5 project file for project PluginPyLint -->
-<!-- Saved: 2013-09-26, 22:44:25 -->
-<!-- Copyright (C) 2013 Detlev Offenbach, detlev@die-offenbachs.de -->
 <Project version="5.1">
   <Language>en_US</Language>
   <Hash>abcf6641287ab95ca3df062cd9840dd92df2e42f</Hash>
   <ProgLanguage mixed="0">Python3</ProgLanguage>
   <ProjectType>E4Plugin</ProjectType>
   <Description>This plugin implements an eric5 interface to the pylint checker.</Description>
-  <Version>5.3.0</Version>
+  <Version>5.3.x</Version>
   <Author>Detlev Offenbach</Author>
   <Email>detlev@die-offenbachs.de</Email>
   <TranslationPattern>PyLint/i18n/pylint_%language%.ts</TranslationPattern>
@@ -220,6 +218,12 @@
         <value>
           <dict>
             <key>
+              <string>DocstringType</string>
+            </key>
+            <value>
+              <string>eric</string>
+            </value>
+            <key>
               <string>ExcludeFiles</string>
             </key>
             <value>
@@ -229,7 +233,7 @@
               <string>ExcludeMessages</string>
             </key>
             <value>
-              <string>E24, E501, W293</string>
+              <string>E24, W293, N802, N803, N807, N808, N821</string>
             </value>
             <key>
               <string>FixCodes</string>
@@ -244,12 +248,30 @@
               <bool>False</bool>
             </value>
             <key>
+              <string>HangClosing</string>
+            </key>
+            <value>
+              <bool>False</bool>
+            </value>
+            <key>
               <string>IncludeMessages</string>
             </key>
             <value>
               <string></string>
             </value>
             <key>
+              <string>MaxLineLength</string>
+            </key>
+            <value>
+              <int>79</int>
+            </value>
+            <key>
+              <string>NoFixCodes</string>
+            </key>
+            <value>
+              <string>E501</string>
+            </value>
+            <key>
               <string>RepeatMessages</string>
             </key>
             <value>
--- a/PluginPyLint.py	Sun Oct 13 18:33:34 2013 +0200
+++ b/PluginPyLint.py	Thu Oct 24 18:56:00 2013 +0200
@@ -27,7 +27,8 @@
     from E5Gui import E5MessageBox
     error = ""
 except ImportError:
-    error = QCoreApplication.translate("PyLintPlugin",
+    error = QCoreApplication.translate(
+        "PyLintPlugin",
         """Your version of Eric5 is not supported."""
         """ At least version 5.1.0 of Eric5 is needed.""")
 
@@ -39,12 +40,13 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "5.3.0"
+version = "5.3.1"
 className = "PyLintPlugin"
 packageName = "PyLint"
 shortDescription = "Show the PyLint dialogs."
 longDescription = """This plug-in implements the PyLint dialogs.""" \
- """ PyLint is used to check Python source files according to various rules."""
+    """ PyLint is used to check Python source files according to various""" \
+    """ rules."""
 needsRestart = False
 pyqtApi = 2
 # End-of-Header
@@ -52,6 +54,7 @@
 exePy2 = []
 exePy3 = []
 
+
 def exeDisplayDataList():
     """
     Public method to support the display of some executable info.
@@ -62,8 +65,8 @@
     dataList = []
     data = {
         "programEntry": True,
-        "header": QCoreApplication.translate("PyLintPlugin",
-                                "Checkers - Pylint"),
+        "header": QCoreApplication.translate(
+            "PyLintPlugin", "Checkers - Pylint"),
         "exe": 'dummypylint',
         "versionCommand": '--version',
         "versionStartsWith": 'dummypylint',
@@ -80,6 +83,7 @@
         dataList.append(data)
     return dataList
 
+
 def __getProgramVersion(exe):
     """
     Private method to generate a program entry.
@@ -93,8 +97,8 @@
     finished = proc.waitForFinished(10000)
     if finished:
         output = str(proc.readAllStandardOutput(),
-                        Preferences.getSystem("IOEncoding"),
-                        'replace')
+                     Preferences.getSystem("IOEncoding"),
+                     'replace')
         versionRe = re.compile('^pylint', re.UNICODE)
         for line in output.splitlines():
             if versionRe.search(line):
@@ -105,6 +109,7 @@
             version = '0.0.0'
     return version
 
+
 def _findExecutable(majorVersion):
     """
     Restricted function to determine the name and path of the executable.
@@ -146,24 +151,28 @@
         
         for minorVersion in minorVersions:
             versionStr = '{0}.{1}'.format(majorVersion, minorVersion)
-            exePath = getExePath(winreg.HKEY_CURRENT_USER,
+            exePath = getExePath(
+                winreg.HKEY_CURRENT_USER,
                 winreg.KEY_WOW64_32KEY | winreg.KEY_READ, versionStr)
                 
             if exePath is not None:
                 executables.add(exePath)
-            exePath = getExePath(winreg.HKEY_LOCAL_MACHINE,
+            exePath = getExePath(
+                winreg.HKEY_LOCAL_MACHINE,
                 winreg.KEY_WOW64_32KEY | winreg.KEY_READ, versionStr)
             
             # Even on Intel 64-bit machines it's 'AMD64'
             if platform.machine() == 'AMD64':
                 if exePath is not None:
                     executables.add(exePath)
-                exePath = getExePath(winreg.HKEY_CURRENT_USER,
+                exePath = getExePath(
+                    winreg.HKEY_CURRENT_USER,
                     winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr)
                 
                 if exePath is not None:
                     executables.add(exePath)
-                exePath = getExePath(winreg.HKEY_LOCAL_MACHINE,
+                exePath = getExePath(
+                    winreg.HKEY_LOCAL_MACHINE,
                     winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr)
                 
                 if exePath is not None:
@@ -173,10 +182,10 @@
         # Linux, Unix ...
         pylintScript = 'pylint'
         scriptSuffixes = ["",
-                    "-python{0}".format(majorVersion)]
+                          "-python{0}".format(majorVersion)]
         for minorVersion in minorVersions:
             scriptSuffixes.append(
-                    "-python{0}.{1}".format(majorVersion, minorVersion))
+                "-python{0}.{1}".format(majorVersion, minorVersion))
         # There could be multiple pylint executables in the path
         # e.g. for different python variants
         path = Utilities.getEnvironmentEntry('PATH')
@@ -228,6 +237,7 @@
 
     return maxExe, maxVersion
 
+
 def _checkProgram():
     """
     Restricted function to check the availability of pylint.
@@ -239,12 +249,12 @@
     exePy2 = _findExecutable(2)
     exePy3 = _findExecutable(3)
     if exePy2[0] == '' and exePy3[0] == '':
-        error = QCoreApplication.translate("PyLintPlugin",
-            "The pylint executable could not be found.")
+        error = QCoreApplication.translate(
+            "PyLintPlugin", "The pylint executable could not be found.")
         return False
     elif exePy2[1] < '0.23.0' and exePy3[1] < '0.23.0':
-        error = QCoreApplication.translate("PyLintPlugin",
-            "PyLint version < 0.23.0.")
+        error = QCoreApplication.translate(
+            "PyLintPlugin", "PyLint version < 0.23.0.")
         return False
     else:
         return True
@@ -302,47 +312,54 @@
         
         menu = e5App().getObject("Project").getMenu("Checks")
         if menu:
-            self.__projectAct = E5Action(self.trUtf8('Run PyLint'),
-                    self.trUtf8('Run &PyLint...'), 0, 0,
-                    self, 'project_check_pylint')
+            self.__projectAct = E5Action(
+                self.trUtf8('Run PyLint'),
+                self.trUtf8('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(
                 """<b>Run PyLint...</b>"""
-                """<p>This checks the project, packages or modules using pylint.</p>"""
+                """<p>This checks the project, packages or modules using"""
+                """ pylint.</p>"""
             ))
             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, 'project_check_pylintshow')
-            self.__projectShowAct.setStatusTip(
-                self.trUtf8('Show the PyLint dialog with the results of the last run.'))
+            self.__projectShowAct = E5Action(
+                self.trUtf8('Show PyLint Dialog'),
+                self.trUtf8('Show Py&Lint Dialog...'), 0, 0,
+                self, 'project_check_pylintshow')
+            self.__projectShowAct.setStatusTip(self.trUtf8(
+                'Show the PyLint dialog with the results of the last run.'))
             self.__projectShowAct.setWhatsThis(self.trUtf8(
                 """<b>Show PyLint Dialog...</b>"""
                 """<p>This shows the PyLint dialog with the results"""
                 """ of the last run.</p>"""
             ))
-            self.__projectShowAct.triggered[()].connect(self.__projectPylintShow)
+            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, "")
+        self.__editorAct = E5Action(
+            self.trUtf8('Run PyLint'),
+            self.trUtf8('Run &PyLint...'), 0, 0,
+            self, "")
         self.__editorAct.setWhatsThis(self.trUtf8(
-                """<b>Run PyLint...</b>"""
-                """<p>This checks the loaded module using pylint.</p>"""
+            """<b>Run PyLint...</b>"""
+            """<p>This checks the loaded module using pylint.</p>"""
         ))
         self.__editorAct.triggered[()].connect(self.__editorPylint)
         
         e5App().getObject("Project").showMenu.connect(self.__projectShowMenu)
         e5App().getObject("ProjectBrowser").getProjectBrowser("sources")\
             .showMenu.connect(self.__projectBrowserShowMenu)
-        e5App().getObject("ViewManager").editorOpenedEd.connect(self.__editorOpened)
-        e5App().getObject("ViewManager").editorClosedEd.connect(self.__editorClosed)
+        e5App().getObject("ViewManager").editorOpenedEd.connect(
+            self.__editorOpened)
+        e5App().getObject("ViewManager").editorClosedEd.connect(
+            self.__editorClosed)
         
         for editor in e5App().getObject("ViewManager").getOpenEditors():
             self.__editorOpened(editor)
@@ -354,26 +371,33 @@
         """
         Public method to deactivate this plugin.
         """
-        e5App().getObject("Project").showMenu.disconnect(self.__projectShowMenu)
+        e5App().getObject("Project").showMenu.disconnect(
+            self.__projectShowMenu)
         e5App().getObject("ProjectBrowser").getProjectBrowser("sources")\
             .showMenu.disconnect(self.__projectBrowserShowMenu)
-        e5App().getObject("ViewManager").editorOpenedEd.disconnect(self.__editorOpened)
-        e5App().getObject("ViewManager").editorClosedEd.disconnect(self.__editorClosed)
+        e5App().getObject("ViewManager").editorOpenedEd.disconnect(
+            self.__editorOpened)
+        e5App().getObject("ViewManager").editorClosedEd.disconnect(
+            self.__editorClosed)
         
         menu = e5App().getObject("Project").getMenu("Checks")
         if menu:
             if self.__projectAct:
                 menu.removeAction(self.__projectAct)
-                e5App().getObject("Project").removeE5Actions([self.__projectAct])
+                e5App().getObject("Project").removeE5Actions(
+                    [self.__projectAct])
             if self.__projectShowAct:
                 menu.removeAction(self.__projectShowAct)
-                e5App().getObject("Project").removeE5Actions([self.__projectShowAct])
+                e5App().getObject("Project").removeE5Actions(
+                    [self.__projectShowAct])
         
         if self.__projectBrowserMenu:
             if self.__projectBrowserAct:
-                self.__projectBrowserMenu.removeAction(self.__projectBrowserAct)
+                self.__projectBrowserMenu.removeAction(
+                    self.__projectBrowserAct)
             if self.__projectBrowserShowAct:
-                self.__projectBrowserMenu.removeAction(self.__projectBrowserShowAct)
+                self.__projectBrowserMenu.removeAction(
+                    self.__projectBrowserShowAct)
         
         for editor in self.__editors:
             editor.showMenu.disconnect(self.__editorShowMenu)
@@ -399,8 +423,8 @@
                     self.__translator = translator
                     e5App().installTranslator(self.__translator)
                 else:
-                    print("Warning: translation file '{0}' could not be loaded."\
-                        .format(translation))
+                    print("Warning: translation file '{0}' could not be"
+                          " loaded.".format(translation))
                     print("Using default.")
     
     def __projectShowMenu(self, menuName, menu):
@@ -428,12 +452,14 @@
         @param menu reference to the menu (QMenu)
         """
         if menuName == "Checks" and \
-           e5App().getObject("Project").getProjectLanguage().startswith("Python"):
+           e5App().getObject("Project").getProjectLanguage()\
+                .startswith("Python"):
             self.__projectBrowserMenu = menu
             if self.__projectBrowserAct is None:
-                self.__projectBrowserAct = E5Action(self.trUtf8('Run PyLint'),
-                        self.trUtf8('Run &PyLint...'), 0, 0,
-                        self, '')
+                self.__projectBrowserAct = E5Action(
+                    self.trUtf8('Run PyLint'),
+                    self.trUtf8('Run &PyLint...'), 0, 0,
+                    self, '')
                 self.__projectBrowserAct.setWhatsThis(self.trUtf8(
                     """<b>Run PyLint...</b>"""
                     """<p>This checks the project, packages or modules"""
@@ -443,10 +469,10 @@
                     self.__projectBrowserPylint)
             
             if self.__projectBrowserShowAct is None:
-                self.__projectBrowserShowAct = \
-                        E5Action(self.trUtf8('Show PyLint Dialog'),
-                        self.trUtf8('Show Py&Lint Dialog...'), 0, 0,
-                        self, '')
+                self.__projectBrowserShowAct = E5Action(
+                    self.trUtf8('Show PyLint Dialog'),
+                    self.trUtf8('Show Py&Lint Dialog...'), 0, 0,
+                    self, '')
                 self.__projectBrowserShowAct.setWhatsThis(self.trUtf8(
                     """<b>Show PyLint Dialog...</b>"""
                     """<p>This shows the PyLint dialog with the results"""
@@ -459,7 +485,8 @@
                 menu.addAction(self.__projectBrowserAct)
             if not self.__projectBrowserShowAct in menu.actions():
                 menu.addAction(self.__projectBrowserShowAct)
-            self.__projectBrowserShowAct.setEnabled(self.__pylintPsbDialog is not None)
+            self.__projectBrowserShowAct.setEnabled(
+                self.__pylintPsbDialog is not None)
     
     def __pyLint(self, project, mpName, forProject, forEditor=False):
         """
@@ -468,6 +495,7 @@
         @param project reference to the Project object
         @param mpName name of module or package to be checked (string)
         @param forProject flag indicating a run for the project (boolean)
+        @param forEditor flag indicating a run for an editor (boolean)
         """
         if forEditor:
             parms = copy.deepcopy(self.__editorParms)
@@ -477,14 +505,16 @@
             parms = project.getData('CHECKERSPARMS', "PYLINT")
             majorVersionStr = project.getProjectLanguage()
         exe, version = {"Python": exePy2, "Python2": exePy2,
-                              "Python3": exePy3}.get(majorVersionStr)
+                        "Python3": exePy3}.get(majorVersionStr)
         if exe == '':
-            E5MessageBox.critical(None,
+            E5MessageBox.critical(
+                None,
                 self.trUtf8("pylint"),
                 self.trUtf8("""The pylint executable could not be found."""))
             return
         elif version < '0.23.0':
-            E5MessageBox.critical(None,
+            E5MessageBox.critical(
+                None,
                 self.trUtf8("pylint"),
                 self.trUtf8("PyLint version < 0.23.0."))
             return
@@ -501,7 +531,8 @@
             from PyLint.PyLintExecDialog import PyLintExecDialog
             dlg2 = PyLintExecDialog()
             reportFile = parms.get('reportFile', None)
-            res = dlg2.start(args, mpName, reportFile, project.getProjectPath())
+            res = dlg2.start(args, mpName, reportFile,
+                             project.getProjectPath())
             if res:
                 dlg2.show()
             if forProject:
@@ -532,7 +563,8 @@
         sources browser.
         """
         project = e5App().getObject("Project")
-        browser = e5App().getObject("ProjectBrowser").getProjectBrowser("sources")
+        browser = e5App().getObject("ProjectBrowser")\
+            .getProjectBrowser("sources")
         itm = browser.model().item(browser.currentIndex())
         try:
             fn = itm.fileName()
@@ -582,7 +614,8 @@
         if menuName == "Checks":
             if not self.__editorAct in menu.actions():
                 menu.addAction(self.__editorAct)
-            self.__editorAct.setEnabled(editor.isPy3File() or editor.isPy2File())
+            self.__editorAct.setEnabled(
+                editor.isPy3File() or editor.isPy2File())
     
     def __editorPylint(self):
         """
Binary file PluginPyLint.zip has changed
--- a/PyLint/Documentation/source/Plugin_Checker_PyLint.PluginPyLint.html	Sun Oct 13 18:33:34 2013 +0200
+++ b/PyLint/Documentation/source/Plugin_Checker_PyLint.PluginPyLint.html	Thu Oct 24 18:56:00 2013 +0200
@@ -251,6 +251,9 @@
 </dd><dt><i>forProject</i></dt>
 <dd>
 flag indicating a run for the project (boolean)
+</dd><dt><i>forEditor</i></dt>
+<dd>
+flag indicating a run for an editor (boolean)
 </dd>
 </dl><a NAME="PyLintPlugin.activate" ID="PyLintPlugin.activate"></a>
 <h4>PyLintPlugin.activate</h4>
--- a/PyLint/Documentation/source/Plugin_Checker_PyLint.PyLint.PyLintConfigDialog.html	Sun Oct 13 18:33:34 2013 +0200
+++ b/PyLint/Documentation/source/Plugin_Checker_PyLint.PyLint.PyLintConfigDialog.html	Thu Oct 24 18:56:00 2013 +0200
@@ -21,7 +21,7 @@
 <body><a NAME="top" ID="top"></a>
 <h1>Plugin_Checker_PyLint.PyLint.PyLintConfigDialog</h1>
 <p>
-Module implementing a dialog to configure the PyLint process
+Module implementing a dialog to configure the PyLint process.
 </p>
 <h3>Global Attributes</h3>
 <table>
@@ -31,7 +31,7 @@
 <table>
 <tr>
 <td><a href="#PyLintConfigDialog">PyLintConfigDialog</a></td>
-<td>Class implementing a dialog to configure the PyLint process</td>
+<td>Class implementing a dialog to configure the PyLint process.</td>
 </tr>
 </table>
 <h3>Functions</h3>
@@ -42,7 +42,7 @@
 <a NAME="PyLintConfigDialog" ID="PyLintConfigDialog"></a>
 <h2>PyLintConfigDialog</h2>
 <p>
-    Class implementing a dialog to configure the PyLint process
+    Class implementing a dialog to configure the PyLint process.
 </p>
 <h3>Derived from</h3>
 QDialog, Ui_PyLintConfigDialog
@@ -137,12 +137,14 @@
 <h4>PyLintConfigDialog.__readStderr</h4>
 <b>__readStderr</b>(<i></i>)
 <p>
-        Private slot to handle the readyReadStandardError signal of the pylint process.
+        Private slot to handle the readyReadStandardError signal of the
+        pylint process.
 </p><a NAME="PyLintConfigDialog.__readStdout" ID="PyLintConfigDialog.__readStdout"></a>
 <h4>PyLintConfigDialog.__readStdout</h4>
 <b>__readStdout</b>(<i></i>)
 <p>
-        Private slot to handle the readyReadStandardOutput signal of the pylint process.
+        Private slot to handle the readyReadStandardOutput signal of the
+        pylint process.
 </p><a NAME="PyLintConfigDialog.accept" ID="PyLintConfigDialog.accept"></a>
 <h4>PyLintConfigDialog.accept</h4>
 <b>accept</b>(<i></i>)
@@ -162,13 +164,13 @@
         list can be passed back upon object generation to overwrite
         the default settings.
 </p><p>
-        <b>Note</b>: The arguments list contains the name of the pylint executable as
-        the first parameter.
+        <b>Note</b>: The arguments list contains the name of the pylint
+        executable as the first parameter.
 </p><dl>
 <dt>Returns:</dt>
 <dd>
-a tuple of the commandline parameters and non default parameters
-            (list of strings, dictionary)
+a tuple of the commandline parameters and non default
+            parameters (list of strings, dictionary)
 </dd>
 </dl><a NAME="PyLintConfigDialog.on_configButton_clicked" ID="PyLintConfigDialog.on_configButton_clicked"></a>
 <h4>PyLintConfigDialog.on_configButton_clicked</h4>
--- a/PyLint/Documentation/source/Plugin_Checker_PyLint.PyLint.PyLintExecDialog.html	Sun Oct 13 18:33:34 2013 +0200
+++ b/PyLint/Documentation/source/Plugin_Checker_PyLint.PyLint.PyLintExecDialog.html	Thu Oct 24 18:56:00 2013 +0200
@@ -142,7 +142,8 @@
 <h4>PyLintExecDialog.__readParseStdout</h4>
 <b>__readParseStdout</b>(<i></i>)
 <p>
-        Private slot to handle the readyReadStandardOutput signal for parseable output.
+        Private slot to handle the readyReadStandardOutput signal for
+        parseable output.
 </p><p>
         It reads the output of the process, formats it and inserts it into
         the message list pane.
--- a/PyLint/Documentation/source/index-Plugin_Checker_PyLint.PyLint.html	Sun Oct 13 18:33:34 2013 +0200
+++ b/PyLint/Documentation/source/index-Plugin_Checker_PyLint.PyLint.html	Thu Oct 24 18:56:00 2013 +0200
@@ -29,7 +29,7 @@
 <table>
 <tr>
 <td><a href="Plugin_Checker_PyLint.PyLint.PyLintConfigDialog.html">PyLintConfigDialog</a></td>
-<td>Module implementing a dialog to configure the PyLint process</td>
+<td>Module implementing a dialog to configure the PyLint process.</td>
 </tr><tr>
 <td><a href="Plugin_Checker_PyLint.PyLint.PyLintExecDialog.html">PyLintExecDialog</a></td>
 <td>Module implementing a dialog to show the results of the PyLint run.</td>
--- a/PyLint/PyLintConfigDialog.py	Sun Oct 13 18:33:34 2013 +0200
+++ b/PyLint/PyLintConfigDialog.py	Thu Oct 24 18:56:00 2013 +0200
@@ -4,7 +4,7 @@
 #
 
 """
-Module implementing a dialog to configure the PyLint process
+Module implementing a dialog to configure the PyLint process.
 """
 
 from __future__ import unicode_literals     # __IGNORE_WARNING__
@@ -31,7 +31,7 @@
 
 class PyLintConfigDialog(QDialog, Ui_PyLintConfigDialog):
     """
-    Class implementing a dialog to configure the PyLint process
+    Class implementing a dialog to configure the PyLint process.
     """
     def __init__(self, ppath, exe, parms, version):
         """
@@ -78,13 +78,16 @@
         self.formatCheckBox.setChecked(self.parameters['enableFormat'])
         self.importsCheckBox.setChecked(self.parameters['enableImports'])
         self.metricsCheckBox.setChecked(self.parameters['enableMetrics'])
-        self.miscellaneousCheckBox.setChecked(self.parameters['enableMiscellaneous'])
+        self.miscellaneousCheckBox.setChecked(
+            self.parameters['enableMiscellaneous'])
         self.newstyleCheckBox.setChecked(self.parameters['enableNewstyle'])
-        self.similaritiesCheckBox.setChecked(self.parameters['enableSimilarities'])
+        self.similaritiesCheckBox.setChecked(
+            self.parameters['enableSimilarities'])
         self.typecheckCheckBox.setChecked(self.parameters['enableTypecheck'])
         self.variablesCheckBox.setChecked(self.parameters['enableVariables'])
         self.loggingCheckBox.setChecked(self.parameters['enableLogging'])
-        self.stringFormatCheckBox.setChecked(self.parameters['enableStringFormat'])
+        self.stringFormatCheckBox.setChecked(
+            self.parameters['enableStringFormat'])
         
         # initialize messages tab
         self.enabledMessagesEdit.setText(self.parameters['enabledMessages'])
@@ -138,11 +141,11 @@
         list can be passed back upon object generation to overwrite
         the default settings.
         
-        <b>Note</b>: The arguments list contains the name of the pylint executable as
-        the first parameter.
+        <b>Note</b>: The arguments list contains the name of the pylint
+        executable as the first parameter.
         
-        @return a tuple of the commandline parameters and non default parameters
-            (list of strings, dictionary)
+        @return a tuple of the commandline parameters and non default
+            parameters (list of strings, dictionary)
         """
         parms = {}
         args = []
@@ -245,7 +248,8 @@
             self,
             self.trUtf8("Select configuration file"),
             startWith,
-            self.trUtf8("Configuration Files (*.cfg *.cnf *.rc);;All Files (*)"))
+            self.trUtf8("Configuration Files (*.cfg *.cnf *.rc);;"
+                        "All Files (*)"))
         if config:
             self.configfileEdit.setText(Utilities.toNativeSeparators(config))
     
@@ -284,17 +288,21 @@
         self.parameters['enableBasic'] = self.basicCheckBox.isChecked()
         self.parameters['enableClasses'] = self.classesCheckBox.isChecked()
         self.parameters['enableDesign'] = self.designCheckBox.isChecked()
-        self.parameters['enableExceptions'] = self.exceptionsCheckBox.isChecked()
+        self.parameters['enableExceptions'] = \
+            self.exceptionsCheckBox.isChecked()
         self.parameters['enableFormat'] = self.formatCheckBox.isChecked()
         self.parameters['enableImports'] = self.importsCheckBox.isChecked()
         self.parameters['enableMetrics'] = self.metricsCheckBox.isChecked()
-        self.parameters['enableMiscellaneous'] = self.miscellaneousCheckBox.isChecked()
+        self.parameters['enableMiscellaneous'] = \
+            self.miscellaneousCheckBox.isChecked()
         self.parameters['enableNewstyle'] = self.newstyleCheckBox.isChecked()
-        self.parameters['enableSimilarities'] = self.similaritiesCheckBox.isChecked()
+        self.parameters['enableSimilarities'] = \
+            self.similaritiesCheckBox.isChecked()
         self.parameters['enableTypecheck'] = self.typecheckCheckBox.isChecked()
         self.parameters['enableVariables'] = self.variablesCheckBox.isChecked()
         self.parameters['enableLogging'] = self.loggingCheckBox.isChecked()
-        self.parameters['enableStringFormat'] = self.stringFormatCheckBox.isChecked()
+        self.parameters['enableStringFormat'] = \
+            self.stringFormatCheckBox.isChecked()
         
         # get data of messages tab
         self.parameters['enabledMessages'] = ','.join(
@@ -305,9 +313,9 @@
         # call the accept slot of the base class
         super(PyLintConfigDialog, self).accept()
 
-    ############################################################################
+    ###########################################################################
     ## Methods below are needed to generate a configuration file template
-    ############################################################################
+    ###########################################################################
 
     @pyqtSlot()
     def on_configButton_clicked(self):
@@ -331,7 +339,8 @@
         if procStarted:
             e5App().getObject("ViewManager").enableEditorsCheckFocusIn(False)
         else:
-            E5MessageBox.critical(self,
+            E5MessageBox.critical(
+                self,
                 self.trUtf8('Process Generation Error'),
                 self.trUtf8(
                     'Could not start {0}.<br>'
@@ -356,19 +365,22 @@
     
     def __readStdout(self):
         """
-        Private slot to handle the readyReadStandardOutput signal of the pylint process.
+        Private slot to handle the readyReadStandardOutput signal of the
+        pylint process.
         """
         if self.pylintProc is None:
             return
         self.pylintProc.setReadChannel(QProcess.StandardOutput)
         
         while self.pylintProc and self.pylintProc.canReadLine():
-            line = str(self.pylintProc.readLine(), self.__ioEncoding, "replace").rstrip()
+            line = str(self.pylintProc.readLine(), self.__ioEncoding,
+                       "replace").rstrip()
             self.buf += line + os.linesep
         
     def __readStderr(self):
         """
-        Private slot to handle the readyReadStandardError signal of the pylint process.
+        Private slot to handle the readyReadStandardError signal of the
+        pylint process.
         """
         if self.pylintProc is None:
             return
--- a/PyLint/PyLintExecDialog.py	Sun Oct 13 18:33:34 2013 +0200
+++ b/PyLint/PyLintExecDialog.py	Thu Oct 24 18:56:00 2013 +0200
@@ -54,7 +54,8 @@
         
         self.refreshButton = self.buttonBox.addButton(
             self.trUtf8("Refresh"), QDialogButtonBox.ActionRole)
-        self.refreshButton.setToolTip(self.trUtf8("Press to refresh the result display"))
+        self.refreshButton.setToolTip(self.trUtf8(
+            "Press to refresh the result display"))
         self.refreshButton.setEnabled(False)
         
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
@@ -121,7 +122,8 @@
         if "--output-format=parseable" in args:
             self.reportFile = None
             self.contents.hide()
-            self.process.readyReadStandardOutput.connect(self.__readParseStdout)
+            self.process.readyReadStandardOutput.connect(
+                self.__readParseStdout)
             self.parsedOutput = True
         else:
             self.process.readyReadStandardOutput.connect(self.__readStdout)
@@ -144,7 +146,8 @@
         self.process.start(program, args)
         procStarted = self.process.waitForStarted()
         if not procStarted:
-            E5MessageBox.critical(None,
+            E5MessageBox.critical(
+                self,
                 self.trUtf8('Process Generation Error'),
                 self.trUtf8(
                     'The process {0} could not be started. '
@@ -197,13 +200,16 @@
         self.refreshButton.setEnabled(True)
         if self.parsedOutput:
             QApplication.processEvents()
-            self.messageList.sortItems(self.messageList.sortColumn(),
-                                       self.messageList.header().sortIndicatorOrder())
-            self.messageList.header().resizeSections(QHeaderView.ResizeToContents)
+            self.messageList.sortItems(
+                self.messageList.sortColumn(),
+                self.messageList.header().sortIndicatorOrder())
+            self.messageList.header().resizeSections(
+                QHeaderView.ResizeToContents)
             self.messageList.header().setStretchLastSection(True)
         else:
             if self.__scrollPosition != -1:
-                self.contents.verticalScrollBar().setValue(self.__scrollPosition)
+                self.contents.verticalScrollBar().setValue(
+                    self.__scrollPosition)
         
         self.process = None
         
@@ -213,7 +219,8 @@
             self.saveButton.setEnabled(True)
         
         if self.noResults:
-            self.__createItem(self.trUtf8('No PyLint errors found.'), "", "", "")
+            self.__createItem(
+                self.trUtf8('No PyLint errors found.'), "", "", "")
     
     @pyqtSlot()
     def on_refreshButton_clicked(self):
@@ -270,7 +277,8 @@
     
     def __readParseStdout(self):
         """
-        Private slot to handle the readyReadStandardOutput signal for parseable output.
+        Private slot to handle the readyReadStandardOutput signal for
+        parseable output.
         
         It reads the output of the process, formats it and inserts it into
         the message list pane.
@@ -292,13 +300,13 @@
                     message = message.strip()
                     if type_ and type_[0] in self.typeDict:
                         if len(type_) == 1:
-                            self.__createItem(fname, lineno,
-                                              self.typeDict[type_], message)
+                            self.__createItem(
+                                fname, lineno, self.typeDict[type_], message)
                         else:
-                            self.__createItem(fname, lineno,
-                                              "{0} {1}".format(
-                                                self.typeDict[type_[0]], type_[1:]),
-                                              message)
+                            self.__createItem(
+                                fname, lineno, "{0} {1}".format(
+                                    self.typeDict[type_[0]], type_[1:]),
+                                message)
                         self.noResults = False
                 except ValueError:
                     continue
@@ -335,7 +343,8 @@
             vm = e5App().getObject("ViewManager")
             vm.openSourceFile(fn, lineno)
             editor = vm.getOpenEditor(fn)
-            editor.toggleFlakesWarning(lineno, True,
+            editor.toggleFlakesWarning(
+                lineno, True,
                 "{0} | {1}".format(itm.text(1), itm.text(2)))
         else:
             fn = os.path.join(self.pathname, itm.data(0, self.filenameRole))
@@ -345,7 +354,8 @@
             for index in range(itm.childCount()):
                 citm = itm.child(index)
                 lineno = int(citm.text(0))
-                editor.toggleFlakesWarning(lineno, True,
+                editor.toggleFlakesWarning(
+                    lineno, True,
                     "{0} | {1}".format(citm.text(1), citm.text(2)))
         
     def __writeReport(self):
@@ -354,13 +364,15 @@
         """
         self.reportFile = self.reportFile
         if os.path.exists(self.reportFile):
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.warning(
+                self,
                 self.trUtf8("PyLint Report"),
                 self.trUtf8(
-                    """<p>The PyLint report file <b>{0}</b> already exists.</p>""")\
-                    .format(self.reportFile),
+                    """<p>The PyLint report file <b>{0}</b> already"""
+                    """ exists.</p>""")
+                .format(self.reportFile),
                 E5MessageBox.StandardButtons(
-                    E5MessageBox.Cancel | \
+                    E5MessageBox.Cancel |
                     E5MessageBox.Ignore),
                 E5MessageBox.Cancel)
             if res == E5MessageBox.Cancel:
@@ -373,10 +385,11 @@
             f.write(self.buf.encode('utf-8'))
             f.close()
         except IOError as why:
-            E5MessageBox.critical(self, self.trUtf8('PyLint Report'),
-                self.trUtf8('<p>The PyLint report file <b>{0}</b> could not be written.'
-                            '<br>Reason: {1}</p>')
-                    .format(self.reportFile, str(why)))
+            E5MessageBox.critical(
+                self, self.trUtf8('PyLint Report'),
+                self.trUtf8('<p>The PyLint report file <b>{0}</b> could not'
+                            ' be written.<br>Reason: {1}</p>')
+                .format(self.reportFile, str(why)))
     
     @pyqtSlot()
     def on_saveButton_clicked(self):

eric ide

mercurial