diff options
| -rw-r--r-- | Core.py | 24 | 
1 files changed, 6 insertions, 18 deletions
| @@ -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 | 
