Author: andar

Revision: 5354

Log:
        Apply the global bandwidth settings on plugin disable to prevent slow 
limits from staying in effect.

Diff:
Modified: trunk/deluge/plugins/scheduler/scheduler/core.py
===================================================================
--- trunk/deluge/plugins/scheduler/scheduler/core.py    2009-06-04 17:46:15 UTC 
(rev 5353)
+++ trunk/deluge/plugins/scheduler/scheduler/core.py    2009-06-05 02:10:41 UTC 
(rev 5354)
@@ -96,10 +96,23 @@
         except:
             pass
 
+        self.__apply_set_functions()
+
     def update(self):
         pass
 
 
+    def __apply_set_functions(self):
+        """
+        Have the core apply it's bandwidth settings as specified in core.conf.
+        """
+        core_config = deluge.configmanager.ConfigManager("core.conf")
+        core_config.apply_set_functions("max_download_speed")
+        core_config.apply_set_functions("max_upload_speed")
+        core_config.apply_set_functions("max_active_limit")
+        # Resume the session if necessary
+        component.get("Core").session.resume()
+
     def do_schedule(self, timer=True):
         """
         This is where we apply schedule rules.
@@ -110,12 +123,7 @@
         if state == "Green":
             # This is Green (Normal) so we just make sure we've applied the
             # global defaults
-            core_config = deluge.configmanager.ConfigManager("core.conf")
-            core_config.apply_set_functions("max_download_speed")
-            core_config.apply_set_functions("max_upload_speed")
-            core_config.apply_set_functions("max_active_limit")
-            # Resume the session if necessary
-            component.get("Core").session.resume()
+            self.__apply_set_functions()
         elif state == "Yellow":
             # This is Yellow (Slow), so use the settings provided from the user
             session = component.get("Core").session



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to