Fixed code style issues. release-5.2.1

Thu, 24 Oct 2013 19:22:57 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 24 Oct 2013 19:22:57 +0200
changeset 64
c878aac7d3f5
parent 63
22352a68d186
child 65
59d9ad32b885

Fixed code style issues.

ChangeLog file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeConfigDialog.py file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeExecDialog.py file | annotate | diff | comparison | revisions
CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeConfigDialog.html file | annotate | diff | comparison | revisions
CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeExecDialog.html file | annotate | diff | comparison | revisions
PluginCxFreeze.e4p file | annotate | diff | comparison | revisions
PluginCxFreeze.py file | annotate | diff | comparison | revisions
PluginCxFreeze.zip file | annotate | diff | comparison | revisions
--- a/ChangeLog	Sat Sep 28 13:20:17 2013 +0200
+++ b/ChangeLog	Thu Oct 24 19:22:57 2013 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 5.2.1:
+- fixed code style issues
+
 Version 5.2.0:
 (compatible with Eric5.1.0 or greater)
 - bug fix
--- a/CxFreeze/CxfreezeConfigDialog.py	Sat Sep 28 13:20:17 2013 +0200
+++ b/CxFreeze/CxfreezeConfigDialog.py	Thu Oct 24 19:22:57 2013 +0200
@@ -18,8 +18,8 @@
 import copy
 
 from PyQt4.QtCore import pyqtSlot, QDir, QProcess
-from PyQt4.QtGui import QDialog, QListWidgetItem, QFileDialog, QPushButton, QTreeView, \
-    QItemSelection, QLineEdit, QFileSystemModel
+from PyQt4.QtGui import QDialog, QListWidgetItem, QFileDialog, QPushButton, \
+    QTreeView, QItemSelection, QLineEdit, QFileSystemModel
 
 from E5Gui import E5FileDialog
 from E5Gui.E5Completers import E5FileCompleter, E5DirCompleter
@@ -32,11 +32,13 @@
 class DirFileDialog(QFileDialog):
     """
     Derived QFileDialog to select files and folders at once.
+    
     For this purpose the none native filedialog is used.
     """
     def __init__(self, parent=None, caption="", directory="", filter=""):
         """
-        Extend the normal none native file dialog to select files and folders at once.
+        Extend the normal none native file dialog to select files and folders
+        at once.
         
         @param parent parent widget of the dialog (QWidget)
         @param caption window title of the dialog (string)
@@ -51,18 +53,21 @@
         self.fileNameEdit = self.findChild(QLineEdit)
         self.directoryEntered.connect(self.on_directoryEntered)
         self.tree = self.findChild(QTreeView)
-        self.tree.selectionModel().selectionChanged.connect(self.on_selectionChanged)
+        self.tree.selectionModel().selectionChanged.connect(
+            self.on_selectionChanged)
 
     def accept(self):
         """
         Update the list with the selected files and folders.
         """
         # Avoid to close the dialog if only return is pressed
-        if self.openBtn.isEnabled() == False:
+        if not self.openBtn.isEnabled():
             return
 
-        self.selectedFilesFolders = [x.data(QFileSystemModel.FilePathRole)
-            for x in self.tree.selectionModel().selectedIndexes() if x.column() == 0]
+        self.selectedFilesFolders = [
+            x.data(QFileSystemModel.FilePathRole)
+            for x in self.tree.selectionModel().selectedIndexes()
+            if x.column() == 0]
         self.hide()
 
     @pyqtSlot(str)
@@ -88,10 +93,11 @@
         if self.tree.rootIndex() in selectedItems or selectedItems == []:
             return
         selectedFiles = [x.data(QFileSystemModel.FileNameRole)
-            for x in selectedItems if x.column() == 0]
+                         for x in selectedItems if x.column() == 0]
         enteredFiles = self.fileNameEdit.text().split('"')
         enteredFiles = [x for x in enteredFiles if x.strip() != '']
-        # Check if there is a directory in the selection. Then update the lineEdit
+        # Check if there is a directory in the selection. Then update the
+        # lineEdit.
         for selectedFile in selectedFiles:
             if selectedFile not in enteredFiles:
                 txt = '" "'.join(selectedFiles)
@@ -176,11 +182,16 @@
             self.optimizeDocRadioButton.setChecked(True)
         
         # initialize advanced tab
-        self.defaultPathEdit.setText(os.pathsep.join(self.parameters['defaultPath']))
-        self.includePathEdit.setText(os.pathsep.join(self.parameters['includePath']))
-        self.replacePathsEdit.setText(os.pathsep.join(self.parameters['replacePaths']))
-        self.includeModulesEdit.setText(','.join(self.parameters['includeModules']))
-        self.excludeModulesEdit.setText(','.join(self.parameters['excludeModules']))
+        self.defaultPathEdit.setText(
+            os.pathsep.join(self.parameters['defaultPath']))
+        self.includePathEdit.setText(
+            os.pathsep.join(self.parameters['includePath']))
+        self.replacePathsEdit.setText(
+            os.pathsep.join(self.parameters['replacePaths']))
+        self.includeModulesEdit.setText(
+            ','.join(self.parameters['includeModules']))
+        self.excludeModulesEdit.setText(
+            ','.join(self.parameters['excludeModules']))
         self.extListFileEdit.setText(self.parameters['extListFile'])
         
         # initialize additional files tab
@@ -231,8 +242,8 @@
         The second list can be passed back upon object generation to overwrite
         the default settings.
         
-        @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 = []
@@ -242,21 +253,27 @@
         
         # 2. the commandline options
         # 2.1 general options
-        if self.parameters['targetDirectory'] != self.defaults['targetDirectory']:
+        if self.parameters['targetDirectory'] != \
+                self.defaults['targetDirectory']:
             parms['targetDirectory'] = self.parameters['targetDirectory']
-            args.append('--target-dir={0}'.format(self.parameters['targetDirectory']))
+            args.append('--target-dir={0}'.format(
+                self.parameters['targetDirectory']))
         if self.parameters['targetName'] != self.defaults['targetName']:
             parms['targetName'] = self.parameters['targetName'][:]
-            args.append('--target-name={0}'.format(self.parameters['targetName']))
+            args.append('--target-name={0}'.format(
+                self.parameters['targetName']))
         parms['baseName'] = self.parameters['baseName'][:]
         if self.parameters['baseName'] != '':
             args.append('--base-name={0}'.format(self.parameters['baseName']))
         parms['initScript'] = self.parameters['initScript'][:]
         if self.parameters['initScript'] != '':
-            args.append('--init-script={0}'.format(self.parameters['initScript']))
+            args.append('--init-script={0}'.format(
+                self.parameters['initScript']))
         parms['applicationIcon'] = self.parameters['applicationIcon'][:]
-        if self.parameters['applicationIcon'] != self.defaults['applicationIcon']:
-            args.append('--icon={0}'.format(self.parameters['applicationIcon']))
+        if self.parameters['applicationIcon'] != \
+                self.defaults['applicationIcon']:
+            args.append('--icon={0}'.format(
+                self.parameters['applicationIcon']))
         parms['script'] = self.parameters['script'][:]
         if self.parameters['keepPath'] != self.defaults['keepPath']:
             parms['keepPath'] = self.parameters['keepPath']
@@ -284,17 +301,20 @@
             parms['replacePaths'] = self.parameters['replacePaths'][:]
             args.append('--replace-paths={0}'.format(
                         os.pathsep.join(self.parameters['replacePaths'])))
-        if self.parameters['includeModules'] != self.defaults['includeModules']:
+        if self.parameters['includeModules'] != \
+                self.defaults['includeModules']:
             parms['includeModules'] = self.parameters['includeModules'][:]
             args.append('--include-modules={0}'.format(
                         ','.join(self.parameters['includeModules'])))
-        if self.parameters['excludeModules'] != self.defaults['excludeModules']:
+        if self.parameters['excludeModules'] != \
+                self.defaults['excludeModules']:
             parms['excludeModules'] = self.parameters['excludeModules'][:]
             args.append('--exclude-modules={0}'.format(
                         ','.join(self.parameters['excludeModules'])))
         if self.parameters['extListFile'] != self.defaults['extListFile']:
             parms['extListFile'] = self.parameters['extListFile']
-            args.append('--ext-list-file={0}'.format(self.parameters['extListFile']))
+            args.append('--ext-list-file={0}'.format(
+                self.parameters['extListFile']))
         
         # 2.3 additional files tab
         if self.parameters['additionalFiles'] != []:
@@ -333,11 +353,14 @@
         iconsI18N = self.trUtf8("Icons")
         allFilesI18N = self.trUtf8("All files")
         if Utilities.isWindowsPlatform():
-            iconFilter = "{0} (*.ico);;{1} (*.*)".format(iconsI18N, allFilesI18N)
+            iconFilter = "{0} (*.ico);;{1} (*.*)".format(
+                iconsI18N, allFilesI18N)
         elif Utilities.isMacPlatform():
-            iconFilter = "{0} (*.icns *.png);;{1} (*.*)".format(iconsI18N, allFilesI18N)
+            iconFilter = "{0} (*.icns *.png);;{1} (*.*)".format(
+                iconsI18N, allFilesI18N)
         else:
-            iconFilter = "{0} (*.png);;{1} (*.*)".format(iconsI18N, allFilesI18N)
+            iconFilter = "{0} (*.png);;{1} (*.*)".format(
+                iconsI18N, allFilesI18N)
         
         iconList = E5FileDialog.getOpenFileName(
             self,
@@ -387,7 +410,8 @@
             dirname = os.path.dirname(dirname)
             
             # first try the fast way
-            modpath = os.path.join(dirname, "Lib", "site-packages", "cx_Freeze")
+            modpath = os.path.join(
+                dirname, "Lib", "site-packages", "cx_Freeze")
             if not os.path.exists(modpath):
                 # but if it failed search in the whole directory tree
                 modpath = None
@@ -445,12 +469,14 @@
             initList.insert(0, '')
             currentText = self.initscriptCombo.currentText()
             self.initscriptCombo.clear()
-            self.initscriptCombo.addItems([os.path.splitext(i)[0] for i in initList])
+            self.initscriptCombo.addItems(
+                [os.path.splitext(i)[0] for i in initList])
             self.initscriptCombo.setEditText(currentText)
     
     def on_fileOrFolderList_currentRowChanged(self, row):
         """
-        Private slot to handle the currentRowChanged signal of the fileOrFolderList.
+        Private slot to handle the currentRowChanged signal of the
+        fileOrFolderList.
         
         @param row the current row (integer)
         """
@@ -461,7 +487,8 @@
     @pyqtSlot(QListWidgetItem)
     def on_fileOrFolderList_itemDoubleClicked(self, itm):
         """
-        Private slot to handle the itemDoubleClicked signal of the fileOrFolderList.
+        Private slot to handle the itemDoubleClicked signal of the
+        fileOrFolderList.
         
         @param itm the selected row (QListWidgetItem)
         """
@@ -558,7 +585,7 @@
         
         # get data of the additional files tab
         additionalFiles = [self.fileOrFolderList.item(x).text()
-            for x in range(self.fileOrFolderList.count())]
+                           for x in range(self.fileOrFolderList.count())]
         self.parameters['additionalFiles'] = additionalFiles
 
         # call the accept slot of the base class
--- a/CxFreeze/CxfreezeExecDialog.py	Sat Sep 28 13:20:17 2013 +0200
+++ b/CxFreeze/CxfreezeExecDialog.py	Thu Oct 24 19:22:57 2013 +0200
@@ -56,10 +56,12 @@
         """
         Public slot to start the packager command.
         
-        @param args commandline arguments for packager program (list of strings)
+        @param args commandline arguments for packager program (list of
+            strings)
         @param parms parameters got from the config dialog (dict)
         @param ppath project path (string)
-        @param script main script name to be processed by by the packager (string)
+        @param mainscript main script name to be processed by by the packager
+            (string)
         @return flag indicating the successful start of the process
         """
         self.errorGroup.hide()
@@ -69,7 +71,8 @@
         
         self.ppath = ppath
         self.additionalFiles = parms.get('additionalFiles', [])
-        self.targetDirectory = os.path.join(parms.get('targetDirectory', 'dist'))
+        self.targetDirectory = os.path.join(
+            parms.get('targetDirectory', 'dist'))
         
         self.contents.clear()
         self.errors.clear()
@@ -83,7 +86,8 @@
         self.process.readyReadStandardError.connect(self.__readStderr)
         self.process.finished.connect(self.__finishedFreeze)
             
-        self.setWindowTitle(self.trUtf8('{0} - {1}').format(self.cmdname, script))
+        self.setWindowTitle(self.trUtf8('{0} - {1}').format(
+            self.cmdname, script))
         self.contents.insertPlainText(' '.join(args) + '\n\n')
         self.contents.ensureCursorVisible()
         
@@ -91,7 +95,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. '
@@ -147,7 +152,7 @@
         self.contents.insertPlainText(
             self.trUtf8('\n{0} finished.\n').format(self.cmdname))
         
-        self.copyProcess = copyAdditionalFiles(self)
+        self.copyProcess = CopyAdditionalFiles(self)
         self.copyProcess.insertPlainText.connect(self.contents.insertPlainText)
         self.copyProcess.finished.connect(self.__enableButtons)
         self.copyProcess.start()
@@ -199,11 +204,12 @@
             self.errors.ensureCursorVisible()
 
 
-class copyAdditionalFiles(QThread):
+class CopyAdditionalFiles(QThread):
     """
     Thread to copy the distribution dependend files.
     
-    @signal insertPlainText(text) emitted to inform user about the copy progress
+    @signal insertPlainText(text) emitted to inform user about the copy
+        progress
     """
     insertPlainText = pyqtSignal(str)
     
@@ -213,7 +219,7 @@
         
         @param main self-object of the caller
         """
-        super(copyAdditionalFiles, self).__init__()
+        super(CopyAdditionalFiles, self).__init__()
         
         self.ppath = main.ppath
         self.additionalFiles = main.additionalFiles
@@ -221,11 +227,15 @@
     
     def __copytree(self, src, dst):
         """
-        Copies a file or folder. Wildcards allowed. Existing files are overwitten.
+        Private method to copy a file or folder.
+       
+        Wildcards allowed. Existing files are overwitten.
         
         @param src source file or folder to copy. Wildcards allowed. (str)
         @param dst destination (str)
-        """
+        @exception OSError raised if there is an issue writing the package
+        @exception IOError raised if the given source does not exist
+        """                                             # __IGNORE_WARNING__
         def src2dst(srcname, base, dst):
             """
             Combines the relativ path of the source (srcname) with the
@@ -256,7 +266,8 @@
                         copied = True
                         os.makedirs(newDir)
                     except OSError as err:
-                        if err.errno != errno.EEXIST:     # it's ok if directory already exists
+                        if err.errno != errno.EEXIST:
+                            # it's ok if directory already exists
                             raise err
                 else:
                     dirs.remove(dir)
@@ -271,14 +282,18 @@
             
             # check if file was found and copied
             if len(files) and not copied:
-                raise IOError(errno.ENOENT,
-                    self.trUtf8("No such file or directory: '{0}'").format(src))
+                raise IOError(
+                    errno.ENOENT,
+                    self.trUtf8("No such file or directory: '{0}'")
+                    .format(src))
             
             initDone = True
             
     def run(self):
         """
         QThread entry point to copy the selected additional files and folders.
+        
+        @exception OSError raised if there is an issue writing the package
         """
         self.insertPlainText.emit('----\n')
         os.chdir(self.ppath)
@@ -296,11 +311,13 @@
                 try:
                     os.makedirs(dst)
                 except OSError as err:
-                    if err.errno != errno.EEXIST:     # it's ok if directory already exists
+                    if err.errno != errno.EEXIST:     # it's ok if directory
+                                                      # already exists
                         raise err
             
             try:
                 self.__copytree(fn, dst)
                 self.insertPlainText.emit(self.trUtf8('ok'))
             except IOError as err:
-                self.insertPlainText.emit(self.trUtf8('failed: {0}').format(err.strerror))
+                self.insertPlainText.emit(
+                    self.trUtf8('failed: {0}').format(err.strerror))
--- a/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeConfigDialog.html	Sat Sep 28 13:20:17 2013 +0200
+++ b/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeConfigDialog.html	Thu Oct 24 19:22:57 2013 +0200
@@ -174,8 +174,8 @@
 </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="CxfreezeConfigDialog.on_addFileOrFolderButton_clicked" ID="CxfreezeConfigDialog.on_addFileOrFolderButton_clicked"></a>
 <h4>CxfreezeConfigDialog.on_addFileOrFolderButton_clicked</h4>
@@ -219,7 +219,8 @@
 <h4>CxfreezeConfigDialog.on_fileOrFolderList_currentRowChanged</h4>
 <b>on_fileOrFolderList_currentRowChanged</b>(<i>row</i>)
 <p>
-        Private slot to handle the currentRowChanged signal of the fileOrFolderList.
+        Private slot to handle the currentRowChanged signal of the
+        fileOrFolderList.
 </p><dl>
 <dt><i>row</i></dt>
 <dd>
@@ -229,7 +230,8 @@
 <h4>CxfreezeConfigDialog.on_fileOrFolderList_itemDoubleClicked</h4>
 <b>on_fileOrFolderList_itemDoubleClicked</b>(<i>itm</i>)
 <p>
-        Private slot to handle the itemDoubleClicked signal of the fileOrFolderList.
+        Private slot to handle the itemDoubleClicked signal of the
+        fileOrFolderList.
 </p><dl>
 <dt><i>itm</i></dt>
 <dd>
@@ -267,6 +269,7 @@
 <h2>DirFileDialog</h2>
 <p>
     Derived QFileDialog to select files and folders at once.
+</p><p>
     For this purpose the none native filedialog is used.
 </p>
 <h3>Derived from</h3>
@@ -306,7 +309,8 @@
 <h4>DirFileDialog (Constructor)</h4>
 <b>DirFileDialog</b>(<i>parent=None, caption="", directory="", filter=""</i>)
 <p>
-        Extend the normal none native file dialog to select files and folders at once.
+        Extend the normal none native file dialog to select files and folders
+        at once.
 </p><dl>
 <dt><i>parent</i></dt>
 <dd>
--- a/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeExecDialog.html	Sat Sep 28 13:20:17 2013 +0200
+++ b/CxFreeze/Documentation/source/Plugin_Packager_CxFreeze.CxFreeze.CxfreezeExecDialog.html	Thu Oct 24 19:22:57 2013 +0200
@@ -30,11 +30,11 @@
 <h3>Classes</h3>
 <table>
 <tr>
+<td><a href="#CopyAdditionalFiles">CopyAdditionalFiles</a></td>
+<td>Thread to copy the distribution dependend files.</td>
+</tr><tr>
 <td><a href="#CxfreezeExecDialog">CxfreezeExecDialog</a></td>
 <td>Module implementing a dialog to show the output of the cxfreeze process.</td>
-</tr><tr>
-<td><a href="#copyAdditionalFiles">copyAdditionalFiles</a></td>
-<td>Thread to copy the distribution dependend files.</td>
 </tr>
 </table>
 <h3>Functions</h3>
@@ -42,6 +42,116 @@
 <tr><td>None</td></tr>
 </table>
 <hr /><hr />
+<a NAME="CopyAdditionalFiles" ID="CopyAdditionalFiles"></a>
+<h2>CopyAdditionalFiles</h2>
+<p>
+    Thread to copy the distribution dependend files.
+</p><h3>Signals</h3>
+<dl>
+<dt>insertPlainText(text)</dt>
+<dd>
+emitted to inform user about the copy
+        progress
+</dd>
+</dl>
+<h3>Derived from</h3>
+QThread
+<h3>Class Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Class Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+<table>
+<tr>
+<td><a href="#CopyAdditionalFiles.__init__">CopyAdditionalFiles</a></td>
+<td>Constructor, which stores the needed variables.</td>
+</tr><tr>
+<td><a href="#CopyAdditionalFiles.__copytree">__copytree</a></td>
+<td>Private method to copy a file or folder.</td>
+</tr><tr>
+<td><a href="#CopyAdditionalFiles.run">run</a></td>
+<td>QThread entry point to copy the selected additional files and folders.</td>
+</tr><tr>
+<td><a href="#CopyAdditionalFiles.src2dst">src2dst</a></td>
+<td>Combines the relativ path of the source (srcname) with the destination folder.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<a NAME="CopyAdditionalFiles.__init__" ID="CopyAdditionalFiles.__init__"></a>
+<h4>CopyAdditionalFiles (Constructor)</h4>
+<b>CopyAdditionalFiles</b>(<i>main</i>)
+<p>
+        Constructor, which stores the needed variables.
+</p><dl>
+<dt><i>main</i></dt>
+<dd>
+self-object of the caller
+</dd>
+</dl><a NAME="CopyAdditionalFiles.__copytree" ID="CopyAdditionalFiles.__copytree"></a>
+<h4>CopyAdditionalFiles.__copytree</h4>
+<b>__copytree</b>(<i>src, dst</i>)
+<p>
+        Private method to copy a file or folder.
+</p><p>
+        Wildcards allowed. Existing files are overwitten.
+</p><dl>
+<dt><i>src</i></dt>
+<dd>
+source file or folder to copy. Wildcards allowed. (str)
+</dd><dt><i>dst</i></dt>
+<dd>
+destination (str)
+</dd>
+</dl><dl>
+<dt>Raises <b>IOError</b>:</dt>
+<dd>
+raised if the given source does not exist
+</dd><dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised if there is an issue writing the package
+</dd>
+</dl><a NAME="CopyAdditionalFiles.run" ID="CopyAdditionalFiles.run"></a>
+<h4>CopyAdditionalFiles.run</h4>
+<b>run</b>(<i></i>)
+<p>
+        QThread entry point to copy the selected additional files and folders.
+</p><dl>
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised if there is an issue writing the package
+</dd>
+</dl><a NAME="CopyAdditionalFiles.src2dst" ID="CopyAdditionalFiles.src2dst"></a>
+<h4>CopyAdditionalFiles.src2dst</h4>
+<b>src2dst</b>(<i>base, dst</i>)
+<p>
+            Combines the relativ path of the source (srcname) with the
+            destination folder.
+</p><dl>
+<dt><i>srcname</i></dt>
+<dd>
+actual file or folder to copy
+</dd><dt><i>base</i></dt>
+<dd>
+basename of the source folder
+</dd><dt><i>dst</i></dt>
+<dd>
+basename of the destination folder
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+destination path
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
 <a NAME="CxfreezeExecDialog" ID="CxfreezeExecDialog"></a>
 <h2>CxfreezeExecDialog</h2>
 <p>
@@ -163,16 +273,18 @@
 </p><dl>
 <dt><i>args</i></dt>
 <dd>
-commandline arguments for packager program (list of strings)
+commandline arguments for packager program (list of
+            strings)
 </dd><dt><i>parms</i></dt>
 <dd>
 parameters got from the config dialog (dict)
 </dd><dt><i>ppath</i></dt>
 <dd>
 project path (string)
-</dd><dt><i>script</i></dt>
+</dd><dt><i>mainscript</i></dt>
 <dd>
-main script name to be processed by by the packager (string)
+main script name to be processed by by the packager
+            (string)
 </dd>
 </dl><dl>
 <dt>Returns:</dt>
@@ -181,99 +293,5 @@
 </dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
-<hr /><hr />
-<a NAME="copyAdditionalFiles" ID="copyAdditionalFiles"></a>
-<h2>copyAdditionalFiles</h2>
-<p>
-    Thread to copy the distribution dependend files.
-</p><h3>Signals</h3>
-<dl>
-<dt>insertPlainText(text)</dt>
-<dd>
-emitted to inform user about the copy progress
-</dd>
-</dl>
-<h3>Derived from</h3>
-QThread
-<h3>Class Attributes</h3>
-<table>
-<tr><td>None</td></tr>
-</table>
-<h3>Class Methods</h3>
-<table>
-<tr><td>None</td></tr>
-</table>
-<h3>Methods</h3>
-<table>
-<tr>
-<td><a href="#copyAdditionalFiles.__init__">copyAdditionalFiles</a></td>
-<td>Constructor, which stores the needed variables.</td>
-</tr><tr>
-<td><a href="#copyAdditionalFiles.__copytree">__copytree</a></td>
-<td>Copies a file or folder.</td>
-</tr><tr>
-<td><a href="#copyAdditionalFiles.run">run</a></td>
-<td>QThread entry point to copy the selected additional files and folders.</td>
-</tr><tr>
-<td><a href="#copyAdditionalFiles.src2dst">src2dst</a></td>
-<td>Combines the relativ path of the source (srcname) with the destination folder.</td>
-</tr>
-</table>
-<h3>Static Methods</h3>
-<table>
-<tr><td>None</td></tr>
-</table>
-<a NAME="copyAdditionalFiles.__init__" ID="copyAdditionalFiles.__init__"></a>
-<h4>copyAdditionalFiles (Constructor)</h4>
-<b>copyAdditionalFiles</b>(<i>main</i>)
-<p>
-        Constructor, which stores the needed variables.
-</p><dl>
-<dt><i>main</i></dt>
-<dd>
-self-object of the caller
-</dd>
-</dl><a NAME="copyAdditionalFiles.__copytree" ID="copyAdditionalFiles.__copytree"></a>
-<h4>copyAdditionalFiles.__copytree</h4>
-<b>__copytree</b>(<i>src, dst</i>)
-<p>
-        Copies a file or folder. Wildcards allowed. Existing files are overwitten.
-</p><dl>
-<dt><i>src</i></dt>
-<dd>
-source file or folder to copy. Wildcards allowed. (str)
-</dd><dt><i>dst</i></dt>
-<dd>
-destination (str)
-</dd>
-</dl><a NAME="copyAdditionalFiles.run" ID="copyAdditionalFiles.run"></a>
-<h4>copyAdditionalFiles.run</h4>
-<b>run</b>(<i></i>)
-<p>
-        QThread entry point to copy the selected additional files and folders.
-</p><a NAME="copyAdditionalFiles.src2dst" ID="copyAdditionalFiles.src2dst"></a>
-<h4>copyAdditionalFiles.src2dst</h4>
-<b>src2dst</b>(<i>base, dst</i>)
-<p>
-            Combines the relativ path of the source (srcname) with the
-            destination folder.
-</p><dl>
-<dt><i>srcname</i></dt>
-<dd>
-actual file or folder to copy
-</dd><dt><i>base</i></dt>
-<dd>
-basename of the source folder
-</dd><dt><i>dst</i></dt>
-<dd>
-basename of the destination folder
-</dd>
-</dl><dl>
-<dt>Returns:</dt>
-<dd>
-destination path
-</dd>
-</dl>
-<div align="right"><a href="#top">Up</a></div>
 <hr />
 </body></html>
\ No newline at end of file
--- a/PluginCxFreeze.e4p	Sat Sep 28 13:20:17 2013 +0200
+++ b/PluginCxFreeze.e4p	Thu Oct 24 19:22:57 2013 +0200
@@ -7,7 +7,7 @@
   <ProgLanguage mixed="0">Python3</ProgLanguage>
   <ProjectType>E4Plugin</ProjectType>
   <Description>This plugin implements an eric5 interface to the cxfreeze packager.</Description>
-  <Version>5.2.0</Version>
+  <Version>5.2.x</Version>
   <Author>Detlev Offenbach</Author>
   <Email>detlev@die-offenbachs.de</Email>
   <TranslationPattern>CxFreeze/i18n/cxfreeze_%language%.ts</TranslationPattern>
@@ -233,6 +233,12 @@
         <value>
           <dict>
             <key>
+              <string>DocstringType</string>
+            </key>
+            <value>
+              <string>eric</string>
+            </value>
+            <key>
               <string>ExcludeFiles</string>
             </key>
             <value>
@@ -242,7 +248,7 @@
               <string>ExcludeMessages</string>
             </key>
             <value>
-              <string>E24, W293, E501</string>
+              <string>E24, W293, N802, N803, N807, N808, N821</string>
             </value>
             <key>
               <string>FixCodes</string>
@@ -254,7 +260,13 @@
               <string>FixIssues</string>
             </key>
             <value>
-              <bool>True</bool>
+              <bool>False</bool>
+            </value>
+            <key>
+              <string>HangClosing</string>
+            </key>
+            <value>
+              <bool>False</bool>
             </value>
             <key>
               <string>IncludeMessages</string>
@@ -263,6 +275,18 @@
               <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/PluginCxFreeze.py	Sat Sep 28 13:20:17 2013 +0200
+++ b/PluginCxFreeze.py	Thu Oct 24 19:22:57 2013 +0200
@@ -21,7 +21,8 @@
     from E5Gui.E5Application import e5App
     error = ""
 except ImportError:
-    error = QCoreApplication.translate("CxFreezePlugin",
+    error = QCoreApplication.translate(
+        "CxFreezePlugin",
         """Your version of Eric5 is not supported."""
         """ At least version 5.1.0 of Eric5 is needed.""")
     
@@ -33,12 +34,13 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "5.2.0"
+version = "5.2.1"
 className = "CxFreezePlugin"
 packageName = "CxFreeze"
 shortDescription = "Show the CxFreeze dialogs."
-longDescription = """This plugin implements the CxFreeze dialogs.""" \
- """ CxFreeze is used to generate a distribution package."""
+longDescription = \
+    """This plugin implements the CxFreeze dialogs.""" \
+    """ CxFreeze is used to generate a distribution package."""
 needsRestart = False
 pyqtApi = 2
 # End-of-Header
@@ -57,7 +59,8 @@
     dataList = []
     data = {
         "programEntry": True,
-        "header": QCoreApplication.translate("CxFreezePlugin", "Packagers - cx_freeze"),
+        "header": QCoreApplication.translate(
+            "CxFreezePlugin", "Packagers - cx_freeze"),
         "exe": 'dummyfreeze',
         "versionCommand": '--version',
         "versionStartsWith": 'dummyfreeze',
@@ -117,24 +120,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:
@@ -143,17 +150,16 @@
         #
         # Linux, Unix ...
         cxfreezeScript = 'cxfreeze'
-        scriptSuffixes = ["",
-                    "-python{0}".format(majorVersion)]
+        scriptSuffixes = ["", "-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 cxfreeze executables in the path
         # e.g. for different python variants
         path = Utilities.getEnvironmentEntry('PATH')
         # environment variable not defined
         if path is None:
-            return  []
+            return []
         
         # step 1: determine possible candidates
         exes = []
@@ -205,7 +211,8 @@
     exePy2 = _findExecutable(2)
     exePy3 = _findExecutable(3)
     if (exePy2 + exePy3) == []:
-        error = QCoreApplication.translate("CxFreezePlugin",
+        error = QCoreApplication.translate(
+            "CxFreezePlugin",
             "The cxfreeze executable could not be found.")
         return False
     else:
@@ -255,17 +262,18 @@
         project = e5App().getObject("Project")
         menu = project.getMenu("Packagers")
         if menu:
-            self.__projectAct = E5Action(self.trUtf8('Use cx_freeze'),
-                    self.trUtf8('Use cx_&freeze'), 0, 0,
-                    self, 'packagers_cxfreeze')
+            self.__projectAct = E5Action(
+                self.trUtf8('Use cx_freeze'),
+                self.trUtf8('Use cx_&freeze'), 0, 0,
+                self, 'packagers_cxfreeze')
             self.__projectAct.setStatusTip(
                 self.trUtf8('Generate a distribution package using cx_freeze'))
             self.__projectAct.setWhatsThis(self.trUtf8(
-            """<b>Use cx_freeze</b>"""
-            """<p>Generate a distribution package using cx_freeze."""
-            """ The command is executed in the project path. All"""
-            """ files and directories must be given absolute or"""
-            """ relative to the project directory.</p>"""
+                """<b>Use cx_freeze</b>"""
+                """<p>Generate a distribution package using cx_freeze."""
+                """ The command is executed in the project path. All"""
+                """ files and directories must be given absolute or"""
+                """ relative to the project directory.</p>"""
             ))
             self.__projectAct.triggered[()].connect(self.__cxfreeze)
             project.addE5Actions([self.__projectAct])
@@ -283,7 +291,8 @@
         if menu:
             if self.__projectAct:
                 menu.removeAction(self.__projectAct)
-                e5App().getObject("Project").removeE5Actions([self.__projectAct])
+                e5App().getObject("Project").removeE5Actions(
+                    [self.__projectAct])
         self.__initialize()
     
     def __projectShowMenu(self, menuName, menu):
@@ -297,8 +306,8 @@
         if menuName == "Packagers":
             if self.__projectAct is not None:
                 self.__projectAct.setEnabled(
-                    e5App().getObject("Project").getProjectLanguage() in \
-                        ["Python", "Python2", "Python3"])
+                    e5App().getObject("Project").getProjectLanguage() in
+                    ["Python", "Python2", "Python3"])
     
     def __loadTranslator(self):
         """
@@ -316,8 +325,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 __cxfreeze(self):
@@ -327,17 +336,21 @@
         project = e5App().getObject("Project")
         if len(project.pdata["MAINSCRIPT"]) == 0:
             # no main script defined
-            E5MessageBox.critical(None,
+            E5MessageBox.critical(
+                self,
                 self.trUtf8("cxfreeze"),
                 self.trUtf8(
-                    """There is no main script defined for the current project."""),
+                    """There is no main script defined for the current"""
+                    """ project."""),
                 E5MessageBox.StandardButtons(E5MessageBox.Abort))
             return
         
         majorVersionStr = project.getProjectLanguage()
-        exe = {"Python": exePy2, "Python2": exePy2, "Python3": exePy3}.get(majorVersionStr)
+        exe = {"Python": exePy2, "Python2": exePy2, "Python3": exePy3}\
+            .get(majorVersionStr)
         if exe == []:
-            E5MessageBox.critical(None,
+            E5MessageBox.critical(
+                self,
                 self.trUtf8("cxfreeze"),
                 self.trUtf8("""The cxfreeze executable could not be found."""))
             return
@@ -358,6 +371,6 @@
             dia = CxfreezeExecDialog("cxfreeze")
             dia.show()
             res = dia.start(args, parms, project.ppath,
-                project.pdata["MAINSCRIPT"][0])
+                            project.pdata["MAINSCRIPT"][0])
             if res:
                 dia.exec_()
Binary file PluginCxFreeze.zip has changed

eric ide

mercurial