コード例 #1
0
    def __init__(self, config):
        self.config = config
        template_loader = self.boot_template()
        self.boot_database()

        self.autoload = AutoLoader()
        self.autoload.autoload()

        settings = dict(static_path=config.get(
            "asset.path", os.path.join(os.path.dirname(__file__), "asset")),
                        static_url_prefix=config.get("asset.url_prefix",
                                                     "/assets/"),
                        template_loader=template_loader,
                        debug=self.config.get("debug", False),
                        cookie_secret=self.config.get("secert_key", None))
        zephyr.breeze.Application.__init__(self, self.autoload.routes,
                                           **settings)

        self.hooks.attach("on_start_request", zephyr.hooks.on_load_session)
        self.error_page(404, zephyr.hooks.on_not_found)