From 5ee3579572b60bb8f9e6475a517d69462b0cfe29 Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 23 Dec 2009 21:04:06 +0100 Subject: download speed limit --- pyLoadCore.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pyLoadCore.py') diff --git a/pyLoadCore.py b/pyLoadCore.py index 232adc253..85ca5a5fe 100644 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -90,7 +90,7 @@ class Core(object): self.plugin_folder = join("module", "plugins") - self.xmlconfig = XMLConfigParser(join(self.path,"module","config","core.xml")) + self.xmlconfig = XMLConfigParser(join(self.path,"module","config","core.xml"), join(self.path,"module","config","core_default.xml")) self.config = self.xmlconfig.getConfig() self.do_kill = False @@ -116,7 +116,9 @@ class Core(object): if self.config['ssl']['activated']: self.check_install("OpenSSL", "OpenSSL for secure connection", True) self.check_file(self.config['ssl']['cert'], _("ssl certificate"), False, True) - self.check_file(self.config['ssl']['key'], _("ssl key"), False, True) + self.check_file(self.config['ssl']['key'], _("ssl key"), False, True) + + self.downloadSpeedLimit = int(self.xmlconfig.get("general", "download_speed_limit", 0)) if self.config['general']['debug_mode']: self.init_logger(logging.DEBUG) # logging level @@ -307,7 +309,10 @@ class Core(object): if start < now and end > now: return True elif start > end and (now > start or now < end): return True elif start < now and end < now and start > end: return True - else: return False + else: return False + + def getMaxSpeed(self): + return self.downloadSpeedLimit #################################### ########## XMLRPC Methods ########## -- cgit v1.2.3