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)
评论列表
文章目录