def shelve(app_or_name, logfile=None): """Shelve the route contexts of an app, given by object or import name. Does not return anything, and inherently has side-effects: >>> shelve('simplest') >>> shelve(build_app('simplest')) """ if isinstance(app_or_name, Tango): app = app_or_name else: app = build_app(app_or_name, import_stash=True, use_snapshot=False, logfile=logfile) for route in app.routes: site, rule, context = route.site, route.rule, route.context if logfile is not None: logfile.write('Stashing {0} {1} ... '.format(site, rule)) app.connector.put(site, rule, context) if logfile is not None: logfile.write('done.\n')
def create_app(self): return build_app('sampletypes', import_stash=True)
def create_app(self): return build_app('simplesite')
from tango.factory.app import build_app app = build_app('hybrid') app.this_was_added_after_stash = 'Hello, world!'