MqttMonitor/ConfigurationPage/MqttPage.py

branch
eric7
changeset 123
3d7e63ed4fd1
parent 114
8c0e9e602124
child 127
8982ef7b7d67
--- a/MqttMonitor/ConfigurationPage/MqttPage.py	Thu Dec 30 16:36:40 2021 +0100
+++ b/MqttMonitor/ConfigurationPage/MqttPage.py	Wed Sep 21 09:42:33 2022 +0200
@@ -7,9 +7,7 @@
 Module implementing the MQTT Monitor configuration page.
 """
 
-from Preferences.ConfigurationPages.ConfigurationPageBase import (
-    ConfigurationPageBase
-)
+from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
 
 from .Ui_MqttPage import Ui_MqttPage
 
@@ -20,32 +18,32 @@
     """
     Class implementing the MQTT Monitor configuration page.
     """
+
     def __init__(self, plugin):
         """
         Constructor
-        
+
         @param plugin reference to the plugin object
         @type RefactoringRopePlugin
         """
         ConfigurationPageBase.__init__(self)
         self.setupUi(self)
         self.setObjectName("MqttPage")
-        
+
         self.__plugin = plugin
-        
+
         # set initial values
         protocol = self.__plugin.getPreferences("DefaultProtocol")
-        self.mqttv31Button.setChecked(
-            protocol == MqttProtocols.MQTTv31)
-        self.mqttv311Button.setChecked(
-            protocol == MqttProtocols.MQTTv311)
-        self.mqttv5Button.setChecked(
-            protocol == MqttProtocols.MQTTv5)
+        self.mqttv31Button.setChecked(protocol == MqttProtocols.MQTTv31)
+        self.mqttv311Button.setChecked(protocol == MqttProtocols.MQTTv311)
+        self.mqttv5Button.setChecked(protocol == MqttProtocols.MQTTv5)
         self.recentBrokersSpinBox.setValue(
-            self.__plugin.getPreferences("RecentBrokersNumber"))
+            self.__plugin.getPreferences("RecentBrokersNumber")
+        )
         self.recentTopicsSpinBox.setValue(
-            self.__plugin.getPreferences("RecentTopicsNumber"))
-    
+            self.__plugin.getPreferences("RecentTopicsNumber")
+        )
+
     def save(self):
         """
         Public slot to save the Rope Autocompletion configuration.
@@ -59,10 +57,11 @@
         else:
             # should never happen
             protocol = MqttProtocols.MQTTv311
-        
-        self.__plugin.setPreferences(
-            "DefaultProtocol", protocol)
+
+        self.__plugin.setPreferences("DefaultProtocol", protocol)
         self.__plugin.setPreferences(
-            "RecentBrokersNumber", self.recentBrokersSpinBox.value())
+            "RecentBrokersNumber", self.recentBrokersSpinBox.value()
+        )
         self.__plugin.setPreferences(
-            "RecentTopicsNumber", self.recentTopicsSpinBox.value())
+            "RecentTopicsNumber", self.recentTopicsSpinBox.value()
+        )

eric ide

mercurial