Skip to content
Permalink
Browse files
Plugin Installer update
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9798 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Dec 14, 2008
1 parent 4a1b10e commit 5fbda849c36b74e2b42ca615eb3c41d4286aa6d3
@@ -14,7 +14,7 @@ def name():
return "Plugin Installer"

def version():
return "Version 0.9.4"
return "Version 0.9.5"

def description():
return "Downloads and installs QGIS python plugins"
@@ -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 @@ def xmlDownloaded(self,nr,state):
"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 @@ def updatePlugin(self, key, readOnly):
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 isThereAnythingNew(self):
# ----------------------------------------- #
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"

@@ -412,7 +412,7 @@ def addItem(p):
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 @@ def installPlugin(self):
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:")
@@ -26,6 +26,7 @@ class InstallerPlugin():
# ----------------------------------------- #
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

0 comments on commit 5fbda84

Please sign in to comment.