@@ -511,7 +511,7 @@ def removeRepository(self, repo):
511511
512512
513513 # ----------------------------------------- #
514- def getInstalledPlugin (self , key , readOnly ):
514+ def getInstalledPlugin (self , key , readOnly , testLoad = False ):
515515 """ get the metadata of an installed plugin """
516516 if readOnly :
517517 path = QgsApplication .pkgDataPath ()
@@ -557,10 +557,11 @@ def getInstalledPlugin(self, key, readOnly):
557557 errorDetails = qgisMinimumVersion
558558 except :
559559 pass
560- try :
561- exec ("%s.classFactory(iface)" % key )
562- except Exception , error :
563- error = unicode (error .args [0 ])
560+ if testLoad :
561+ try :
562+ exec ("%s.classFactory(iface)" % key )
563+ except Exception , error :
564+ error = unicode (error .args [0 ])
564565 except Exception , error :
565566 error = unicode (error .args [0 ])
566567
@@ -596,7 +597,7 @@ def getInstalledPlugin(self, key, readOnly):
596597
597598
598599 # ----------------------------------------- #
599- def getAllInstalled (self ):
600+ def getAllInstalled (self , testLoad = False ):
600601 """ Build the localCache """
601602 self .localCache = {}
602603 # first, try to add the read-only plugins...
@@ -625,7 +626,7 @@ def getAllInstalled(self):
625626 for key in pluginDir .entryList ():
626627 key = unicode (key )
627628 if not key in ["." ,".." ]:
628- plugin = self .getInstalledPlugin (key , False )
629+ plugin = self .getInstalledPlugin (key , False , testLoad )
629630 if key in self .localCache .keys () and compareVersions (self .localCache [key ]["version_inst" ],plugin ["version_inst" ]) == 1 :
630631 # An obsolete plugin in the "user" location is masking a newer one in the "system" location!
631632 self .obsoletePlugins += [key ]
0 commit comments