From 12ab41e1d9624c143ee599842d371cafc9a24c12 Mon Sep 17 00:00:00 2001 From: bill Date: Thu, 2 Feb 2012 23:34:43 -0500 Subject: [PATCH] add a config option for name and move all config into config dict --- configure.py.sample | 7 +++++-- make.py | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.py.sample b/configure.py.sample index d800c69..28923d1 100755 --- a/configure.py.sample +++ b/configure.py.sample @@ -29,5 +29,8 @@ config["postgis"]["extent"] = "-20037508.34 -20037508.34 20037508.34 20037508.34 # infrequently. The latest versions can be downloaded from osm.org: # - http://tile.openstreetmap.org/processed_p.tar.bz2 # - http://tile.openstreetmap.org/shoreline_300.tar.bz2 -processed_p = "http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip" -shoreline_300 = "http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip" +config["processed_p"] = "http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip" +config["shoreline_300"] = "http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip" + +# The name given to the style +config["name"] = "OSM Bright" diff --git a/make.py b/make.py index 936ab16..210b2e1 100755 --- a/make.py +++ b/make.py @@ -6,7 +6,7 @@ from shutil import copytree, rmtree from os.path import join, isdir -from configure import config, processed_p, shoreline_300 +from configure import config def clean(): if isdir("build"): @@ -29,9 +29,9 @@ def build(): #fill in the project template for layer in template["Layer"]: if layer["id"] == "shoreline_300": - layer["Datasource"]["file"] = shoreline_300 + layer["Datasource"]["file"] = config["shoreline_300"] elif layer["id"] in ("processed_p", "processed_p_outline"): - layer["Datasource"]["file"] = processed_p + layer["Datasource"]["file"] = config["processed_p"] else: # Assume all other layers are PostGIS layers for opt, val in config["postgis"].iteritems(): @@ -41,6 +41,8 @@ def build(): else: layer["Datasource"][opt] = val + template["name"] = config["name"] + #dump the filled-in project template to the build dir with open(join('build', 'project.mml'), 'w') as output: output.write(json.dumps(template, sort_keys=True, indent=2))