Store files in month directory

This commit is contained in:
Grégory Soutadé
2014-11-27 14:11:47 +01:00
parent f7bf2e11ba
commit ce4bca056d
7 changed files with 35 additions and 26 deletions

View File

@@ -1,3 +1,4 @@
import os
class DisplayHTMLBlock(object):
@@ -56,7 +57,13 @@ class DisplayHTMLPage(object):
self.blocks.append(block)
def build(self, root):
f = open(root + self.filename, 'w')
filename = root + self.filename
base = os.path.dirname(filename)
if not os.path.exists(base):
os.makedirs(base)
f = open(filename, 'w')
f.write('<html><title>%s</title><body>' % (self.title))
for block in self.blocks:
block.build(f)