Reformatted source code with 'Black'. eric7

Wed, 21 Sep 2022 16:47:33 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 21 Sep 2022 16:47:33 +0200
branch
eric7
changeset 139
4df5e67b084b
parent 138
54f57d052146
child 140
9e20ee9c7ca2

Reformatted source code with 'Black'.

.hgignore file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeConfigDialog.py file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeExecDialog.py file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeFindPath.py file | annotate | diff | comparison | revisions
PluginCxFreeze.epj file | annotate | diff | comparison | revisions
PluginCxFreeze.py file | annotate | diff | comparison | revisions
diff -r 54f57d052146 -r 4df5e67b084b .hgignore
--- a/.hgignore	Thu Dec 30 11:53:44 2021 +0100
+++ b/.hgignore	Wed Sep 21 16:47:33 2022 +0200
@@ -1,6 +1,7 @@
 glob:.eric7project
 glob:.eric6project
 glob:.ropeproject
+glob:.jedi
 glob:.directory
 glob:**.pyc
 glob:**.orig
diff -r 54f57d052146 -r 4df5e67b084b CxFreeze/CxfreezeConfigDialog.py
--- a/CxFreeze/CxfreezeConfigDialog.py	Thu Dec 30 11:53:44 2021 +0100
+++ b/CxFreeze/CxfreezeConfigDialog.py	Wed Sep 21 16:47:33 2022 +0200
@@ -28,10 +28,11 @@
     """
     Class implementing a dialog to enter the parameters for cxfreeze.
     """
+
     def __init__(self, project, exe, parms=None, parent=None):
         """
         Constructor
-        
+
         @param project reference to the project object
         @type Project
         @param exe name of the cxfreeze executable
@@ -43,231 +44,208 @@
         """
         QDialog.__init__(self, parent)
         self.setupUi(self)
-        
-        self.selectFileOrFolderButton.setIcon(
-            UI.PixmapCache.getIcon("open.png"))
-        
-        self.targetDirPicker.setMode(
-            EricPathPickerModes.DIRECTORY_MODE)
-        self.targetDirPicker.setWindowTitle(
-            self.tr("Select target directory"))
-        
+
+        self.selectFileOrFolderButton.setIcon(UI.PixmapCache.getIcon("open.png"))
+
+        self.targetDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
+        self.targetDirPicker.setWindowTitle(self.tr("Select target directory"))
+
         iconsI18N = self.tr("Icons")
         allFilesI18N = self.tr("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)
-        self.applicationIconPicker.setMode(
-            EricPathPickerModes.OPEN_FILE_MODE)
+            iconFilter = "{0} (*.png);;{1} (*.*)".format(iconsI18N, allFilesI18N)
+        self.applicationIconPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
         self.applicationIconPicker.setWindowTitle(
-            self.tr("Select the application icon"))
+            self.tr("Select the application icon")
+        )
         self.applicationIconPicker.setFilters(iconFilter)
-        
-        self.extListFilePicker.setMode(
-            EricPathPickerModes.OPEN_FILE_MODE)
-        self.extListFilePicker.setWindowTitle(
-            self.tr("Select external list file"))
-        
+
+        self.extListFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
+        self.extListFilePicker.setWindowTitle(self.tr("Select external list file"))
+
         self.__project = project
         self.__initializeDefaults()
-        
+
         # get a copy of the defaults to store the user settings
         self.__parameters = copy.deepcopy(self.defaults)
-        
+
         # combine it with the values of parms
         if parms is not None:
             self.__parameters.update(parms)
-        
+
         self.cxfreezeExecCombo.addItems(exe)
         # try to set the saved script path
         with contextlib.suppress(ValueError):
-            idx = exe.index(self.__parameters['script'])
+            idx = exe.index(self.__parameters["script"])
             self.cxfreezeExecCombo.setCurrentIndex(idx)
-        
+
         # initialize general tab
-        self.targetDirPicker.setText(
-            self.__parameters['targetDirectory'])
-        self.targetNameEdit.setText(
-            self.__parameters['targetName'])
-        self.basenameCombo.setEditText(
-            self.__parameters['baseName'])
-        self.initscriptCombo.setEditText(
-            self.__parameters['initScript'])
-        self.applicationIconPicker.setText(
-            self.__parameters['applicationIcon'])
-        self.keeppathCheckBox.setChecked(
-            self.__parameters['keepPath'])
-        self.compressCheckBox.setChecked(
-            self.__parameters['compress'])
-        if self.__parameters['optimize'] == 0:
+        self.targetDirPicker.setText(self.__parameters["targetDirectory"])
+        self.targetNameEdit.setText(self.__parameters["targetName"])
+        self.basenameCombo.setEditText(self.__parameters["baseName"])
+        self.initscriptCombo.setEditText(self.__parameters["initScript"])
+        self.applicationIconPicker.setText(self.__parameters["applicationIcon"])
+        self.keeppathCheckBox.setChecked(self.__parameters["keepPath"])
+        self.compressCheckBox.setChecked(self.__parameters["compress"])
+        if self.__parameters["optimize"] == 0:
             self.nooptimizeRadioButton.setChecked(True)
-        elif self.__parameters['optimize'] == 1:
+        elif self.__parameters["optimize"] == 1:
             self.optimizeRadioButton.setChecked(True)
         else:
             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.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.extListFilePicker.setText(self.__parameters['extListFile'])
-        
+            os.pathsep.join(self.__parameters["replacePaths"])
+        )
+        self.includeModulesEdit.setText(",".join(self.__parameters["includeModules"]))
+        self.excludeModulesEdit.setText(",".join(self.__parameters["excludeModules"]))
+        self.extListFilePicker.setText(self.__parameters["extListFile"])
+
         # initialize additional files tab
-        self.fileOrFolderList.addItems(self.__parameters['additionalFiles'])
-    
+        self.fileOrFolderList.addItems(self.__parameters["additionalFiles"])
+
     def __initializeDefaults(self):
         """
         Private method to set the default values.
-        
+
         These are needed later on to generate the command line parameters.
         """
         self.defaults = {
             # general options
-            'targetDirectory': '',
-            'targetName': '',
-            'baseName': 'Console',
-            'initScript': 'Console',
-            'applicationIcon': '',
-            'script': '',
-            'keepPath': False,
-            'compress': False,
-            'optimize': 0,     # 0, 1 or 2
-            
+            "targetDirectory": "",
+            "targetName": "",
+            "baseName": "Console",
+            "initScript": "Console",
+            "applicationIcon": "",
+            "script": "",
+            "keepPath": False,
+            "compress": False,
+            "optimize": 0,  # 0, 1 or 2
             # advanced options
-            'defaultPath': [],
-            'includePath': [],
-            'replacePaths': [],
-            'includeModules': [],
-            'excludeModules': [],
-            'extListFile': '',
-            
+            "defaultPath": [],
+            "includePath": [],
+            "replacePaths": [],
+            "includeModules": [],
+            "excludeModules": [],
+            "extListFile": "",
             # additional files tab
-            'additionalFiles': [],
+            "additionalFiles": [],
         }
         # overwrite 'baseName' if OS is Windows
-        if sys.platform == 'win32':
-            self.defaults['baseName'] = 'Win32GUI'
+        if sys.platform == "win32":
+            self.defaults["baseName"] = "Win32GUI"
         # overwrite 'initScript' if version 3 interpreter
-        if self.__project.getProjectLanguage() == 'Python3':
-            self.defaults['initScript'] = 'Console3'
-    
+        if self.__project.getProjectLanguage() == "Python3":
+            self.defaults["initScript"] = "Console3"
+
     def generateParameters(self):
         """
         Public method that generates the command line parameters.
-        
+
         It generates a list of strings to be used to set the QProcess arguments
         for the cxfreeze call and a list containing the non default parameters.
         The second list can be passed back upon object generation to overwrite
         the default settings.
-        
+
         @return a tuple of the command line parameters and non default
             parameters
         @rtype tuple of (list of str, dict)
         """
         parms = {}
         args = []
-        
+
         # 1. the program name
         args.append(self.cxfreezeExecCombo.currentText())
-        
+
         # 2. the commandline options
         # 2.1 general options
-        if (
-            self.__parameters['targetDirectory'] !=
-            self.defaults['targetDirectory']
-        ):
-            parms['targetDirectory'] = 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']))
-        parms['baseName'] = self.__parameters['baseName'][:]
-        if self.__parameters['baseName'] != '':
+        if self.__parameters["targetDirectory"] != self.defaults["targetDirectory"]:
+            parms["targetDirectory"] = 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"]))
+        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"]))
+        parms["applicationIcon"] = 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"]
+            args.append("--no-copy-deps")
+        if self.__parameters["compress"] != self.defaults["compress"]:
+            parms["compress"] = self.__parameters["compress"]
+            args.append("--compress")
+        if self.__parameters["optimize"] != self.defaults["optimize"]:
+            parms["optimize"] = self.__parameters["optimize"]
+            if self.__parameters["optimize"] == 1:
+                args.append("-O")
+            elif self.__parameters["optimize"] == 2:
+                args.append("-OO")
+
+        # 2.2 advanced options
+        if self.__parameters["defaultPath"] != self.defaults["defaultPath"]:
+            parms["defaultPath"] = self.__parameters["defaultPath"][:]
             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']))
-        parms['applicationIcon'] = 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']
-            args.append('--no-copy-deps')
-        if self.__parameters['compress'] != self.defaults['compress']:
-            parms['compress'] = self.__parameters['compress']
-            args.append('--compress')
-        if self.__parameters['optimize'] != self.defaults['optimize']:
-            parms['optimize'] = self.__parameters['optimize']
-            if self.__parameters['optimize'] == 1:
-                args.append('-O')
-            elif self.__parameters['optimize'] == 2:
-                args.append('-OO')
-        
-        # 2.2 advanced options
-        if self.__parameters['defaultPath'] != self.defaults['defaultPath']:
-            parms['defaultPath'] = self.__parameters['defaultPath'][:]
-            args.append('--default-path={0}'.format(
-                        os.pathsep.join(self.__parameters['defaultPath'])))
-        if self.__parameters['includePath'] != self.defaults['includePath']:
-            parms['includePath'] = self.__parameters['includePath'][:]
-            args.append('--include-path={0}'.format(
-                        os.pathsep.join(self.__parameters['includePath'])))
-        if self.__parameters['replacePaths'] != self.defaults['replacePaths']:
-            parms['replacePaths'] = self.__parameters['replacePaths'][:]
-            args.append('--replace-paths={0}'.format(
-                        os.pathsep.join(self.__parameters['replacePaths'])))
-        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']
-        ):
-            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']))
-        
+                "--default-path={0}".format(
+                    os.pathsep.join(self.__parameters["defaultPath"])
+                )
+            )
+        if self.__parameters["includePath"] != self.defaults["includePath"]:
+            parms["includePath"] = self.__parameters["includePath"][:]
+            args.append(
+                "--include-path={0}".format(
+                    os.pathsep.join(self.__parameters["includePath"])
+                )
+            )
+        if self.__parameters["replacePaths"] != self.defaults["replacePaths"]:
+            parms["replacePaths"] = self.__parameters["replacePaths"][:]
+            args.append(
+                "--replace-paths={0}".format(
+                    os.pathsep.join(self.__parameters["replacePaths"])
+                )
+            )
+        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"]:
+            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"]))
+
         # 2.3 additional files tab
-        if self.__parameters['additionalFiles'] != []:
-            parms['additionalFiles'] = self.__parameters['additionalFiles'][:]
-        
+        if self.__parameters["additionalFiles"] != []:
+            parms["additionalFiles"] = self.__parameters["additionalFiles"][:]
+
         return (args, parms)
 
     @pyqtSlot(str)
     def on_cxfreezeExecCombo_currentIndexChanged(self, text):
         """
         Private slot to handle the selection of a cxfreeze executable.
-        
+
         @param text selected cxfreeze executable
         @type str
         """
@@ -276,44 +254,44 @@
             # remove "\Scripts\cx_Freeze.bat" from path
             dirname = os.path.dirname(text)
             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
                 for dirpath, dirnames, _ in os.walk(dirname):
-                    if 'cx_Freeze' in dirnames:
+                    if "cx_Freeze" in dirnames:
                         modpath = os.path.join(dirpath, "cx_Freeze")
                         break
         else:
-            with open(text, 'r') as f:
+            with open(text, "r") as f:
                 args = f.readline()
             if not args:
                 return
-                
-            args = args.strip('!#\n').split(' ')
+
+            args = args.strip("!#\n").split(" ")
             program = args.pop(0)
 
-            script = os.path.join(os.path.dirname(os.path.abspath(__file__)),
-                                  'CxfreezeFindPath.py')
+            script = os.path.join(
+                os.path.dirname(os.path.abspath(__file__)), "CxfreezeFindPath.py"
+            )
             if not os.path.exists(script):
                 return
-            
+
             args.append(script)
             process = QProcess()
             process.start(program, args)
             process.waitForFinished(5000)
             # get a QByteArray of the output
             cxPath = process.readAllStandardOutput()
-            modpath = str(cxPath, encoding='utf-8').strip('\n\r')
-            if not modpath.endswith('cx_Freeze'):
+            modpath = str(cxPath, encoding="utf-8").strip("\n\r")
+            if not modpath.endswith("cx_Freeze"):
                 return
-        
+
         # populate combo boxes
         if modpath:
-            d = QDir(os.path.join(modpath, 'bases'))
+            d = QDir(os.path.join(modpath, "bases"))
             basesList = d.entryList(QDir.Filter.Files)
             if Utilities.isWindowsPlatform():
                 # strip the final '.exe' from the bases
@@ -325,41 +303,40 @@
                         basesList.append(base)
                     else:
                         basesList.append(b)
-            
-            basesList.insert(0, '')
+
+            basesList.insert(0, "")
             currentText = self.basenameCombo.currentText()
             self.basenameCombo.clear()
             self.basenameCombo.addItems(basesList)
             self.basenameCombo.setEditText(currentText)
-            
-            d = QDir(os.path.join(modpath, 'initscripts'))
-            initList = d.entryList(['*.py'])
-            initList.insert(0, '')
+
+            d = QDir(os.path.join(modpath, "initscripts"))
+            initList = d.entryList(["*.py"])
+            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)
-    
+
     @pyqtSlot(int)
     def on_fileOrFolderList_currentRowChanged(self, row):
         """
         Private slot to handle the currentRowChanged signal of the
         fileOrFolderList.
-        
+
         @param row the current row
         @type int
         """
         self.deleteSelectedButton.setEnabled(row != -1)
         if row != -1:
             self.fileOrFolderList.setCurrentRow(row)
-    
+
     @pyqtSlot(QListWidgetItem)
     def on_fileOrFolderList_itemDoubleClicked(self, itm):
         """
         Private slot to handle the itemDoubleClicked signal of the
         fileOrFolderList.
-        
+
         @param itm the selected row
         @type QListWidgetItem
         """
@@ -367,7 +344,7 @@
         row = self.fileOrFolderList.currentRow()
         itm = self.fileOrFolderList.takeItem(row)
         del itm
-    
+
     @pyqtSlot()
     def on_addFileOrFolderButton_clicked(self):
         """
@@ -379,17 +356,17 @@
             self.fileOrFolderEdit.clear()
         row = self.fileOrFolderList.currentRow()
         self.on_fileOrFolderList_currentRowChanged(row)
-    
+
     @pyqtSlot(str)
     def on_fileOrFolderEdit_textChanged(self, txt):
         """
         Private slot to handle the textChanged signal of the directory edit.
-        
+
         @param txt the text of the directory edit
         @type str
         """
         self.addFileOrFolderButton.setEnabled(txt != "")
-    
+
     @pyqtSlot()
     def on_deleteSelectedButton_clicked(self):
         """
@@ -400,69 +377,78 @@
         del itm
         row = self.fileOrFolderList.currentRow()
         self.on_fileOrFolderList_currentRowChanged(row)
-    
+
     @pyqtSlot()
     def on_selectFileOrFolderButton_clicked(self):
         """
         Private slot to select files or folders.
-        
+
         It displays a file and directory selection dialog to
         select the files and directories which should be copied
         into the distribution folder.
         """
         items = EricDirFileDialog.getOpenFileAndDirNames(
-            self,
-            self.tr("Select files and folders"),
-            self.__project.getProjectPath())
-        
+            self, self.tr("Select files and folders"), self.__project.getProjectPath()
+        )
+
         for itm in items:
             itm = self.__project.getRelativePath(itm)
             self.fileOrFolderList.addItem(Utilities.toNativeSeparators(itm))
         row = self.fileOrFolderList.currentRow()
         self.on_fileOrFolderList_currentRowChanged(row)
-    
+
     def accept(self):
         """
         Public method called by the Ok button.
-        
+
         It saves the values in the parameters dictionary.
         """
         # get data of general tab
-        self.__parameters['targetDirectory'] = self.__project.getRelativePath(
-            self.targetDirPicker.text())
-        self.__parameters['targetName'] = self.targetNameEdit.text()
-        self.__parameters['baseName'] = self.basenameCombo.currentText()
-        self.__parameters['initScript'] = self.initscriptCombo.currentText()
-        self.__parameters['applicationIcon'] = self.__project.getRelativePath(
-            self.applicationIconPicker.text())
-        self.__parameters['script'] = self.cxfreezeExecCombo.currentText()
-        self.__parameters['keepPath'] = self.keeppathCheckBox.isChecked()
-        self.__parameters['compress'] = self.compressCheckBox.isChecked()
+        self.__parameters["targetDirectory"] = self.__project.getRelativePath(
+            self.targetDirPicker.text()
+        )
+        self.__parameters["targetName"] = self.targetNameEdit.text()
+        self.__parameters["baseName"] = self.basenameCombo.currentText()
+        self.__parameters["initScript"] = self.initscriptCombo.currentText()
+        self.__parameters["applicationIcon"] = self.__project.getRelativePath(
+            self.applicationIconPicker.text()
+        )
+        self.__parameters["script"] = self.cxfreezeExecCombo.currentText()
+        self.__parameters["keepPath"] = self.keeppathCheckBox.isChecked()
+        self.__parameters["compress"] = self.compressCheckBox.isChecked()
         if self.nooptimizeRadioButton.isChecked():
-            self.__parameters['optimize'] = 0
+            self.__parameters["optimize"] = 0
         elif self.optimizeRadioButton.isChecked():
-            self.__parameters['optimize'] = 1
+            self.__parameters["optimize"] = 1
         else:
-            self.__parameters['optimize'] = 2
-        
+            self.__parameters["optimize"] = 2
+
         # get data of advanced tab
-        self.__parameters['defaultPath'] = self.__splitIt(
-            self.defaultPathEdit.text(), os.pathsep)
-        self.__parameters['includePath'] = self.__splitIt(
-            self.includePathEdit.text(), os.pathsep)
-        self.__parameters['replacePaths'] = self.__splitIt(
-            self.replacePathsEdit.text(), os.pathsep)
-        self.__parameters['includeModules'] = self.__splitIt(
-            self.includeModulesEdit.text(), ',')
-        self.__parameters['excludeModules'] = self.__splitIt(
-            self.excludeModulesEdit.text(), ',')
-        self.__parameters['extListFile'] = self.__project.getRelativePath(
-            self.extListFilePicker.text())
-        
+        self.__parameters["defaultPath"] = self.__splitIt(
+            self.defaultPathEdit.text(), os.pathsep
+        )
+        self.__parameters["includePath"] = self.__splitIt(
+            self.includePathEdit.text(), os.pathsep
+        )
+        self.__parameters["replacePaths"] = self.__splitIt(
+            self.replacePathsEdit.text(), os.pathsep
+        )
+        self.__parameters["includeModules"] = self.__splitIt(
+            self.includeModulesEdit.text(), ","
+        )
+        self.__parameters["excludeModules"] = self.__splitIt(
+            self.excludeModulesEdit.text(), ","
+        )
+        self.__parameters["extListFile"] = self.__project.getRelativePath(
+            self.extListFilePicker.text()
+        )
+
         # get data of the additional files tab
-        additionalFiles = [self.fileOrFolderList.item(x).text()
-                           for x in range(self.fileOrFolderList.count())]
-        self.__parameters['additionalFiles'] = additionalFiles
+        additionalFiles = [
+            self.fileOrFolderList.item(x).text()
+            for x in range(self.fileOrFolderList.count())
+        ]
+        self.__parameters["additionalFiles"] = additionalFiles
 
         # call the accept slot of the base class
         QDialog.accept(self)
@@ -470,7 +456,7 @@
     def __splitIt(self, s, sep):
         """
         Private method to split a string observing various conditions.
-        
+
         @param s string to split
         @type str
         @param sep separator string
@@ -480,8 +466,8 @@
         """
         if s == "" or s is None:
             return []
-        
+
         if s.endswith(sep):
             s = s[:-1]
-        
+
         return s.split(sep)
diff -r 54f57d052146 -r 4df5e67b084b CxFreeze/CxfreezeExecDialog.py
--- a/CxFreeze/CxfreezeExecDialog.py	Thu Dec 30 11:53:44 2021 +0100
+++ b/CxFreeze/CxfreezeExecDialog.py	Wed Sep 21 16:47:33 2022 +0200
@@ -25,33 +25,32 @@
 class CxfreezeExecDialog(QDialog, Ui_CxfreezeExecDialog):
     """
     Class implementing a dialog to show the output of the cxfreeze process.
-    
+
     This class starts a QProcess and displays a dialog that
     shows the output of the packager command process.
     """
+
     def __init__(self, cmdname, parent=None):
         """
         Constructor
-        
+
         @param cmdname name of the packager (string)
         @param parent parent widget of this dialog (QWidget)
         """
         super().__init__(parent)
         self.setupUi(self)
-        
-        self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Close).setEnabled(False)
-        self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Cancel).setDefault(True)
-        
+
+        self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False)
+        self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True)
+
         self.process = None
         self.copyProcess = None
         self.cmdname = cmdname
-    
+
     def start(self, args, parms, ppath, mainscript):
         """
         Public slot to start the packager command.
-        
+
         @param args commandline arguments for packager program
         @type list of str
         @param parms parameters got from the config dialog
@@ -67,64 +66,59 @@
         script = os.path.join(ppath, mainscript)
         dname = os.path.dirname(script)
         script = os.path.basename(script)
-        
+
         self.ppath = ppath
-        self.additionalFiles = parms.get('additionalFiles', [])
-        self.targetDirectory = os.path.join(
-            parms.get('targetDirectory', 'dist'))
-        
+        self.additionalFiles = parms.get("additionalFiles", [])
+        self.targetDirectory = os.path.join(parms.get("targetDirectory", "dist"))
+
         self.contents.clear()
         self.errors.clear()
-        
+
         args.append(script)
-        
+
         self.process = QProcess()
         self.process.setWorkingDirectory(dname)
-        
+
         self.process.readyReadStandardOutput.connect(self.__readStdout)
         self.process.readyReadStandardError.connect(self.__readStderr)
         self.process.finished.connect(self.__finishedFreeze)
-            
-        self.setWindowTitle(self.tr('{0} - {1}').format(
-            self.cmdname, script))
-        self.contents.insertPlainText(' '.join(args) + '\n\n')
+
+        self.setWindowTitle(self.tr("{0} - {1}").format(self.cmdname, script))
+        self.contents.insertPlainText(" ".join(args) + "\n\n")
         self.contents.ensureCursorVisible()
-        
+
         program = args.pop(0)
         self.process.start(program, args)
         procStarted = self.process.waitForStarted()
         if not procStarted:
             EricMessageBox.critical(
                 self,
-                self.tr('Process Generation Error'),
+                self.tr("Process Generation Error"),
                 self.tr(
-                    'The process {0} could not be started. '
-                    'Ensure, that it is in the search path.'
-                ).format(program))
+                    "The process {0} could not be started. "
+                    "Ensure, that it is in the search path."
+                ).format(program),
+            )
         return procStarted
-    
+
     @pyqtSlot(QAbstractButton)
     def on_buttonBox_clicked(self, button):
         """
         Private slot called by a button of the button box clicked.
-        
+
         @param button button that was clicked
         @type QAbstractButton
         """
-        if button == self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Close
-        ):
+        if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
             self.accept()
-        elif button == self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Cancel
-        ):
-            self.additionalFiles = []   # Skip copying additional files
+        elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
+            self.additionalFiles = []  # Skip copying additional files
             self.__finish()
-    
+
     def __finish(self):
         """
         Private slot called when the process finished.
-        
+
         It is called when the process finished or the user pressed the
         cancel button.
         """
@@ -134,79 +128,78 @@
             QTimer.singleShot(2000, self.process.kill)
             self.process.waitForFinished(3000)
         self.process = None
-        
+
         if self.copyProcess is not None:
             self.copyProcess.terminate()
         self.copyProcess = None
-        
-        self.contents.insertPlainText(
-            self.tr('\n{0} aborted.\n').format(self.cmdname))
-        
+
+        self.contents.insertPlainText(self.tr("\n{0} aborted.\n").format(self.cmdname))
+
         self.__enableButtons()
-    
+
     def __finishedFreeze(self):
         """
         Private slot called when the process finished.
-        
+
         It is called when the process finished or the user pressed the
         cancel button.
         """
         self.process = None
 
-        self.contents.insertPlainText(
-            self.tr('\n{0} finished.\n').format(self.cmdname))
-        
+        self.contents.insertPlainText(self.tr("\n{0} finished.\n").format(self.cmdname))
+
         self.copyProcess = CopyAdditionalFiles(self)
         self.copyProcess.insertPlainText.connect(self.contents.insertPlainText)
         self.copyProcess.finished.connect(self.__enableButtons)
         self.copyProcess.start()
-    
+
     def __enableButtons(self):
         """
         Private slot called when all processes finished.
-        
+
         It is called when the process finished or
         the user pressed the cancel button.
         """
         self.copyProcess = None
-        self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Close).setEnabled(True)
-        self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
-        self.buttonBox.button(
-            QDialogButtonBox.StandardButton.Close).setDefault(True)
+        self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(True)
+        self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
+        self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setDefault(True)
         self.contents.ensureCursorVisible()
 
     def __readStdout(self):
         """
         Private slot to handle the readyReadStandardOutput signal.
-        
+
         It reads the output of the process, formats it and inserts it into
         the contents pane.
         """
         self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput)
-        
+
         while self.process.canReadLine():
-            s = str(self.process.readAllStandardOutput(),
-                    Preferences.getSystem("IOEncoding"),
-                    'replace')
+            s = str(
+                self.process.readAllStandardOutput(),
+                Preferences.getSystem("IOEncoding"),
+                "replace",
+            )
             self.contents.insertPlainText(s)
             self.contents.ensureCursorVisible()
-    
+
     def __readStderr(self):
         """
         Private slot to handle the readyReadStandardError signal.
-        
+
         It reads the error output of the process and inserts it into the
         error pane.
         """
         self.process.setReadChannel(QProcess.ProcessChannel.StandardError)
-        
+
         while self.process.canReadLine():
             self.errorGroup.show()
-            s = str(self.process.readAllStandardError(),
-                    Preferences.getSystem("IOEncoding"),
-                    'replace')
+            s = str(
+                self.process.readAllStandardError(),
+                Preferences.getSystem("IOEncoding"),
+                "replace",
+            )
             self.errors.insertPlainText(s)
             self.errors.ensureCursorVisible()
 
@@ -214,30 +207,31 @@
 class CopyAdditionalFiles(QThread):
     """
     Thread to copy the distribution dependent files.
-    
+
     @signal insertPlainText(text) emitted to inform user about the copy
         progress
     """
+
     insertPlainText = pyqtSignal(str)
-    
+
     def __init__(self, main):
         """
         Constructor
-        
+
         @param main self-object of the caller
         """
         super().__init__()
-        
+
         self.ppath = main.ppath
         self.additionalFiles = main.additionalFiles
         self.targetDirectory = main.targetDirectory
-    
+
     def __copytree(self, src, dst):
         """
         Private method to copy a file or folder.
-       
+
         Wildcards allowed. Existing files are overwitten.
-        
+
         @param src source file or folder to copy. Wildcards allowed.
         @type str
         @param dst destination
@@ -250,7 +244,7 @@
             """
             Combines the relativ path of the source (srcname) with the
             destination folder.
-            
+
             @param srcname actual file or folder to copy
             @type str
             @param base basename of the source folder
@@ -262,7 +256,7 @@
             """
             delta = srcname.split(base)[1]
             return os.path.join(dst, delta[1:])
-        
+
         base, fileOrFolderName = os.path.split(src)
         initDone = False
         for root, dirs, files in os.walk(base):
@@ -285,7 +279,7 @@
                             raise err
                 else:
                     dirs.remove(directory)
-            
+
             for file in files:
                 fn = os.path.join(root, file)
                 if initDone or fnmatch.fnmatch(fn, src):
@@ -293,32 +287,31 @@
                     # copy files, give errors to caller
                     shutil.copy2(fn, newFile)
                     copied = True
-            
+
             # check if file was found and copied
             if len(files) and not copied:
                 raise OSError(
                     errno.ENOENT,
-                    self.tr("No such file or directory: '{0}'")
-                    .format(src))
-            
+                    self.tr("No such file or directory: '{0}'").format(src),
+                )
+
             initDone = True
-            
+
     def run(self):
         """
         Public method to run the thread.
-        
+
         QThread entry point to copy the selected additional files and folders.
-        
+
         @exception OSError raised if there is an issue writing the package
-        """     # __IGNORE_WARNING_D252__ __IGNORE_WARNING_D253__
-        self.insertPlainText.emit('----\n')
+        """  # __IGNORE_WARNING_D252__ __IGNORE_WARNING_D253__
+        self.insertPlainText.emit("----\n")
         os.chdir(self.ppath)
         for fn in self.additionalFiles:
-            self.insertPlainText.emit(
-                self.tr('\nCopying {0}: ').format(fn))
-            
+            self.insertPlainText.emit(self.tr("\nCopying {0}: ").format(fn))
+
             # on linux normpath doesn't replace backslashes to slashes.
-            fn = fn.replace('\\', '/')
+            fn = fn.replace("\\", "/")
             fn = os.path.abspath(os.path.normpath(fn))
             dst = os.path.join(self.ppath, self.targetDirectory)
             if fn.startswith(os.path.normpath(self.ppath)):
@@ -330,10 +323,9 @@
                     if err.errno != errno.EEXIST:
                         # it's ok if directory already exists
                         raise err
-            
+
             try:
                 self.__copytree(fn, dst)
-                self.insertPlainText.emit(self.tr('ok'))
+                self.insertPlainText.emit(self.tr("ok"))
             except OSError as err:
-                self.insertPlainText.emit(
-                    self.tr('failed: {0}').format(err.strerror))
+                self.insertPlainText.emit(self.tr("failed: {0}").format(err.strerror))
diff -r 54f57d052146 -r 4df5e67b084b CxFreeze/CxfreezeFindPath.py
--- a/CxFreeze/CxfreezeFindPath.py	Thu Dec 30 11:53:44 2021 +0100
+++ b/CxFreeze/CxfreezeFindPath.py	Wed Sep 21 16:47:33 2022 +0200
@@ -13,5 +13,5 @@
 for sysPath in sys.path:
     modpath = os.path.join(sysPath, "cx_Freeze")
     if os.path.exists(modpath):
-        print(modpath)      # __IGNORE_WARNING_M801__
+        print(modpath)  # __IGNORE_WARNING_M801__
         break
diff -r 54f57d052146 -r 4df5e67b084b PluginCxFreeze.epj
--- a/PluginCxFreeze.epj	Thu Dec 30 11:53:44 2021 +0100
+++ b/PluginCxFreeze.epj	Wed Sep 21 16:47:33 2022 +0200
@@ -1,19 +1,21 @@
 {
   "header": {
     "comment": "eric project file for project PluginCxFreeze",
-    "copyright": "Copyright (C) 2021 Detlev Offenbach, detlev@die-offenbachs.de"
+    "copyright": "Copyright (C) 2022 Detlev Offenbach, detlev@die-offenbachs.de"
   },
   "project": {
     "AUTHOR": "Detlev Offenbach",
     "CHECKERSPARMS": {
       "Pep8Checker": {
         "AnnotationsChecker": {
+          "AllowStarArgAny": false,
           "AllowUntypedDefs": false,
           "AllowUntypedNested": false,
           "DispatchDecorators": [
             "singledispatch",
             "singledispatchmethod"
           ],
+          "ForceFutureAnnotations": false,
           "MaximumComplexity": 3,
           "MaximumLength": 7,
           "MinimumCoverage": 75,
@@ -59,20 +61,25 @@
         },
         "CopyrightAuthor": "",
         "CopyrightMinFileSize": 0,
-        "DocstringType": "eric",
+        "DocstringType": "eric_black",
         "EnabledCheckerCategories": "C, D, E, M, N, S, Y, W",
         "ExcludeFiles": "*/Ui_*.py, */*_rc.py",
-        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W504,Y119,Y401,Y402",
+        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W503,Y119,Y401,Y402",
         "FixCodes": "",
         "FixIssues": false,
         "FutureChecker": "",
         "HangClosing": false,
+        "ImportsChecker": {
+          "ApplicationPackageNames": [],
+          "BanRelativeImports": "",
+          "BannedModules": []
+        },
         "IncludeMessages": "",
         "LineComplexity": 25,
         "LineComplexityScore": 10,
         "MaxCodeComplexity": 10,
-        "MaxDocLineLength": 79,
-        "MaxLineLength": 79,
+        "MaxDocLineLength": 88,
+        "MaxLineLength": 88,
         "NoFixCodes": "E501",
         "RepeatMessages": true,
         "SecurityChecker": {
@@ -129,6 +136,7 @@
       }
     },
     "EMAIL": "detlev@die-offenbachs.de",
+    "EMBEDDED_VENV": false,
     "EOL": 1,
     "FILETYPES": {
       "*.epj": "OTHERS",
@@ -163,6 +171,7 @@
     },
     "INTERFACES": [],
     "LEXERASSOCS": {},
+    "LICENSE": "GNU General Public License v3 or later (GPLv3+)",
     "MAINSCRIPT": "PluginCxFreeze.py",
     "MAKEPARAMS": {
       "MakeEnabled": false,
@@ -179,10 +188,27 @@
       "CxFreeze/Documentation/LICENSE.GPL3",
       "CxFreeze/Documentation/source",
       "PKGLIST",
-      "PluginCxFreeze.zip",
-      "PluginCxFreeze.epj"
+      "PluginCxFreeze.epj",
+      "PluginCxFreeze.zip"
     ],
-    "OTHERTOOLSPARMS": {},
+    "OTHERTOOLSPARMS": {
+      "Black": {
+        "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|_build|buck-out|build|dist|__pypackages__)/",
+        "extend-exclude": "",
+        "force-exclude": "",
+        "line-length": 88,
+        "skip-magic-trailing-comma": false,
+        "skip-string-normalization": false,
+        "source": "project",
+        "target-version": [
+          "py311",
+          "py310",
+          "py39",
+          "py38",
+          "py37"
+        ]
+      }
+    },
     "PACKAGERSPARMS": {},
     "PROGLANGUAGE": "Python3",
     "PROJECTTYPE": "E7Plugin",
@@ -206,6 +232,7 @@
     "SPELLEXCLUDES": "",
     "SPELLLANGUAGE": "en",
     "SPELLWORDS": "",
+    "TESTING_FRAMEWORK": "",
     "TRANSLATIONEXCEPTIONS": [],
     "TRANSLATIONPATTERN": "CxFreeze/i18n/cxfreeze_%language%.ts",
     "TRANSLATIONS": [
diff -r 54f57d052146 -r 4df5e67b084b PluginCxFreeze.py
--- a/PluginCxFreeze.py	Thu Dec 30 11:53:44 2021 +0100
+++ b/PluginCxFreeze.py	Wed Sep 21 16:47:33 2022 +0200
@@ -16,7 +16,7 @@
 from EricWidgets import EricMessageBox
 from EricGui.EricAction import EricAction
 from EricWidgets.EricApplication import ericApp
-    
+
 import Utilities
 
 # Start-of-Header
@@ -44,7 +44,7 @@
 def exeDisplayDataList():
     """
     Public method to support the display of some executable info.
-    
+
     @return dictionary containing the data to query the presence of
         the executable
     @rtype dict
@@ -52,16 +52,15 @@
     dataList = []
     data = {
         "programEntry": True,
-        "header": QCoreApplication.translate(
-            "CxFreezePlugin", "Packagers - cx_freeze"),
-        "exe": 'dummyfreeze',
-        "versionCommand": '--version',
-        "versionStartsWith": 'dummyfreeze',
+        "header": QCoreApplication.translate("CxFreezePlugin", "Packagers - cx_freeze"),
+        "exe": "dummyfreeze",
+        "versionCommand": "--version",
+        "versionStartsWith": "dummyfreeze",
         "versionPosition": -1,
         "version": "",
         "versionCleanup": None,
     }
-    
+
     if _checkProgram():
         for exePath in exePy3:
             data["exe"] = exePath
@@ -75,7 +74,7 @@
 def _findExecutable(majorVersion):
     """
     Restricted function to determine the names of the executable.
-    
+
     @param majorVersion major Python version of the executables
     @type int
     @return names of the executable
@@ -86,7 +85,7 @@
         minorVersions = range(10)
     else:
         return []
-    
+
     executables = set()
     if Utilities.isWindowsPlatform():
         #
@@ -95,57 +94,66 @@
         try:
             import winreg
         except ImportError:
-            import _winreg as winreg    # __IGNORE_WARNING__
-        
+            import _winreg as winreg  # __IGNORE_WARNING__
+
         def getExePath(branch, access, versionStr):
             try:
-                software = winreg.OpenKey(branch, 'Software', 0, access)
-                python = winreg.OpenKey(software, 'Python', 0, access)
-                pcore = winreg.OpenKey(python, 'PythonCore', 0, access)
+                software = winreg.OpenKey(branch, "Software", 0, access)
+                python = winreg.OpenKey(software, "Python", 0, access)
+                pcore = winreg.OpenKey(python, "PythonCore", 0, access)
                 version = winreg.OpenKey(pcore, versionStr, 0, access)
-                installpath = winreg.QueryValue(version, 'InstallPath')
-                exe = os.path.join(installpath, 'Scripts', 'cxfreeze.bat')
+                installpath = winreg.QueryValue(version, "InstallPath")
+                exe = os.path.join(installpath, "Scripts", "cxfreeze.bat")
                 if os.access(exe, os.X_OK):
                     return exe
-            except WindowsError:        # __IGNORE_WARNING__
+            except WindowsError:  # __IGNORE_WARNING__
                 return None
             return None
-        
+
         versionSuffixes = ["", "-32", "-64"]
         for minorVersion in minorVersions:
             for versionSuffix in versionSuffixes:
-                versionStr = '{0}.{1}{2}'.format(majorVersion, minorVersion,
-                                                 versionSuffix)
+                versionStr = "{0}.{1}{2}".format(
+                    majorVersion, minorVersion, versionSuffix
+                )
                 exePath = getExePath(
                     winreg.HKEY_CURRENT_USER,
-                    winreg.KEY_WOW64_32KEY | winreg.KEY_READ, versionStr)
+                    winreg.KEY_WOW64_32KEY | winreg.KEY_READ,
+                    versionStr,
+                )
                 if exePath is not None:
                     executables.add(exePath)
-                
+
                 exePath = getExePath(
                     winreg.HKEY_LOCAL_MACHINE,
-                    winreg.KEY_WOW64_32KEY | winreg.KEY_READ, versionStr)
+                    winreg.KEY_WOW64_32KEY | winreg.KEY_READ,
+                    versionStr,
+                )
                 if exePath is not None:
                     executables.add(exePath)
-                
+
                 # Even on Intel 64-bit machines it's 'AMD64'
-                if platform.machine() == 'AMD64':
+                if platform.machine() == "AMD64":
                     exePath = getExePath(
                         winreg.HKEY_CURRENT_USER,
-                        winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr)
+                        winreg.KEY_WOW64_64KEY | winreg.KEY_READ,
+                        versionStr,
+                    )
                     if exePath is not None:
                         executables.add(exePath)
-                    
+
                     exePath = getExePath(
                         winreg.HKEY_LOCAL_MACHINE,
-                        winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr)
+                        winreg.KEY_WOW64_64KEY | winreg.KEY_READ,
+                        versionStr,
+                    )
                     if exePath is not None:
                         executables.add(exePath)
-        
+
         if not executables and majorVersion >= 3:
             # check the PATH environment variable if nothing was found
             # Python 3 only
-            path = Utilities.getEnvironmentEntry('PATH')
+            path = Utilities.getEnvironmentEntry("PATH")
             if path:
                 dirs = path.split(os.pathsep)
                 for directory in dirs:
@@ -156,18 +164,17 @@
     else:
         #
         # Linux, Unix ...
-        cxfreezeScript = 'cxfreeze'
+        cxfreezeScript = "cxfreeze"
         scriptSuffixes = ["", "-python{0}".format(majorVersion)]
         for minorVersion in minorVersions:
-            scriptSuffixes.append(
-                "-python{0}.{1}".format(majorVersion, minorVersion))
+            scriptSuffixes.append("-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')
+        path = Utilities.getEnvironmentEntry("PATH")
         # environment variable not defined
         if path is None:
             return []
-        
+
         # step 1: determine possible candidates
         exes = []
         dirs = path.split(os.pathsep)
@@ -176,7 +183,7 @@
                 exe = os.path.join(directory, cxfreezeScript + suffix)
                 if os.access(exe, os.X_OK):
                     exes.append(exe)
-        
+
         # step 2: determine the Python variant
         _exePy3 = set()
         versionArgs = ["-c", "import sys; print(sys.version_info[0])"]
@@ -189,12 +196,12 @@
             process.waitForFinished(5000)
             # get a QByteArray of the output
             versionBytes = process.readAllStandardOutput()
-            versionStr = str(versionBytes, encoding='utf-8').strip()
+            versionStr = str(versionBytes, encoding="utf-8").strip()
             if versionStr == "3":
                 _exePy3.add(exe)
-        
+
         executables = _exePy3
-    
+
     # sort items, the probably newest topmost
     executables = list(executables)
     executables.sort(reverse=True)
@@ -204,23 +211,24 @@
 def _checkProgram():
     """
     Restricted function to check the availability of cxfreeze.
-    
+
     @return flag indicating availability
     @rtype bool
     """
     global error, exePy3
-    
+
     exePy3 = _findExecutable(3)
     if exePy3 == []:
         if Utilities.isWindowsPlatform():
             error = QCoreApplication.translate(
                 "CxFreezePlugin",
                 "The cxfreeze.bat executable could not be found."
-                "Did you run the cxfreeze-postinstall script?")
+                "Did you run the cxfreeze-postinstall script?",
+            )
         else:
             error = QCoreApplication.translate(
-                "CxFreezePlugin",
-                "The cxfreeze executable could not be found.")
+                "CxFreezePlugin", "The cxfreeze executable could not be found."
+            )
         return False
     else:
         return True
@@ -230,10 +238,11 @@
     """
     Class implementing the CxFreeze plugin.
     """
+
     def __init__(self, ui):
         """
         Constructor
-        
+
         @param ui reference to the user interface object
         @type UserInterface
         """
@@ -241,56 +250,63 @@
         self.__ui = ui
         self.__initialize()
         _checkProgram()
-        
+
         self.__translator = None
         self.__loadTranslator()
-        
+
     def __initialize(self):
         """
         Private slot to (re)initialize the plugin.
         """
         self.__projectAct = None
         self.__projectSeparator = None
-       
+
     def activate(self):
         """
         Public method to activate this plugin.
-        
+
         @return tuple of None and activation status
         @rtype tuple of (None, bool)
         """
         global error
-        
+
         # There is already an error, don't activate
         if error:
             return None, False
-        
+
         # cxfreeze is only activated if it is available
         if not _checkProgram():
             return None, False
-        
+
         project = ericApp().getObject("Project")
         menu = project.getMenu("Packagers")
         if menu:
             self.__projectAct = EricAction(
-                self.tr('Use cx_freeze'),
-                self.tr('Use cx_&freeze'), 0, 0,
-                self, 'packagers_cxfreeze')
+                self.tr("Use cx_freeze"),
+                self.tr("Use cx_&freeze"),
+                0,
+                0,
+                self,
+                "packagers_cxfreeze",
+            )
             self.__projectAct.setStatusTip(
-                self.tr('Generate a distribution package using cx_freeze'))
-            self.__projectAct.setWhatsThis(self.tr(
-                """<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.tr("Generate a distribution package using cx_freeze")
+            )
+            self.__projectAct.setWhatsThis(
+                self.tr(
+                    """<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.addEricActions([self.__projectAct])
             self.__projectSeparator = menu.addSeparator()
             menu.addAction(self.__projectAct)
             project.showMenu.connect(self.__projectShowMenu)
-        
+
         error = ""
         return None, True
 
@@ -302,32 +318,27 @@
         if menu:
             if self.__projectAct:
                 menu.removeAction(self.__projectAct)
-                ericApp().getObject("Project").removeEricActions(
-                    [self.__projectAct])
+                ericApp().getObject("Project").removeEricActions([self.__projectAct])
             if self.__projectSeparator:
                 menu.removeAction(self.__projectSeparator)
-        
+
         self.__initialize()
-    
+
     def __projectShowMenu(self, menuName, menu):
         """
         Private slot called, when the the project menu or a submenu is
         about to be shown.
-        
+
         @param menuName name of the menu to be shown
         @type str
         @param menu reference to the menu
         @type QMenu
         """
-        if (
-            menuName == "Packagers" and
-            self.__projectAct is not None
-        ):
+        if menuName == "Packagers" and self.__projectAct is not None:
             self.__projectAct.setEnabled(
-                ericApp().getObject("Project").getProjectLanguage() ==
-                "Python3"
+                ericApp().getObject("Project").getProjectLanguage() == "Python3"
             )
-    
+
     def __loadTranslator(self):
         """
         Private method to load the translation file.
@@ -335,8 +346,7 @@
         if self.__ui is not None:
             loc = self.__ui.getLocale()
             if loc and loc != "C":
-                locale_dir = os.path.join(os.path.dirname(__file__),
-                                          "CxFreeze", "i18n")
+                locale_dir = os.path.join(os.path.dirname(__file__), "CxFreeze", "i18n")
                 translation = "cxfreeze_{0}".format(loc)
                 translator = QTranslator(None)
                 loaded = translator.load(translation, locale_dir)
@@ -344,10 +354,12 @@
                     self.__translator = translator
                     ericApp().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):
         """
         Private slot to handle the cxfreeze execution.
@@ -360,17 +372,20 @@
                 self.tr("cxfreeze"),
                 self.tr(
                     """There is no main script defined for the current"""
-                    """ project."""),
-                EricMessageBox.StandardButtons(EricMessageBox.Abort))
+                    """ project."""
+                ),
+                EricMessageBox.StandardButtons(EricMessageBox.Abort),
+            )
             return
-        
+
         majorVersionStr = project.getProjectLanguage()
         exe = {"Python3": exePy3}.get(majorVersionStr)
         if exe == []:
             EricMessageBox.critical(
                 self.__ui,
                 self.tr("cxfreeze"),
-                self.tr("""The cxfreeze executable could not be found."""))
+                self.tr("""The cxfreeze executable could not be found."""),
+            )
             return
 
         # check if all files saved and errorfree before continue
@@ -378,18 +393,19 @@
             return
 
         from CxFreeze.CxfreezeConfigDialog import CxfreezeConfigDialog
-        parms = project.getData('PACKAGERSPARMS', "CXFREEZE")
+
+        parms = project.getData("PACKAGERSPARMS", "CXFREEZE")
         dlg = CxfreezeConfigDialog(project, exe, parms)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             args, parms = dlg.generateParameters()
-            project.setData('PACKAGERSPARMS', "CXFREEZE", parms)
-            
+            project.setData("PACKAGERSPARMS", "CXFREEZE", parms)
+
             # now do the call
             from CxFreeze.CxfreezeExecDialog import CxfreezeExecDialog
+
             dia = CxfreezeExecDialog("cxfreeze")
             dia.show()
-            res = dia.start(args, parms, project.ppath,
-                            project.getMainScript())
+            res = dia.start(args, parms, project.ppath, project.getMainScript())
             if res:
                 dia.exec()
 
@@ -397,14 +413,15 @@
 def installDependencies(pipInstall):
     """
     Function to install dependencies of this plug-in.
-    
+
     @param pipInstall function to be called with a list of package names.
     @type function
     """
     try:
-        import cx_Freeze         # __IGNORE_WARNING__
+        import cx_Freeze  # __IGNORE_WARNING__
     except ImportError:
         pipInstall(["cx-Freeze"])
 
+
 #
 # eflag: noqa = M801

eric ide

mercurial