diff options
| author | 2009-05-19 14:19:31 +0200 | |
|---|---|---|
| committer | 2009-05-19 14:19:31 +0200 | |
| commit | 0036345203f37f7f29cc60cbf19b4f355ee8e0ce (patch) | |
| tree | 74093dc90b9e520bcc43e3409f417668be43c9c9 /Core.py | |
| parent | funzt im moment nicht, aber ich arbeite daran (diff) | |
| download | pyload-0036345203f37f7f29cc60cbf19b4f355ee8e0ce.tar.xz | |
UploadedTo funktioniert jetzt auch. Wartezeit wird auch berücksichigt.
TODO: Reconnect verwalten, Download Verwaltung -> von einem Plugin nur eine Datei gleichzeitig, Zeit zum Downloaden etc..
Diffstat (limited to 'Core.py')
| -rw-r--r-- | Core.py | 26 | 
1 files changed, 16 insertions, 10 deletions
| @@ -29,7 +29,7 @@ from sys import path, exit  from logging import warning, basicConfig  import urllib2  import re -from time import sleep +from time import sleep, time  import pickle  #my imports @@ -216,7 +216,7 @@ class Core(object):      def __new_py_load_file(self, url, plugin): -        plugin_name = plugin.__name__ +        #plugin_name = plugin.__name__          new_file = PyLoadFile(self, plugin, url)          new_file.download_folder = self.download_folder          self.thread_list.append_py_load_file(new_file) @@ -225,13 +225,19 @@ class Core(object):      def _test_print_status(self):          if len(self.thread_list.threads)>0:              for pyfile in self.thread_list.py_load_files: -                if pyfile.status != None: -                    fn = pyfile.status.filename -                    p = round(float(pyfile.status.downloaded_kb)/pyfile.status.total_kb, 2) -                    s = round(pyfile.status.rate, 2) -                    del pyfile.status -                    pyfile.status = None -                    print fn + ": " + str(p) + " @ " + str(s) + "kB/s" +                if pyfile.status.type == 'downloading': +                    try: +                        fn = pyfile.status.filename +                        p = round(float(pyfile.status.downloaded_kb)/pyfile.status.total_kb, 2) +                        s = round(pyfile.status.rate, 2) +                        del pyfile.status  #?!? +                        pyfile.status = None +                        print fn + ": " + str(p) + " @ " + str(s) + "kB/s" +                    except: +                        print pyfile.status.filename, "downloading" +                         +                if pyfile.status.type == 'waiting': +                    print pyfile.status.filename + ": " + "wartet", pyfile.status.waituntil -time()      def start(self):          """ starts the machine @@ -239,7 +245,7 @@ class Core(object):          while True:              self._get_links(self.link_file)              self.thread_list.status() -           # self._test_print_status() +            self._test_print_status()              sleep(1)              if len(self.thread_list.threads) == 0:                  break | 
