0

The date is written into the {time} variable in index.html

This commit is contained in:
timwolla
2011-02-07 22:06:06 +01:00
parent d7bd365959
commit 27f722c3bd

View File

@@ -26,6 +26,7 @@ import json
import logging import logging
import util import util
import cPickle import cPickle
from time import gmtime, strftime
from PIL import Image from PIL import Image
@@ -151,6 +152,16 @@ class QuadtreeGen(object):
for f in files: for f in files:
shutil.copy(os.path.join(root, f), self.destdir) 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: if skipjs:
return return