Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Helper functions for working with templates"""
with open(path, 'rb') as file: raw = file.read()
content = string.Template(raw).substitute(**kwargs)
with open(path.rstrip('.tmpl'), 'wb') as file: file.write(content) if path.endswith('.tmpl'): os.remove(path)
""" Convert a word to its CamelCase version and remove invalid chars
>>> string_camelcase('lost-pound') 'LostPound'
>>> string_camelcase('missing_images') 'MissingImages'
""" |