From: Maniacikarus Date: Sat, 8 Nov 2008 11:53:06 +0000 (+0100) Subject: Added timestamp to downloader X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=918e8b8c9355868d6cf8f1e607e5288ed478acea;p=ipfire.org.git Added timestamp to downloader --- diff --git a/download/getfile.py b/download/getfile.py index c503e71b..4631ed09 100644 --- a/download/getfile.py +++ b/download/getfile.py @@ -5,6 +5,7 @@ import random import urllib2 import urlparse import cgi +import time from mimetypes import guess_type access = open("access.log", "a") @@ -64,6 +65,7 @@ class Server: f = urllib2.urlopen("%s" % urlparse.urljoin(self.url(), file)) except (urllib2.HTTPError, urllib2.URLError), e: if error: + error.write("%s " % time.asctime()) error.write("ERR 500 - %s %s\n" % (self.url(), e)) else: ret = f.geturl() @@ -126,6 +128,7 @@ while servers.all(): print "Pragma: no-cache" print + access.write("%s " % time.asctime()) access.write("%s\n" % url) break @@ -139,6 +142,7 @@ else: print if error: + error.write("%s " % time.asctime()) error.write("ERR 404 - %s wasn't found on any server" % file) access.close()