Added code to install the 'paho-mqtt' library as a plug-in dependency (eric > 21.5). release-3.1.0

Thu, 13 May 2021 18:15:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 13 May 2021 18:15:49 +0200
changeset 88
59323cbabb7e
parent 87
fe391e485681
child 89
87e84f83f5e0

Added code to install the 'paho-mqtt' library as a plug-in dependency (eric > 21.5).

ChangeLog file | annotate | diff | comparison | revisions
MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html file | annotate | diff | comparison | revisions
PluginMqttMonitor.py file | annotate | diff | comparison | revisions
PluginMqttMonitor.zip file | annotate | diff | comparison | revisions
diff -r fe391e485681 -r 59323cbabb7e ChangeLog
--- a/ChangeLog	Sun Apr 25 17:57:43 2021 +0200
+++ b/ChangeLog	Thu May 13 18:15:49 2021 +0200
@@ -1,5 +1,9 @@
 ChangeLog
 ---------
+Version 3.1.0:
+- added code to install the 'paho-mqtt' library as a plug-in dependency
+  (eric > 21.5)
+
 Version 3.0.0:
 - removed support for obsolete eric6 versions
 - implemented some code simplifications
diff -r fe391e485681 -r 59323cbabb7e MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html
--- a/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html	Sun Apr 25 17:57:43 2021 +0200
+++ b/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html	Thu May 13 18:15:49 2021 +0200
@@ -48,6 +48,10 @@
 <td>Module function to support the display of some executable info.</td>
 </tr>
 <tr>
+<td><a href="#installDependencies">installDependencies</a></td>
+<td>Function to install dependencies of this plug-in.</td>
+</tr>
+<tr>
 <td><a href="#prepareUninstall">prepareUninstall</a></td>
 <td>Module function to prepare for an uninstallation.</td>
 </tr>
@@ -240,6 +244,23 @@
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 <hr />
+<a NAME="installDependencies" ID="installDependencies"></a>
+<h2>installDependencies</h2>
+<b>installDependencies</b>(<i>pipInstall</i>)
+
+<p>
+    Function to install dependencies of this plug-in.
+</p>
+<dl>
+
+<dt><i>pipInstall</i> (function)</dt>
+<dd>
+function to be called with a list of package names.
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
 <a NAME="prepareUninstall" ID="prepareUninstall"></a>
 <h2>prepareUninstall</h2>
 <b>prepareUninstall</b>(<i></i>)
diff -r fe391e485681 -r 59323cbabb7e PluginMqttMonitor.py
--- a/PluginMqttMonitor.py	Sun Apr 25 17:57:43 2021 +0200
+++ b/PluginMqttMonitor.py	Thu May 13 18:15:49 2021 +0200
@@ -24,7 +24,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "3.0.0"
+version = "3.1.0"
 className = "MqttMonitorPlugin"
 packageName = "MqttMonitor"
 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker"
@@ -239,5 +239,18 @@
             Preferences.Prefs.settings.setValue(
                 self.PreferencesKey + "/" + key, value)
 
+
+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 paho.mqtt         # __IGNORE_WARNING__
+    except ImportError:
+        pipInstall(["paho-mqtt"])
+
 #
 # eflag: noqa = M801
diff -r fe391e485681 -r 59323cbabb7e PluginMqttMonitor.zip
Binary file PluginMqttMonitor.zip has changed

eric ide

mercurial