From 4f4bd9b0fcdff61c08af71c4c969418d808d4d7c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 3 Nov 2008 22:25:23 +0100 Subject: [PATCH] Converted debug log to error log. --- download/getfile.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/download/getfile.py b/download/getfile.py index eb57b56d..c503e71b 100644 --- a/download/getfile.py +++ b/download/getfile.py @@ -7,8 +7,8 @@ import urlparse import cgi from mimetypes import guess_type -debug = open("debug.log", "a") #None access = open("access.log", "a") +error = open("error.log", "a") hosts = ( # PRIO SCHEME HOSTNAME PATH @@ -63,8 +63,8 @@ class Server: try: f = urllib2.urlopen("%s" % urlparse.urljoin(self.url(), file)) except (urllib2.HTTPError, urllib2.URLError), e: - if debug: - debug.write("ERR %s %s\n" % (self.url(), e)) + if error: + error.write("ERR 500 - %s %s\n" % (self.url(), e)) else: ret = f.geturl() f.close() @@ -127,8 +127,6 @@ while servers.all(): print access.write("%s\n" % url) - if debug: - debug.write("OK %s\n" % url) break else: @@ -140,9 +138,9 @@ else: print "Pragma: no-cache" print - if debug: - debug.write("ERR %s wasn't found on any server" % file) + if error: + error.write("ERR 404 - %s wasn't found on any server" % file) access.close() -if debug: - debug.close() +if error: + error.close() -- 2.47.3