def load_plugins(package): plugin_base = PluginBase(package=package) plugin_source = plugin_base.make_plugin_source(searchpath=[os.path.dirname(os.path.realpath(__file__)) + '/' + package], persist=True) plugins = [] for plugin in plugin_source.list_plugins(): loaded_plugin = None try: loaded_plugin = plugin_source.load_plugin(plugin) except: pydev_log.error("Failed to load plugin %s" % plugin, True) if loaded_plugin: plugins.append(loaded_plugin) return plugins
def frameVarsToXML(frame_f_locals): """ dumps frame variables to XML <var name="var_name" scope="local" type="type" value="value"/> """ xml = "" keys = frame_f_locals.keys() if hasattr(keys, 'sort'): keys.sort() #Python 3.0 does not have it else: keys = sorted(keys) #Jython 2.1 does not have it for k in keys: try: v = frame_f_locals[k] xml += varToXML(v, str(k)) except Exception: traceback.print_exc() pydev_log.error("Unexpected error, recovered safely.\n") return xml