0

explicitly create dest dir to fix race condition

This commit is contained in:
Andrew Brown
2010-09-18 11:37:03 -04:00
parent b12e2d1c8c
commit e0929d06f4

View File

@@ -80,6 +80,7 @@ class QuadtreeGen(object):
def write_html(self, zoomlevel): def write_html(self, zoomlevel):
"""Writes out index.html""" """Writes out index.html"""
templatepath = os.path.join(os.path.split(__file__)[0], "template.html") templatepath = os.path.join(os.path.split(__file__)[0], "template.html")
html = open(templatepath, 'r').read() html = open(templatepath, 'r').read()
html = html.replace( html = html.replace(
"{maxzoom}", str(zoomlevel)) "{maxzoom}", str(zoomlevel))
@@ -165,6 +166,10 @@ class QuadtreeGen(object):
def go(self, procs): def go(self, procs):
"""Renders all tiles""" """Renders all tiles"""
# Make the destination dir
if not os.path.exists(self.destdir):
os.mkdir(self.destdir)
curdepth = self._get_cur_depth() curdepth = self._get_cur_depth()
if curdepth != -1: if curdepth != -1:
if self.p > curdepth: if self.p > curdepth: