fw.py 文件源码

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

项目:reahl 作者: reahl 项目源码 文件源码
def create_file(self, relative_path):
        path = relative_path[1:]
        context = ExecutionContext.get_context()
        static_root = context.config.web.static_root
        relative_path = self.root_path.split('/')+path.split('/')
        full_path = os.path.join(static_root, *relative_path)
        logging.getLogger(__name__).debug('Request is for static file "%s"' % full_path)
        if os.path.isfile(full_path):
            return FileOnDisk(full_path, relative_path)
        raise NoMatchingFactoryFound(relative_path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号