summaryrefslogtreecommitdiffstats
path: root/Core.py
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-05-22 21:24:51 +0200
committerGravatar spoob <spoob@gmx.de> 2009-05-22 21:24:51 +0200
commit5aae37e381474077635904ef7b1415c2f876ba2d (patch)
tree21fa590e7cc8989c51a7afe4cb813aa364ecb952 /Core.py
parentdont create new plugin index on every startup (diff)
downloadpyload-5aae37e381474077635904ef7b1415c2f876ba2d.tar.xz
back to the roots
Diffstat (limited to 'Core.py')
-rw-r--r--Core.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/Core.py b/Core.py
index ac4fc7f61..1769282ff 100644
--- a/Core.py
+++ b/Core.py
@@ -57,7 +57,7 @@ class Core(object):
self.create_download_folder(self.download_folder)
self.create_link_file(self.link_file)
self.check_update()
- self.check_plugin_index()
+ self.create_plugin_index()
def read_config(self):
""" sets self.download_folder, self.applicationPath, self.search_updates and self.plugins_folder
@@ -78,19 +78,7 @@ class Core(object):
## #self.check_needed_plugins()
## #self.import_needed_plugins()
- def check_plugin_index(self):
- if not exists(self.plugin_index):
- self.create_plugin_index()
- else:
- plugins_indexed = pickle.load(open(self.plugin_index, "r")).keys() # files in plugin_index.txt
- plugins_in_folder = glob(self.plugins_folder + sep + '*.py') #files in plugin folder
- if len(plugins_indexed) != len(plugins_in_folder) - 2: # without Plugin.py and __init__.py
- remove(self.plugin_index)
- self.create_plugin_index()
- self.plugins_avaible = pickle.load(open(self.plugin_index, "r"))
-
def create_plugin_index(self):
- plugins_dump = {}
for file in glob(self.plugins_folder + sep + '*.py'):
if file != self.plugins_folder + sep + "Plugin.py":
plugin_pattern = ""
@@ -103,9 +91,9 @@ class Core(object):
except:
pass
if plugin_pattern != "":
- plugins_dump[plugin_file] = plugin_pattern
+ self.plugins_avaible[plugin_file] = plugin_pattern
print plugin_file, "hinzugefuegt"
- pickle.dump(plugins_dump, open(self.plugin_index, "w"))
+ pickle.dump(self.plugins_avaible, open(self.plugin_index, "w"))
print "Index der Plugins erstellt"
## def check_needed_plugins(self):
@@ -231,8 +219,8 @@ class Core(object):
for pyfile in self.thread_list.py_downloading:
if pyfile.status.type == 'downloading':
- print pyfile.status.filename, "Speed" ,pyfile.status.get_speed() ,"kb/s"
- print pyfile.status.filename, "ETA" , pyfile.status.get_ETA(), "s"
+ print pyfile.status.filename, "speed:" ,int(pyfile.status.get_speed()) ,"kb/s"
+ print pyfile.status.filename, "ETA" , int(pyfile.status.get_ETA()), "s"
#try:
# fn = pyfile.status.filename
@@ -245,7 +233,7 @@ class Core(object):
# print pyfile.status.filename, "downloading"
if pyfile.status.type == 'waiting':
- print pyfile.status.filename + ": " + "wartet", pyfile.status.waituntil -time() , "s"
+ print pyfile.status.filename + ": " + "wartet noch", int(pyfile.status.waituntil -time()) , "sekunden"
def start(self):
""" starts the machine