Add comments.

This commit is contained in:
Tim Miller 2013-01-28 23:47:43 -08:00
parent f53322e24d
commit d421265647
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,7 @@ def write_file(path, contents):
out.write(contents)
out.close()
# return a map of filenames->filecontents
def build_tree(templates, config):
res = {}
for in_file, out_file in templates:
@ -50,6 +51,8 @@ def render_executable(path, config):
def read_config(path):
return json.loads(open(path).read())
# flatten a nested hash into a one-level hash
# {x: {a: b} } => {x.a: b}
def flatten(d, prefix='', res=None):
res = res or {}
for k, v in d.items():