def target(): from matcha import make_wsgi_app from uiro.static import generate_static_matching from .pkgs import static_app matching = generate_static_matching(static_app) return TestApp(make_wsgi_app(matching))
def get_matching_app(settings): static_app = DirectoryApp(settings['weiwei.static']) static_matching = m('/static/*path', static_app, name='static') matching = bundle( static_matching, include('', web_matching), ) return make_wsgi_app(matching)
def main(global_conf, root, **settings): """ Entry point to create Uiro application. Setup all of necessary things: * Getting root matching * Initializing DB connection * Initializing Template Lookups * Collecting installed applications * Creating apps for serving static files and will create/return Uiro application. """ matching = import_module_attribute(settings["uiro.root_matching"]) apps = [import_module(app_name) for app_name in settings["uiro.installed_apps"].split("\n") if app_name != ""] static_matching = get_static_app_matching(apps) if static_matching: matching = static_matching + matching setup_lookup(apps) initdb(settings) return make_wsgi_app(matching)
def target(): from matcha import Matching, make_wsgi_app wsgi_app = make_wsgi_app(Matching('/about/', about_htt_app)) return webtest.TestApp(wsgi_app)