From ef79c9991b55975157607c6d7b0cca52a6929023 Mon Sep 17 00:00:00 2001 From: ryuslash Date: Thu, 22 Apr 2010 22:24:38 +0200 Subject: Nasty bug where it didn't actually save anything --- download.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'download.py') diff --git a/download.py b/download.py index 42fcd52..eeec200 100644 --- a/download.py +++ b/download.py @@ -23,6 +23,7 @@ import htmlparser import config import sys import backend +import util def get_savedir(): conf = config.Configuration() @@ -125,6 +126,8 @@ class Downloader(object): progress.show_progress(i) filename = os.path.join(get_savedir(), os.path.split(link)[1]) if not check_archive(filename): + util.log(util.LogType.Msg, "%s is not in archive" % filename, None) + tries = 10 while tries > 0: try: @@ -135,10 +138,15 @@ class Downloader(object): if tries == 0: failed += 1 else: + util.log(util.LogType.Msg, "succsesfully downloaded %s" % filename, None) downloaded += 1 if self.on_downloaded is not None: + util.log(util.LogType.Msg, "", self.on_downloaded) + if not self.on_downloaded(filename): failed += 1 + else: + util.log(util.LogType.Warn, "on_downloaded is None", None) else: skipped += 1 i += 1 -- cgit v1.2.3-54-g00ecf