Some fixes and improvements for the eric doc tool.

Sat, 09 Apr 2016 18:48:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 09 Apr 2016 18:48:11 +0200
changeset 4932
127d0fe00c77
parent 4929
fcab21c80811
child 4933
19f2ae7757d1

Some fixes and improvements for the eric doc tool.

Plugins/DocumentationPlugins/Ericdoc/EricdocConfigDialog.py file | annotate | diff | comparison | revisions
Plugins/DocumentationPlugins/Ericdoc/EricdocExecDialog.py file | annotate | diff | comparison | revisions
eric6.e4p file | annotate | diff | comparison | revisions
eric6_doc.py file | annotate | diff | comparison | revisions
--- a/Plugins/DocumentationPlugins/Ericdoc/EricdocConfigDialog.py	Sat Apr 09 16:34:05 2016 +0200
+++ b/Plugins/DocumentationPlugins/Ericdoc/EricdocConfigDialog.py	Sat Apr 09 18:48:11 2016 +0200
@@ -140,9 +140,9 @@
         parameters.
         """
         self.defaults = {
-            'useRecursion': 0,
-            'noindex': 0,
-            'noempty': 0,
+            'useRecursion': False,
+            'noindex': False,
+            'noempty': False,
             'outputDirectory': '',
             'ignoreDirectories': [],
             'ignoreFilePatterns': [],
@@ -209,7 +209,8 @@
             parms['ignoreFilePatterns'] = \
                 self.parameters['ignoreFilePatterns'][:]
             for pattern in self.parameters['ignoreFilePatterns']:
-                args.append("--exclude-file={0}".format(pattern))
+                if pattern.strip():
+                    args.append("--exclude-file={0}".format(pattern.strip()))
         if self.parameters['useRecursion'] != self.defaults['useRecursion']:
             parms['useRecursion'] = self.parameters['useRecursion']
             args.append('-r')
@@ -223,8 +224,8 @@
                 self.defaults['sourceExtensions']:
             parms['sourceExtensions'] = self.parameters['sourceExtensions'][:]
             for ext in self.parameters['sourceExtensions']:
-                args.append('-t')
-                args.append(ext)
+                if ext.strip():
+                    args.append("--extension={0}".format(ext.strip()))
         
         # 2b. style commandline options
         if self.parameters['cssFile'] != self.defaults['cssFile']:
@@ -526,10 +527,10 @@
         self.parameters['cssFile'] = cssFile
         extensions = self.sourceExtEdit.text().split(',')
         self.parameters['sourceExtensions'] = \
-            [ext.strip() for ext in extensions]
+            [ext.strip() for ext in extensions if ext.strip()]
         patterns = self.excludeFilesEdit.text().split(',')
         self.parameters['ignoreFilePatterns'] = \
-            [pattern.strip() for pattern in patterns]
+            [pattern.strip() for pattern in patterns if pattern.strip()]
         
         self.parameters['qtHelpEnabled'] = self.qtHelpGroup.isChecked()
         self.parameters['qtHelpOutputDirectory'] = self.qtHelpDirPicker.text()
--- a/Plugins/DocumentationPlugins/Ericdoc/EricdocExecDialog.py	Sat Apr 09 16:34:05 2016 +0200
+++ b/Plugins/DocumentationPlugins/Ericdoc/EricdocExecDialog.py	Sat Apr 09 18:48:11 2016 +0200
@@ -117,11 +117,14 @@
         It is called when the process finished or
         the user pressed the button.
         """
-        if self.process is not None and \
-           self.process.state() != QProcess.NotRunning:
-            self.process.terminate()
-            QTimer.singleShot(2000, self.process.kill)
-            self.process.waitForFinished(3000)
+        if self.process is not None:
+            if self.process.state() != QProcess.NotRunning:
+                self.process.terminate()
+                QTimer.singleShot(2000, self.process.kill)
+                self.process.waitForFinished(3000)
+            if self.process.exitStatus() == QProcess.CrashExit:
+                self.contents.insertPlainText(
+                    self.tr('\n{0} crashed.\n').format(self.cmdname))
         
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
--- a/eric6.e4p	Sat Apr 09 16:34:05 2016 +0200
+++ b/eric6.e4p	Sat Apr 09 18:48:11 2016 +0200
@@ -2446,14 +2446,6 @@
               <string>eric6</string>
             </value>
             <key>
-              <string>sourceExtensions</string>
-            </key>
-            <value>
-              <list>
-                <string></string>
-              </list>
-            </value>
-            <key>
               <string>useRecursion</string>
             </key>
             <value>
--- a/eric6_doc.py	Sat Apr 09 16:34:05 2016 +0200
+++ b/eric6_doc.py	Sat Apr 09 18:48:11 2016 +0200
@@ -212,8 +212,9 @@
         elif k in ["-c", "--style-sheet"]:
             stylesheetFile = v
         elif k in ["-t", "--extension"]:
-            if not v.startswith("."):
-                v = ".{0}".format(v)
+            if v.strip():
+                if not v.startswith("."):
+                    v = ".{0}".format(v)
             supportedExtensions.append(v)
         elif k == "--eol":
             if v.lower() == "cr":
@@ -268,10 +269,6 @@
             qtHelpTitle == ""):
         usage()
     
-    if qtHelpCreation:
-        from PyQt5.QtCore import QCoreApplication
-        app = QCoreApplication(sys.argv)    # __IGNORE_WARNING__
-
     input = output = 0
     basename = ""
 

eric ide

mercurial