Corrected some code formatting and style issues. eric7

Mon, 22 Jul 2024 17:07:46 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 22 Jul 2024 17:07:46 +0200
branch
eric7
changeset 10859
399d19fc7eb5
parent 10858
8a03d5f6146c
child 10860
46d5db6cd55d

Corrected some code formatting and style issues.

src/eric7/Cooperation/ChatWidget.py file | annotate | diff | comparison | revisions
src/eric7/JediInterface/JediServer.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginCodeStyleChecker.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/WebAuth/Fido2Management.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/WebAuth/Fido2ManagementDialog.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
src/eric7/eric7_fido2.py file | annotate | diff | comparison | revisions
--- a/src/eric7/Cooperation/ChatWidget.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/Cooperation/ChatWidget.py	Mon Jul 22 17:07:46 2024 +0200
@@ -171,8 +171,7 @@
         color = self.chatEdit.textColor()
         self.chatEdit.setTextColor(Qt.GlobalColor.gray)
         self.chatEdit.append(
-            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss")
-            + ":"
+            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + ":"
         )
         self.chatEdit.append(self.tr("* {0} has joined.\n").format(nick))
         self.chatEdit.setTextColor(color)
@@ -213,8 +212,7 @@
             color = self.chatEdit.textColor()
             self.chatEdit.setTextColor(Qt.GlobalColor.gray)
             self.chatEdit.append(
-                QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss")
-                + ":"
+                QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + ":"
             )
             self.chatEdit.append(self.tr("* {0} has left.\n").format(nick))
             self.chatEdit.setTextColor(color)
@@ -377,8 +375,7 @@
         color = self.chatEdit.textColor()
         self.chatEdit.setTextColor(Qt.GlobalColor.red)
         self.chatEdit.append(
-            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss")
-            + ":"
+            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + ":"
         )
         self.chatEdit.append(message + "\n")
         self.chatEdit.setTextColor(color)
@@ -680,8 +677,7 @@
         color = self.chatEdit.textColor()
         self.chatEdit.setTextColor(Qt.GlobalColor.darkYellow)
         self.chatEdit.append(
-            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss")
-            + ":"
+            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + ":"
         )
         self.chatEdit.append(
             self.tr("* {0} has been kicked.\n").format(itm.text().split("@")[0])
@@ -698,8 +694,7 @@
         color = self.chatEdit.textColor()
         self.chatEdit.setTextColor(Qt.GlobalColor.darkYellow)
         self.chatEdit.append(
-            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss")
-            + ":"
+            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + ":"
         )
         self.chatEdit.append(
             self.tr("* {0} has been banned.\n").format(itm.text().split("@")[0])
@@ -716,8 +711,7 @@
         color = self.chatEdit.textColor()
         self.chatEdit.setTextColor(Qt.GlobalColor.darkYellow)
         self.chatEdit.append(
-            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss")
-            + ":"
+            QDateTime.currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + ":"
         )
         self.chatEdit.append(
             self.tr("* {0} has been banned and kicked.\n").format(
--- a/src/eric7/JediInterface/JediServer.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/JediInterface/JediServer.py	Mon Jul 22 17:07:46 2024 +0200
@@ -749,9 +749,7 @@
         else:
             with contextlib.suppress(KeyError):
                 self.__editors[result["Uuid"]].reload()
-                self.__editors[result["Uuid"]].setCheckExternalModificationEnabled(
-                    True
-                )
+                self.__editors[result["Uuid"]].setCheckExternalModificationEnabled(True)
 
         with contextlib.suppress(KeyError):
             del self.__editors[result["Uuid"]]
--- a/src/eric7/Plugins/PluginCodeStyleChecker.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/Plugins/PluginCodeStyleChecker.py	Mon Jul 22 17:07:46 2024 +0200
@@ -173,9 +173,8 @@
         @type list of (str, str, bool, str, str, bool, int, list of (int, int),
             bool, str, dict, dict, list of str, str, str, bool)
         """
-        if (
-            (lang is None and PythonUtilities.isPythonSource(filename, source))
-            or (lang is not None and lang == "Python3")
+        if (lang is None and PythonUtilities.isPythonSource(filename, source)) or (
+            lang is not None and lang == "Python3"
         ):
             data = [source, args]
             self.backgroundService.enqueueRequest("style", "Python3", filename, data)
--- a/src/eric7/WebBrowser/WebAuth/Fido2Management.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebAuth/Fido2Management.py	Mon Jul 22 17:07:46 2024 +0200
@@ -169,9 +169,7 @@
         # PIN related data
         if self.__ctap2.info.options["clientPin"]:
             msg1 = (
-                self.tr(
-                    "PIN is disabled and must be changed before it can be used!"
-                )
+                self.tr("PIN is disabled and must be changed before it can be used!")
                 if self.__ctap2.info.force_pin_change
                 else ""
             )
@@ -869,18 +867,15 @@
         """
         Public method to check, if the 'forcePinChange' function is supported by the
         selected security key.
-        
+
         @return flag indicating support
         @rtype bool
         """
-        if (
+        return not (
             self.__ctap2 is None
             or self.__ctap2.info is None
             or not self.__ctap2.info.options.get("setMinPINLength")
-        ):
-            return False
-        else:
-            return True
+        )
 
     def forcePinChange(self, pin):
         """
@@ -900,7 +895,7 @@
         @return flag indicating availability
         @rtype bool
         """
-        if (
+        return not (
             self.__ctap2 is None
             or self.__ctap2.info is None
             or not self.__ctap2.info.options.get("setMinPINLength")
@@ -908,10 +903,7 @@
                 self.__ctap2.info.options.get("alwaysUv")
                 and not self.__ctap2.info.options.get("clientPin")
             )
-        ):
-            return False
-        else:
-            return True
+        )
 
     def setMinimumPinLength(self, pin, minLength):
         """
@@ -921,6 +913,7 @@
         @type str
         @param minLength minimum PIN length
         @type int
+        @exception Fido2PinError raised to indicate an issue with the PIN length
         """
         if minLength < 4 or minLength > 63:
             raise Fido2PinError(
@@ -944,19 +937,19 @@
         @return flag indicating availability
         @rtype bool
         """
-        if (
+        return not (
             self.__ctap2 is None
             or self.__ctap2.info is None
             or "alwaysUv" not in self.__ctap2.info.options
-        ):
-            return False
-        else:
-            return True
+        )
 
     def getAlwaysUv(self):
         """
         Public method to get the value of the 'alwaysUv' flag of the current security
         key.
+
+        @return return value of the 'alwaysUv' flag
+        @rtype bool
         """
         if self.__ctap2 is None:
             return False
--- a/src/eric7/WebBrowser/WebAuth/Fido2ManagementDialog.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebAuth/Fido2ManagementDialog.py	Mon Jul 22 17:07:46 2024 +0200
@@ -680,11 +680,13 @@
             EricMessageBox.information(
                 self,
                 self.tr("Always Require User Verification"),
-                self.tr("Always Require User Verification is now enabled.")
-                if self.__manager.getAlwaysUv()
-                else self.tr("Always Require User Verification is now disabled."),
+                (
+                    self.tr("Always Require User Verification is now enabled.")
+                    if self.__manager.getAlwaysUv()
+                    else self.tr("Always Require User Verification is now disabled.")
+                ),
             )
-            
+
         except (Fido2DeviceError, Fido2PinError) as err:
             self.__handleError(
                 error=err,
--- a/src/eric7/WebBrowser/WebBrowserView.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebBrowserView.py	Mon Jul 22 17:07:46 2024 +0200
@@ -235,9 +235,7 @@
             )
         with contextlib.suppress(AttributeError):
             # Qt 6.7+
-            self.__page.webAuthUxRequested.connect(
-                self.__webAuthUxRequested
-            )
+            self.__page.webAuthUxRequested.connect(self.__webAuthUxRequested)
         # The registerProtocolHandlerRequested signal is handled in
         # WebBrowserPage.
         self.__page.selectClientCertificate.connect(self.__selectClientCertificate)
--- a/src/eric7/eric7_fido2.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/eric7_fido2.py	Mon Jul 22 17:07:46 2024 +0200
@@ -107,7 +107,7 @@
     @rtype QWidget
     """
     from eric7.WebBrowser.WebAuth.Fido2ManagementDialog import Fido2ManagementDialog
-    
+
     return Fido2ManagementDialog(standalone=True)
 
 

eric ide

mercurial