ui.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PyPush 作者: VRGhost 项目源码 文件源码
def run(self):
        views.create_views(self)

        app_root = self.flask.config.get("APPLICATION_ROOT")
        if app_root:
            def simple(env, resp):
                resp(b'200 OK', [(b'Content-Type', b'text/html')])
                return [b'<a href="{root}">{root}</a>'.format(root=app_root)]
            print self.flask.config["APPLICATION_ROOT"]
            self.flask.wsgi_app = DispatcherMiddleware(simple, {
                self.flask.config["APPLICATION_ROOT"]: self.flask.wsgi_app
            })
        # Add extra files
        extra_files = []
        for (root, _, files) in os.walk(os.path.join(const.PUSH_WEB_DIR, "templates")):
            extra_files.extend(os.path.join(root, f) for f in files)
        self.flask.run(self.host, self.port, debug=self.debug, extra_files=extra_files)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号