|
61 | 61 | QGIS_MAJOR_VER = 1 |
62 | 62 |
|
63 | 63 |
|
| 64 | + |
| 65 | +def setIface(qgisIface): |
| 66 | + global iface |
| 67 | + iface = qgisIface |
| 68 | + |
| 69 | + |
| 70 | + |
64 | 71 | reposGroup = "/Qgis/plugin-repos" |
65 | 72 | settingsGroup = "/Qgis/plugin-installer" |
66 | 73 | seenPluginGroup = "/Qgis/plugin-seen" |
@@ -317,10 +324,13 @@ def xmlDownloaded(self,nr,state): |
317 | 324 | "repository" : reposName, |
318 | 325 | "localdir" : name, |
319 | 326 | "read-only" : False} |
320 | | - #if compatible, add the plugin to list |
321 | 327 | qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed() |
322 | 328 | if not qgisMinimumVersion: qgisMinimumVersion = "0" |
323 | | - if compareVersions(QGIS_VER, qgisMinimumVersion) < 2: |
| 329 | + # please use the tag below only if really needed! (for example if plugin development is abandoned) |
| 330 | + qgisMaximumVersion = pluginNodes.item(i).firstChildElement("qgis_maximum_version").text().trimmed() |
| 331 | + if not qgisMaximumVersion: qgisMaximumVersion = "2" |
| 332 | + #if compatible, add the plugin to the list |
| 333 | + if compareVersions(QGIS_VER, qgisMinimumVersion) < 2 and compareVersions(qgisMaximumVersion, QGIS_VER) < 2: |
324 | 334 | plugins.addPlugin(plugin) |
325 | 335 | plugins.workarounds() |
326 | 336 | self.mRepositories[reposName]["state"] = 2 |
@@ -440,10 +450,10 @@ def updatePlugin(self, key, readOnly): |
440 | 450 | errorDetails = qgisMinimumVersion |
441 | 451 | except: |
442 | 452 | pass |
443 | | - #try: |
444 | | - # exec ("%s.classFactory(QgisInterface)" % key) |
445 | | - #except Exception, error: |
446 | | - # error = error.message |
| 453 | + try: |
| 454 | + exec ("%s.classFactory(iface)" % key) |
| 455 | + except Exception, error: |
| 456 | + error = error.message |
447 | 457 | except Exception, error: |
448 | 458 | error = error.message |
449 | 459 |
|
@@ -571,8 +581,6 @@ def isThereAnythingNew(self): |
571 | 581 | # ----------------------------------------- # |
572 | 582 | def workarounds(self): |
573 | 583 | """ workarounds for particular plugins with wrong metadata """ |
574 | | - if self.mPlugins.has_key("postgps") and self.mPlugins["postgps"]["version_avail"] == "0.2": |
575 | | - self.mPlugins["postgps"]["version_avail"] = "0.01" |
576 | 584 | if self.mPlugins.has_key("select") and self.mPlugins["select"]["version_avail"] == "0.1": |
577 | 585 | self.mPlugins["select"]["version_avail"] = "0.2" |
578 | 586 |
|
|
0 commit comments