Last updated
from cement import App
class MyApp(App):
class Meta:
label = 'myapp'
extensions = ['yaml']
config_handler = 'yaml'
config_file_suffix = '.yml'---
myapp:
foo: barfrom cement import App, init_defaults
META = init_defaults('output.yaml')
META['output.yaml']['overridable'] = True
class MyApp(App):
class Meta:
label = 'myapp'
extensions = ['yaml', 'mustache']
meta_defaults = META
output_handler = 'mustache'
template_dir = './templates'
with MyApp() as app:
app.run()
data = {'foo': 'bar'}
app.render(data, 'example.m')Foo: {{ foo }}$ python myapp.py
Foo: bar
$ python myapp.py -o yaml
{foo: bar}