Skip to content

Commit

Permalink
add a config option for name and move all config into config dict
Browse files Browse the repository at this point in the history
  • Loading branch information
llimllib committed Feb 3, 2012
1 parent 7713b7f commit 12ab41e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions configure.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 5 additions & 3 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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():
Expand All @@ -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))
Expand Down

0 comments on commit 12ab41e

Please sign in to comment.