Skip to content
Permalink
Browse files

Don't check for plugin errors at startup

  • Loading branch information
borysiasty authored and wonder-sk committed Aug 27, 2011
1 parent 9cf2078 commit 260bf0c139b94582368329e64f2936b6118f5af3
@@ -511,7 +511,7 @@ def removeRepository(self, repo):


# ----------------------------------------- #
def getInstalledPlugin(self, key, readOnly):
def getInstalledPlugin(self, key, readOnly, testLoad=False):
""" get the metadata of an installed plugin """
if readOnly:
path = QgsApplication.pkgDataPath()
@@ -557,10 +557,11 @@ def getInstalledPlugin(self, key, readOnly):
errorDetails = qgisMinimumVersion
except:
pass
try:
exec ("%s.classFactory(iface)" % key)
except Exception, error:
error = unicode(error.args[0])
if testLoad:
try:
exec ("%s.classFactory(iface)" % key)
except Exception, error:
error = unicode(error.args[0])
except Exception, error:
error = unicode(error.args[0])

@@ -596,7 +597,7 @@ def getInstalledPlugin(self, key, readOnly):


# ----------------------------------------- #
def getAllInstalled(self):
def getAllInstalled(self, testLoad=False):
""" Build the localCache """
self.localCache = {}
# first, try to add the read-only plugins...
@@ -625,7 +626,7 @@ def getAllInstalled(self):
for key in pluginDir.entryList():
key = unicode(key)
if not key in [".",".."]:
plugin = self.getInstalledPlugin(key, False)
plugin = self.getInstalledPlugin(key, False, testLoad)
if key in self.localCache.keys() and compareVersions(self.localCache[key]["version_inst"],plugin["version_inst"]) == 1:
# An obsolete plugin in the "user" location is masking a newer one in the "system" location!
self.obsoletePlugins += [key]
@@ -528,10 +528,10 @@ def addItem(p):
n +=1
self.setWindowTitle(self.tr("QGIS Python Plugin Installer") + self.tr(" - %d plugins available" % len(plugins.all())))
self.buttonUpgradeAll.setEnabled( len(self.upgradeablePlugins) )

# initially, keep insert order
self.treePlugins.sortItems(100,Qt.AscendingOrder)

# resize the columns
for i in [0,1,2,3,4,5]:
self.treePlugins.resizeColumnToContents(i)
@@ -630,7 +630,7 @@ def installPlugin(self, key, quiet=False):
exec ("reload (%s)" % plugin["localdir"])
except:
pass
plugins.getAllInstalled()
plugins.getAllInstalled(testLoad=True)
plugins.rebuild()
plugin = plugins.all()[key]
if not plugin["error"]:

0 comments on commit 260bf0c

Please sign in to comment.
You can’t perform that action at this time.