diff options
author | spoob <spoob@gmx.de> | 2009-06-24 02:05:58 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-06-24 02:05:58 +0200 |
commit | b2ccdeed35759b99042de0e56453a66892cca9b1 (patch) | |
tree | abc38f8c21e46969298126bd641801bcadd2a838 | |
parent | fixed 4chan user wish (diff) | |
download | pyload-b2ccdeed35759b99042de0e56453a66892cca9b1.tar.xz |
fixed some bugs
-rw-r--r-- | config | 7 | ||||
-rw-r--r-- | pyLoadCli.py | 2 | ||||
-rw-r--r-- | pyLoadCore.py | 19 |
3 files changed, 16 insertions, 12 deletions
@@ -15,12 +15,13 @@ log_folder = Logs log_count = 5 #each log has 100kb [downloadTime] -start = 0:00 -end = 24:00 +#use HH:MM +start = 00:00 +end = 00:00 [remote] port = 7272 remotePassword = pwhere [proxy] useproxy = False proxyProtocol = http -proxyAdress = http://localhost:8080
\ No newline at end of file +proxyAdress = http://localhost:8080 diff --git a/pyLoadCli.py b/pyLoadCli.py index f77fa19f0..6f38a40e7 100644 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -198,7 +198,7 @@ class pyLoadCli: if inp[:7] == "http://": self.thread.push_exec("add_links", [(inp, None)]) self.links_added += 1 - elif self.pos[0] == 2: + elif self.pos[0] == 2: #remove links if inp == "p": self.pos[1] -= 5 elif inp == "n": diff --git a/pyLoadCore.py b/pyLoadCore.py index a9364d98a..e9d933dc6 100644 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -#Copyright (C) 2009 sp00b, sebnapi, RaNaN +#Copyright (C) 2009 spoob, sebnapi, RaNaN # #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by @@ -99,14 +99,18 @@ class Core(object): def read_links(self): """read links from txt""" txt = open(self.config['link_file'], 'r') + new_links = 0 links = txt.readlines() - self.file_list.extend(links) + for link in links: + if link != "\n": + self.file_list.append(link) + new_links += 1 txt.close() self.file_list.save() - if links: - self.logger.info("Parsed links from " + self.config['link_file'] + ": " + str(len(self.file_list.data))) + if new_links: + self.logger.info("Parsed link from %s: %i" % (self.config['link_file'], new_links)) txt = open(self.config['link_file'], 'w') txt.write("") @@ -135,7 +139,6 @@ class Core(object): print _("could not create %s") % legend exit() - def init_logger(self, level): file_handler = logging.handlers.RotatingFileHandler(self.config['log_folder'] + sep + 'log.txt', maxBytes=102400, backupCount=int(self.config['log_count'])) #100 kib each @@ -153,12 +156,13 @@ class Core(object): self.logger.addHandler(console) #if console logging self.logger.setLevel(level) - def is_dltime(self): start_h, start_m = self.config['start'].split(":") end_h, end_m = self.config['end'].split(":") - #@todo: little bug, when start and end time in same hour + if (start_h, start_m) == (end_h, end_m): + return True + hour, minute = time.localtime()[3:5] if hour > int(start_h) and hour < int(end_h): @@ -229,7 +233,6 @@ class Core(object): status['queue'] = len(self.file_list.files) return status - def init_server(self): self.server = ServerThread(self) self.server.start() |