]> git.ipfire.org Git - ipfire.org.git/blobdiff - download/getfile.py
Added timestamp to downloader
[ipfire.org.git] / download / getfile.py
index c503e71b0025b4593a253c4a9e4dcece9dbba75f..4631ed0931b3ec65bfc162e1f72b748239bc03dd 100644 (file)
@@ -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()