diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-03 22:26:36 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-03 22:26:36 +0100 |
commit | de578fc6711f288358ef7b369096521a2e457a31 (patch) | |
tree | b45035679f2a980c1d1cf7d271376a059d453568 | |
parent | fixed cnl, packages now pausable (diff) | |
download | pyload-de578fc6711f288358ef7b369096521a2e457a31.tar.xz |
fixed changing the dl speed limit
-rw-r--r-- | pyload/api/ConfigApi.py | 3 | ||||
-rw-r--r-- | pyload/network/RequestFactory.py | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/pyload/api/ConfigApi.py b/pyload/api/ConfigApi.py index 2adc0c565..8da2d6227 100644 --- a/pyload/api/ConfigApi.py +++ b/pyload/api/ConfigApi.py @@ -36,9 +36,6 @@ class ConfigApi(ApiComponent): :param option: :param value: new config value """ - if option in ("limit_speed", "max_speed"): #not so nice to update the limit - self.core.requestFactory.updateBucket() - self.core.config.set(section, option, value, self.primaryUID) def getConfig(self): diff --git a/pyload/network/RequestFactory.py b/pyload/network/RequestFactory.py index 472705409..7bd338ee2 100644 --- a/pyload/network/RequestFactory.py +++ b/pyload/network/RequestFactory.py @@ -26,6 +26,8 @@ class RequestFactory: self.bucket = Bucket() self.updateBucket() + self.core.evm.listenTo("config:changed", self.updateConfig) + def getURL(self, *args, **kwargs): """ see HTTPRequest for argument list """ h = DefaultRequest(self.getConfig()) @@ -84,6 +86,11 @@ class RequestFactory: "password": pw, } + def updateConfig(self, section, option, value): + """ Updates the bucket when a config value changed """ + if option in ("limit_speed", "max_speed"): + self.updateBucket() + def getConfig(self): """returns options needed for pycurl""" return {"interface": self.getInterface(), |