makedirs
This commit is contained in:
parent
bb91966292
commit
d7541db410
1 changed files with 11 additions and 1 deletions
|
@ -5,6 +5,7 @@ import json
|
|||
import psycopg2
|
||||
from mapcss import MapCSS
|
||||
import cgi
|
||||
import os
|
||||
import sys
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf-8") # a hack to support UTF-8
|
||||
|
@ -187,7 +188,16 @@ aaaa["features"].extend(get_vectors(bbox,zoom,style,"point")["features"])
|
|||
aaaa = callback+"("+json.dumps(aaaa,True,False,separators=(',', ':'))+");"
|
||||
print aaaa
|
||||
|
||||
file = open("/var/www/vtile/%s/%s/%s.js"%(z,x,y),"w")
|
||||
dir = "/var/www/vtile/%s/%s/"%(z,x)
|
||||
file = "%s.js"%y
|
||||
|
||||
try:
|
||||
if not os.path.exists(dir):
|
||||
os.makedirs(dir)
|
||||
except:
|
||||
pass
|
||||
|
||||
file = open(dir+file,"w")
|
||||
file.write(aaaa)
|
||||
file.flush()
|
||||
file.close()
|
||||
|
|
Loading…
Add table
Reference in a new issue