PluginMqttMonitor.py

branch
eric7
changeset 132
b4fde9ee3d83
parent 131
899c7cb866a2
child 136
fd301f900752
equal deleted inserted replaced
131:899c7cb866a2 132:b4fde9ee3d83
27 # Start-Of-Header 27 # Start-Of-Header
28 name = "MQTT Monitor Plugin" 28 name = "MQTT Monitor Plugin"
29 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 29 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
30 autoactivate = True 30 autoactivate = True
31 deactivateable = True 31 deactivateable = True
32 version = "10.4.0" 32 version = "10.4.1"
33 className = "MqttMonitorPlugin" 33 className = "MqttMonitorPlugin"
34 packageName = "MqttMonitor" 34 packageName = "MqttMonitor"
35 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker" 35 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker"
36 longDescription = ( 36 longDescription = (
37 """Plug-in implementing a tool to connect to a MQTT broker, subscribe""" 37 """Plug-in implementing a tool to connect to a MQTT broker, subscribe"""
48 error = "" 48 error = ""
49 49
50 mqttPluginObject = None 50 mqttPluginObject = None
51 51
52 52
53 def createMqttPage(configDlg): 53 def createMqttPage(configDlg): # noqa: U100
54 """ 54 """
55 Module function to create the autocompletion configuration page. 55 Module function to create the autocompletion configuration page.
56 56
57 @param configDlg reference to the configuration dialog 57 @param configDlg reference to the configuration dialog
58 @type ConfigurationWidget 58 @type ConfigurationWidget
59 @return reference to the configuration page 59 @return reference to the configuration page
60 @rtype AutoCompletionRopePage 60 @rtype AutoCompletionRopePage
61 """ 61 """
62 global mqttPluginObject 62 global mqttPluginObject
63 from MqttMonitor.ConfigurationPage.MqttPage import MqttPage 63 from MqttMonitor.ConfigurationPage.MqttPage import MqttPage # noqa: I101
64 64
65 page = MqttPage(mqttPluginObject) 65 page = MqttPage(mqttPluginObject)
66 return page 66 return page
67 67
68 68
94 @return dictionary containing the data to query the presence of 94 @return dictionary containing the data to query the presence of
95 the executable 95 the executable
96 @rtype dict 96 @rtype dict
97 """ 97 """
98 try: 98 try:
99 import paho.mqtt 99 import paho.mqtt # noqa: I101, I102
100 100
101 version = paho.mqtt.__version__ 101 version = paho.mqtt.__version__
102 except ImportError: 102 except ImportError:
103 version = QCoreApplication.translate( 103 version = QCoreApplication.translate(
104 "MqttMonitorPlugin", "(package not available)" 104 "MqttMonitorPlugin", "(package not available)"
178 import paho.mqtt # __IGNORE_WARNING__ 178 import paho.mqtt # __IGNORE_WARNING__
179 except ImportError: 179 except ImportError:
180 error = self.tr("The 'paho-mqtt' package is not available.") 180 error = self.tr("The 'paho-mqtt' package is not available.")
181 return None, False 181 return None, False
182 182
183 from MqttMonitor.MqttMonitorWidget import MqttMonitorWidget 183 from MqttMonitor.MqttMonitorWidget import MqttMonitorWidget # noqa: I101
184 184
185 usesDarkPalette = ericApp().usesDarkPalette() 185 usesDarkPalette = ericApp().usesDarkPalette()
186 iconSuffix = "dark" if usesDarkPalette else "light" 186 iconSuffix = "dark" if usesDarkPalette else "light"
187 187
188 self.__widget = MqttMonitorWidget(self, usesDarkPalette) 188 self.__widget = MqttMonitorWidget(self, usesDarkPalette)
355 except ImportError: 355 except ImportError:
356 pipInstall(["paho-mqtt"]) 356 pipInstall(["paho-mqtt"])
357 357
358 358
359 # 359 #
360 # eflag: noqa = M801 360 # eflag: noqa = M801, U200

eric ide

mercurial