Mercurial > treepkg > treepkg
comparison treepkg/web.py @ 442:c29714c601da
use os.mkdirs to create static web directory to get rid of noisy errors if a build machine is rebooted and tmp dir is cleaned
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Fri, 06 Aug 2010 14:27:01 +0000 |
parents | ef87d30468b6 |
children | 464b2947af23 |
comparison
equal
deleted
inserted
replaced
441:eadcb1bb54e2 | 442:c29714c601da |
---|---|
69 | 69 |
70 def create_static_site(self, destdir): | 70 def create_static_site(self, destdir): |
71 """Creates a static web-page under destdir""" | 71 """Creates a static web-page under destdir""" |
72 # make sure we have an empty destdir | 72 # make sure we have an empty destdir |
73 shutil.rmtree(destdir, True) | 73 shutil.rmtree(destdir, True) |
74 os.mkdir(destdir) | 74 os.mkdirs(destdir) |
75 | 75 |
76 # create the index file | 76 # create the index file |
77 f = open(os.path.join(destdir, "index.html"), "wt") | 77 f = open(os.path.join(destdir, "index.html"), "wt") |
78 f.write(self.index()) | 78 f.write(self.index()) |
79 f.close() | 79 f.close() |