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 ++++++++++++++++++++++---------------------- Py_Load_File.py | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 Py_Load_File.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 diff --git a/Py_Load_File.py b/Py_Load_File.py new file mode 100644 index 000000000..d5427ae24 --- /dev/null +++ b/Py_Load_File.py @@ -0,0 +1,18 @@ +from download_thread import Status + +class PyLoadFile: + """ represents the url or file + """ + def __init__(self, parent, url): + self.parent = parent + self.id = None + self.plugin = None + self.url = url + self.download_folder = "" + self.status = Status() + + def _get_my_plugin(): + plugins = parent.get_avail_plugins() + + + \ No newline at end of file -- cgit v1.2.3