Remove reset_ip_filte...
Content-type: text/plain

Author: johnnyg

Revision: 5454

Log:
        Fix typos in blocklist core.
Remove reset_ip_filter and block_ip_range from deluge core.

Diff:
Modified: trunk/deluge/core/core.py
===================================================================
--- trunk/deluge/core/core.py   2009-07-05 16:25:05 UTC (rev 5453)
+++ trunk/deluge/core/core.py   2009-07-05 16:27:22 UTC (rev 5454)
@@ -626,24 +626,6 @@
         return self.torrentmanager[torrent_id].set_move_completed_path(value)
 
     @export
-    def block_ip_range(self, range):
-        """Block an ip range"""
-        self.ip_filter.add_rule(range[0], range[1], 1)
-
-        # Start a 2 second timer (and remove the previous one if it exists)
-        if self.__set_ip_filter_timer:
-            self.__set_ip_filter_timer.stop()
-
-        self.__set_ip_filter_timer = LoopingCall(self.session.set_ip_filter, 
self.ip_filter)
-        self.__set_ip_filter_timer.start(2, False)
-
-    @export
-    def reset_ip_filter(self):
-        """Clears the ip filter"""
-        self.ip_filter = lt.ip_filter()
-        self.session.set_ip_filter(self.ip_filter)
-
-    @export
     def get_health(self):
         """Returns True if we have established incoming connections"""
         return self.session.status().has_incoming_connections

Modified: trunk/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/core.py    2009-07-05 16:25:05 UTC 
(rev 5453)
+++ trunk/deluge/plugins/blocklist/blocklist/core.py    2009-07-05 16:27:22 UTC 
(rev 5454)
@@ -190,7 +190,8 @@
         if self.config["last_update"] and not self.force_download:
             headers['If-Modified-Since'] = self.config["last_update"]
 
-        log.debug("Attempting to download blocklist %s", url)
+        log.debug("Attempting to download blocklist %s" % url)
+        log.debug("Sending headers: %s" % headers)
         self.is_downloading = True
         return download_file(url, 
deluge.configmanager.get_config_dir("blocklist.download"), headers)
 
@@ -199,7 +200,7 @@
         log.debug("Blocklist download complete!")
         self.is_downloading = False
         return threads.deferToThread(self.update_info,
-                deluge.configmanager.ConfigManager("blocklist.download"))
+                deluge.configmanager.get_config_dir("blocklist.download"))
 
     def on_download_error(self, f):
         """Recovers from download error"""
@@ -219,7 +220,7 @@
             if "Not Modified" in error_msg:
                 log.debug("Blocklist is up-to-date!")
                 d = threads.deferToThread(update_info,
-                        deluge.configmanager.ConfigManager("blocklist.cache"))
+                        deluge.configmanager.get_config_dir("blocklist.cache"))
                 self.use_cache = True
                 f.trap(f.type)
             elif self.failed_attempts < self.config["try_times"]:
@@ -248,8 +249,8 @@
         # Move downloaded blocklist to cache
         if not self.use_cache:
             d = threads.deferToThread(shutil.move,
-                    deluge.configmanager.ConfigManager("blocklist.download"),
-                    deluge.configmanager.ConfigManager("blocklist.cache"))
+                    deluge.configmanager.get_config_dir("blocklist.download"),
+                    deluge.configmanager.get_config_dir("blocklist.cache"))
         return d
 
     def on_import_error(self, f):



--~--~---------~--~----~------------~-------~--~----~
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