[QGIS Commit] r9798 - trunk/qgis/python/plugins/plugin_installer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Dec 14 11:23:38 EST 2008


Author: borysiasty
Date: 2008-12-14 11:23:38 -0500 (Sun, 14 Dec 2008)
New Revision: 9798

Modified:
   trunk/qgis/python/plugins/plugin_installer/__init__.py
   trunk/qgis/python/plugins/plugin_installer/installer_data.py
   trunk/qgis/python/plugins/plugin_installer/installer_gui.py
   trunk/qgis/python/plugins/plugin_installer/installer_plugin.py
Log:
Plugin Installer update

Modified: trunk/qgis/python/plugins/plugin_installer/__init__.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/__init__.py	2008-12-14 14:51:00 UTC (rev 9797)
+++ trunk/qgis/python/plugins/plugin_installer/__init__.py	2008-12-14 16:23:38 UTC (rev 9798)
@@ -14,7 +14,7 @@
   return "Plugin Installer"
 
 def version():
-  return "Version 0.9.4"
+  return "Version 0.9.5"
 
 def description():
   return "Downloads and installs QGIS python plugins"

Modified: trunk/qgis/python/plugins/plugin_installer/installer_data.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_data.py	2008-12-14 14:51:00 UTC (rev 9797)
+++ trunk/qgis/python/plugins/plugin_installer/installer_data.py	2008-12-14 16:23:38 UTC (rev 9798)
@@ -61,6 +61,13 @@
   QGIS_MAJOR_VER = 1
 
 
+
+def setIface(qgisIface):
+  global iface
+  iface = qgisIface
+
+
+
 reposGroup = "/Qgis/plugin-repos"
 settingsGroup = "/Qgis/plugin-installer"
 seenPluginGroup = "/Qgis/plugin-seen"
@@ -317,10 +324,13 @@
             "repository"    : reposName,
             "localdir"      : name,
             "read-only"     : False}
-          #if compatible, add the plugin to list
           qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed()
           if not qgisMinimumVersion: qgisMinimumVersion = "0"
-          if compareVersions(QGIS_VER, qgisMinimumVersion) < 2:
+          # please use the tag below only if really needed! (for example if plugin development is abandoned)
+          qgisMaximumVersion = pluginNodes.item(i).firstChildElement("qgis_maximum_version").text().trimmed()
+          if not qgisMaximumVersion: qgisMaximumVersion = "2"
+          #if compatible, add the plugin to the list
+          if compareVersions(QGIS_VER, qgisMinimumVersion) < 2 and compareVersions(qgisMaximumVersion, QGIS_VER) < 2:
             plugins.addPlugin(plugin)
         plugins.workarounds()
         self.mRepositories[reposName]["state"] = 2
@@ -440,10 +450,10 @@
           errorDetails = qgisMinimumVersion
       except:
         pass
-      #try:
-      #  exec ("%s.classFactory(QgisInterface)" % key)
-      #except Exception, error:
-      #  error = error.message
+      try:
+        exec ("%s.classFactory(iface)" % key)
+      except Exception, error:
+        error = error.message
     except Exception, error:
       error = error.message
 
@@ -571,8 +581,6 @@
   # ----------------------------------------- #
   def workarounds(self):
     """ workarounds for particular plugins with wrong metadata """
-    if self.mPlugins.has_key("postgps") and self.mPlugins["postgps"]["version_avail"] == "0.2":
-      self.mPlugins["postgps"]["version_avail"] = "0.01"
     if self.mPlugins.has_key("select") and self.mPlugins["select"]["version_avail"] == "0.1":
       self.mPlugins["select"]["version_avail"] = "0.2"
 

Modified: trunk/qgis/python/plugins/plugin_installer/installer_gui.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_gui.py	2008-12-14 14:51:00 UTC (rev 9797)
+++ trunk/qgis/python/plugins/plugin_installer/installer_gui.py	2008-12-14 16:23:38 UTC (rev 9798)
@@ -412,7 +412,7 @@
           ver = availableVersion
         else:
           ver = installedVersion
-        if p["status"] in ["upgradeable","newer"]:
+        if p["status"] in ["upgradeable","newer"] or installedVersion == "?" or availableVersion == "?":
           verTip = self.tr("installed version") + ": " + installedVersion + "\n" + self.tr("available version") + ": " + availableVersion
         elif p["status"] in ["not installed", "new"]:
           verTip = self.tr("available version") + ": " + availableVersion
@@ -568,7 +568,7 @@
           message = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")
           message += " <b>" + plugin["error_details"] + "</b>"
         elif plugin["error"] == "dependent":
-          message = self.tr("The plugin depends on some components missing on this system. You need to install the following Python module in order to enable it:")
+          message = self.tr("The plugin depends on some components missing on your system. You need to install the following Python module in order to enable it:")
           message += "<b> " + plugin["error_details"] + "</b>"
         else:
           message = self.tr("The plugin is broken. Python said:")

Modified: trunk/qgis/python/plugins/plugin_installer/installer_plugin.py
===================================================================
--- trunk/qgis/python/plugins/plugin_installer/installer_plugin.py	2008-12-14 14:51:00 UTC (rev 9797)
+++ trunk/qgis/python/plugins/plugin_installer/installer_plugin.py	2008-12-14 16:23:38 UTC (rev 9798)
@@ -26,6 +26,7 @@
   # ----------------------------------------- #
   def __init__(self, iface):
     self.iface = iface
+    setIface(self.iface) #pass self.iface to installer_data module (needed for plugin loading & testing)
     if QGIS_MAJOR_VER: # new plugin API
       self.mainWindow = self.iface.mainWindow
     else: # old plugin API



More information about the QGIS-commit mailing list