diff options
Diffstat (limited to 'pyload/network/RequestFactory.py')
-rw-r--r-- | pyload/network/RequestFactory.py | 7 |
1 files changed, 7 insertions, 0 deletions
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(), |