depot.py 文件源码

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

项目:solaris-ips 作者: oracle 项目源码 文件源码
def _get_req_pub(self):
                """Private helper function to retrieve the publisher prefix
                for the current operation from the request path.  Returns None
                if a publisher prefix was not found in the request path.  The
                publisher is assumed to be the first component of the path_info
                string if it doesn't match the operation's name.  This does mean
                that a publisher can't be named the same as an operation, but
                that isn't viewed as an unreasonable limitation.
                """

                if self.request_pub_func:
                        return self.request_pub_func(cherrypy.request.path_info)
                try:
                        req_pub = cherrypy.request.path_info.strip("/").split(
                            "/")[0]
                except IndexError:
                        return None

                if req_pub not in self.REPO_OPS_DEFAULT and req_pub != "feed":
                        # Assume that if the first component of the request path
                        # doesn't match a known operation that it's a publisher
                        # prefix.
                        return req_pub
                return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号