Wizards: changed the generated code slightly. eric7

Wed, 09 Jun 2021 17:48:02 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 09 Jun 2021 17:48:02 +0200
branch
eric7
changeset 8415
c6236bed1b50
parent 8414
8c3b52d1b4b6
child 8416
1b8e456475a1

Wizards: changed the generated code slightly.

eric7/Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/EricMessageBoxWizard/EricMessageBoxWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/FontDialogWizard/FontDialogWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py file | annotate | diff | comparison | revisions
eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py file | annotate | diff | comparison | revisions
--- a/eric7/Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -159,7 +159,7 @@
                 '{0}QColorDialog.ColorDialogOption.ShowAlphaChannel'
                 .format(istring)
             )
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
         elif self.rRGBA.isChecked():
             code += 'getColor({0}'.format(os.linesep)
             if not self.eRGB.text():
@@ -176,6 +176,6 @@
                 '{0}QColorDialog.ColorDialogOption.ShowAlphaChannel'
                 .format(istring)
             )
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
         
         return code
--- a/eric7/Plugins/WizardPlugins/EricMessageBoxWizard/EricMessageBoxWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/EricMessageBoxWizard/EricMessageBoxWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -585,5 +585,5 @@
                 msgdlg += ',{0}{1}parent={2}'.format(
                     os.linesep, istring, parent)
         
-        msgdlg += '){0}'.format(estring)
+        msgdlg += '{0}){0}'.format(estring)
         return msgdlg
--- a/eric7/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -455,7 +455,7 @@
             if self.rOpenFileUrl.isChecked() and bool(self.schemesEdit.text()):
                 code += ',{0}{1}{2}'.format(
                     os.linesep, istring, self.__prepareSchemesList())
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
         elif (
             self.rOpenFiles.isChecked() or
             self.rfOpenFiles.isChecked() or
@@ -523,7 +523,7 @@
             ):
                 code += ',{0}{1}{2}'.format(
                     os.linesep, istring, self.__prepareSchemesList())
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
         elif (
             self.rSaveFile.isChecked() or
             self.rfSaveFile.isChecked() or
@@ -603,7 +603,7 @@
                 code += ',{0}{1}{2}'.format(
                     os.linesep, istring, self.__prepareSchemesList())
                             
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
         elif self.rDirectory.isChecked() or self.rDirectoryUrl.isChecked():
             if self.rDirectory.isChecked():
                 code += 'getExistingDirectory({0}{1}'.format(
@@ -656,7 +656,7 @@
             if self.rDirectoryUrl.isChecked():
                 code += ',{0}{1}{2}'.format(
                     os.linesep, istring, self.__prepareSchemesList())
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
             
         return code
     
--- a/eric7/Plugins/WizardPlugins/FontDialogWizard/FontDialogWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/FontDialogWizard/FontDialogWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -204,6 +204,6 @@
                 )
                 code += ',{0}{1}{2}'.format(
                     os.linesep, istring, fontOptionsString)
-        code += '{0}){1}'.format(estring, estring)
+        code += '{0}){0}'.format(estring)
         
         return code
--- a/eric7/Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -156,7 +156,7 @@
             if self.eTextDefault.text():
                 code += ',{0}{1}self.tr("{2}")'.format(
                     os.linesep, istring, self.eTextDefault.text())
-            code += '){0}'.format(estring)
+            code += '{0}){0}'.format(estring)
         elif self.rInteger.isChecked():
             code += 'getInt({0}{1}'.format(os.linesep, istring)
             code += '{0},{1}{2}'.format(parent, os.linesep, istring)
@@ -164,9 +164,10 @@
                 self.eCaption.text(), os.linesep, istring)
             code += 'self.tr("{0}"),{1}{2}'.format(
                 self.eLabel.text(), os.linesep, istring)
-            code += '{0:d}, {1:d}, {2:d}, {3:d}){4}'.format(
+            code += '{0:d}, {1:d}, {2:d}, {3:d}'.format(
                 self.sIntDefault.value(), self.sIntFrom.value(),
-                self.sIntTo.value(), self.sIntStep.value(), estring)
+                self.sIntTo.value(), self.sIntStep.value())
+            code += '{0}){0}'.format(estring)
         elif self.rDouble.isChecked():
             try:
                 doubleDefault = float(self.eDoubleDefault.text())
@@ -186,9 +187,10 @@
                 self.eCaption.text(), os.linesep, istring)
             code += 'self.tr("{0}"),{1}{2}'.format(
                 self.eLabel.text(), os.linesep, istring)
-            code += '{0}, {1}, {2}, {3:d}){4}'.format(
+            code += '{0}, {1}, {2}, {3:d}'.format(
                 doubleDefault, doubleFrom, doubleTo,
-                self.sDoubleDecimals.value(), estring)
+                self.sDoubleDecimals.value())
+            code += '{0}){0}'.format(estring)
         elif self.rItem.isChecked():
             code += 'getItem({0}{1}'.format(os.linesep, istring)
             code += '{0},{1}{2}'.format(parent, os.linesep, istring)
@@ -198,7 +200,8 @@
                 self.eLabel.text(), os.linesep, istring)
             code += '{0},{1}{2}'.format(
                 self.eVariable.text(), os.linesep, istring)
-            code += '{0:d}, {1}){2}'.format(
-                self.sCurrentItem.value(), self.cEditable.isChecked(), estring)
+            code += '{0:d}, {1}'.format(
+                self.sCurrentItem.value(), self.cEditable.isChecked())
+            code += '{0}){0}'.format(estring)
             
         return code
--- a/eric7/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -352,5 +352,5 @@
                 os.linesep, istring, self.eMessage.toPlainText())
             if not self.rAbout.isChecked() and not self.rAboutQt.isChecked():
                 msgdlg += self.__getButtonCode(istring, indString)
-        msgdlg += '){0}'.format(estring)
+        msgdlg += '{0}){0}'.format(estring)
         return msgdlg
--- a/eric7/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -639,7 +639,7 @@
             os.linesep, i1string, regexp.replace('"', '\\"'))
         if flags:
             code += ',{0}{1}{2}'.format(os.linesep, i1string, flags)
-        code += '){0}'.format(estring)
+        code += '{0}){0}'.format(estring)
         return code
 
 
--- a/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py	Wed Jun 09 17:48:02 2021 +0200
@@ -79,20 +79,20 @@
         
         self.namedGroups = re.compile(r"""\(?P<([^>]+)>""").findall
         
-        # start the PyQt5 server part
-        self.__pyqt5Available = False
-        self.__pyqt5Server = QProcess(self)
-        self.__pyqt5Server.start(
+        # start the PyQt6 server part
+        self.__pyqt6Available = False
+        self.__pyqt6Server = QProcess(self)
+        self.__pyqt6Server.start(
             sys.executable, [os.path.join(
                 os.path.dirname(__file__), "QRegularExpressionWizardServer.py")
             ])
-        if self.__pyqt5Server.waitForStarted(5000):
-            self.__pyqt5Server.setReadChannel(
+        if self.__pyqt6Server.waitForStarted(5000):
+            self.__pyqt6Server.setReadChannel(
                 QProcess.ProcessChannel.StandardOutput)
             if self.__sendCommand("available"):
                 response = self.__receiveResponse()
                 if response and response["available"]:
-                    self.__pyqt5Available = True
+                    self.__pyqt6Available = True
         
         self.saveButton = self.buttonBox.addButton(
             self.tr("Save"), QDialogButtonBox.ButtonRole.ActionRole)
@@ -102,7 +102,7 @@
             self.tr("Load"), QDialogButtonBox.ButtonRole.ActionRole)
         self.loadButton.setToolTip(
             self.tr("Load a regular expression from a file"))
-        if self.__pyqt5Available:
+        if self.__pyqt6Available:
             self.validateButton = self.buttonBox.addButton(
                 self.tr("Validate"), QDialogButtonBox.ButtonRole.ActionRole)
             self.validateButton.setToolTip(
@@ -153,8 +153,8 @@
             commandDict.update(kw)
             commandStr = json.dumps(commandDict) + "\n"
             data = QByteArray(commandStr.encode("utf-8"))
-            self.__pyqt5Server.write(data)
-            result = self.__pyqt5Server.waitForBytesWritten(10000)
+            self.__pyqt6Server.write(data)
+            result = self.__pyqt6Server.waitForBytesWritten(10000)
         return result
     
     def __receiveResponse(self):
@@ -164,8 +164,8 @@
         @return response dictionary (dict)
         """
         responseDict = {}
-        if self.__pyqt5Server.waitForReadyRead(10000):
-            data = bytes(self.__pyqt5Server.readAllStandardOutput())
+        if self.__pyqt6Server.waitForReadyRead(10000):
+            data = bytes(self.__pyqt6Server.readAllStandardOutput())
             responseStr = data.decode("utf-8")
             responseDict = json.loads(responseStr)
             if responseDict["error"]:
@@ -184,7 +184,7 @@
         Public method to shut down the PyQt5 server part.
         """
         self.__sendCommand("exit")
-        self.__pyqt5Server.waitForFinished(5000)
+        self.__pyqt6Server.waitForFinished(5000)
     
     def __insertString(self, s, steps=0):
         """
@@ -481,8 +481,8 @@
         """
         Private slot to validate the entered QRegularExpression.
         """
-        if not self.__pyqt5Available:
-            # only available for PyQt5
+        if not self.__pyqt6Available:
+            # only available for PyQt6
             return
         
         regexp = self.regexpTextEdit.toPlainText()
@@ -554,8 +554,8 @@
         
         @param startpos starting position for the QRegularExpression matching
         """
-        if not self.__pyqt5Available:
-            # only available for PyQt5
+        if not self.__pyqt6Available:
+            # only available for PyQt6
             return
         
         regexp = self.regexpTextEdit.toPlainText()
@@ -780,7 +780,7 @@
             code += '{0}{1}{2}'.format(os.linesep, i1string, options)
         else:
             code += 'r"""{0}"""'.format(regexp.replace('"', '\\"'))
-        code += '){0}'.format(estring)
+        code += '{0}){0}'.format(estring)
         return code
 
 
--- a/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py	Wed Jun 09 17:13:01 2021 +0200
+++ b/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py	Wed Jun 09 17:48:02 2021 +0200
@@ -4,7 +4,7 @@
 #
 
 """
-Module implementing the PyQt5 server part of the QRegularExpression wizzard.
+Module implementing the PyQt6 server part of the QRegularExpression wizzard.
 """
 
 import json
@@ -133,7 +133,7 @@
                     break
                 elif command == "available":
                     try:
-                        import PyQt5    # __IGNORE_WARNING__
+                        import PyQt6    # __IGNORE_WARNING__
                         responseDict["available"] = True
                     except ImportError:
                         responseDict["available"] = False

eric ide

mercurial