diff --git a/quadtree.py b/quadtree.py index ead65e8..95ba8e2 100644 --- a/quadtree.py +++ b/quadtree.py @@ -26,6 +26,7 @@ import json import logging import util import cPickle +from time import gmtime, strftime from PIL import Image @@ -151,6 +152,16 @@ class QuadtreeGen(object): for f in files: shutil.copy(os.path.join(root, f), self.destdir) + # Add time in index.html + indexpath = os.path.join(self.destdir, "index.html") + + index = open(indexpath, 'r').read() + index = index.replace( + "{time}", str(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))) + + with open(os.path.join(self.destdir, "index.html"), 'w') as output: + output.write(index) + if skipjs: return