Author: andar
Revision: 5806
Log:
A few fixes for the blocklist plugin
Diff:
Modified: trunk/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/core.py 2009-10-03 22:53:21 UTC
(rev 5805)
+++ trunk/deluge/plugins/blocklist/blocklist/core.py 2009-10-04 19:09:06 UTC
(rev 5806)
@@ -185,6 +185,7 @@
:param blocklist: path of blocklist
:type blocklist: string
"""
+ log.debug("Updating blocklist info: %s", blocklist)
self.config["last_update"] = datetime.datetime.utcnow().strftime("%a,
%d %b %Y %H:%M:%S GMT")
self.config["list_size"] = os.path.getsize(blocklist)
@@ -225,7 +226,7 @@
def on_download_complete(self, result):
"""Runs any download clean up functions"""
- log.debug("Blocklist download complete!")
+ log.debug("Blocklist download complete: %s", result)
self.is_downloading = False
return threads.deferToThread(self.update_info, result)
@@ -247,9 +248,11 @@
if "Not Modified" in error_msg:
log.debug("Blocklist is up-to-date!")
self.up_to_date = True
- self.use_cache = True
+ if
os.path.exists(deluge.configmanager.get_config_dir("blocklist.cache")):
+ self.use_cache = True
+ bl_filename = "blocklist.cache" if self.use_cache else
"blocklist.download"
d = threads.deferToThread(self.update_info,
- deluge.configmanager.get_config_dir("blocklist.cache"))
+ deluge.configmanager.get_config_dir(bl_filename))
f.trap(f.type)
elif self.failed_attempts < self.config["try_times"]:
log.warning("Blocklist download failed!")
Modified: trunk/deluge/plugins/blocklist/blocklist/detect.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/detect.py 2009-10-03 22:53:21 UTC
(rev 5805)
+++ trunk/deluge/plugins/blocklist/blocklist/detect.py 2009-10-04 19:09:06 UTC
(rev 5806)
@@ -74,5 +74,8 @@
def create_reader(format, compression=""):
reader = READERS.get(format)
if reader and compression:
- reader = DECOMPRESSERS.get(compression)(reader)
+ decompressor = DECOMPRESSERS.get(compression)
+ if decompressor:
+ reader = decompressor(reader)
+
return reader
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---