From 8f47147edd599a59b13d1c4602995971afb6b9df Mon Sep 17 00:00:00 2001 From: sebnapi Date: Sun, 10 May 2009 18:53:15 +0000 Subject: Py_load_File in own file --- Core.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'Core.py') diff --git a/Core.py b/Core.py index f69d59608..e8aff97c9 100644 --- a/Core.py +++ b/Core.py @@ -68,28 +68,28 @@ class Core(object): def get_avial_plugins(self, plugin_folder): """ searches the plugin-folder for plugins """ - #for file in glob(plugin_folder + "/" + '*.py'): - #if file.endswith('.py'): - #self.plugin_file = basename(file).replace('.py', '') - #print self.plugin_file - #try: - #self.new_plugin = __import__(self.plugin_file) - #if self.new_plugin.plugin_type in "hoster" or self.new_plugin.plugin_type in "container": - #print "Plugin geladen: " + self.new_plugin.plugin_name - #self.plugins[self.plugin_file] = __import__(self.plugin_file) - #except: - #print "Fehlerhaftes Plugin: " + self.plugin_file - pluginlist = [] - import os - for f in os.listdir(plugin_folder): - if f.split(".")[1] == "py": - pluginlist.append(__import__(f.split('.')[0],globals(),locals(),[])) - print pluginlist - for modul in pluginlist: - instance = modul.Test_plug() - print instance.Function() - print instance.pluginProp ['name'] - print "s" + for file in glob(plugin_folder + "/" + '*.py'): + if file.endswith('.py'): + self.plugin_file = basename(file).replace('.py', '') + print self.plugin_file + try: + self.new_plugin = __import__(self.plugin_file) + if self.new_plugin.plugin_type in "hoster" or self.new_plugin.plugin_type in "container": + print "Plugin geladen: " + self.new_plugin.plugin_name + self.plugins[self.plugin_file] = __import__(self.plugin_file) + except: + print "Fehlerhaftes Plugin: " + self.plugin_file + #plugindict = {} + #import os + #for f in os.listdir(plugin_folder): + #if f.split(".")[1] == "py": + #plugindict[f.split(".")[0]] = __import__(f.split('.')[0],globals(),locals(),[]) + #print plugindict + #for name, modul in plugindict.items(): + #instance = modul.name() + #print instance.Function() + #print instance.pluginProp ['name'] + #print "s" def _get_links(self, link_file): """ funktion nur zum testen ohne gui bzw. tui -- cgit v1.2.3