Changeset 465 for trunk/pyragua/shared/yapsy/PluginManager.py
- Timestamp:
- 08/09/10 02:15:01 (22 months ago)
- Files:
-
- 1 modified
-
trunk/pyragua/shared/yapsy/PluginManager.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pyragua/shared/yapsy/PluginManager.py
r461 r465 305 305 return len(self._candidates) 306 306 307 def loadPlugins(self, callback=None ):307 def loadPlugins(self, callback=None, candidate_globals=None): 308 308 """ 309 309 Load the candidate plugins that have been identified through a … … 316 316 the callback. 317 317 """ 318 319 if type(candidate_globals) != type({}): 320 candidate_globals = {} 321 318 322 # print "%s.loadPlugins" % self.__class__ 319 323 if not hasattr(self, '_candidates'): … … 328 332 # now execute the file and get its content into a 329 333 # specific dictionnary 330 candidate_globals = {"__file__":candidate_filepath+".py"}334 candidate_globals["__file__"]= candidate_filepath+".py" 331 335 if "__init__" in os.path.basename(candidate_filepath): 332 336 sys.path.append(plugin_info.path) 333 337 try: 334 338 execfile(candidate_filepath+".py",candidate_globals) 335 except Exception,e: 339 except Exception,e: 336 340 logging.debug("Unable to execute the code in plugin: %s" % candidate_filepath) 337 341 logging.debug("\t The following problem occured: %s %s " % (os.linesep, e))
