本文整理汇总了Python中nevow.url.URL.fromRequest方法的典型用法代码示例。如果您正苦于以下问题:Python URL.fromRequest方法的具体用法?Python URL.fromRequest怎么用?Python URL.fromRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nevow.url.URL
的用法示例。
在下文中一共展示了URL.fromRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fromRequest
# 需要导入模块: from nevow.url import URL [as 别名]
# 或者: from nevow.url.URL import fromRequest [as 别名]
def fromRequest(cls, store, request):
"""
Return a L{LoginPage} which will present the user with a login prompt.
@type store: L{Store}
@param store: A I{site} store.
@type request: L{nevow.inevow.IRequest}
@param request: The HTTP request which encountered a need for
authentication. This will be effectively re-issued after login
succeeds.
@return: A L{LoginPage} and the remaining segments to be processed.
"""
location = URL.fromRequest(request)
segments = location.pathList(unquote=True, copy=False)
segments.append(request.postpath[0])
return cls(store, segments, request.args)
示例2: produceResource
# 需要导入模块: from nevow.url import URL [as 别名]
# 或者: from nevow.url.URL import fromRequest [as 别名]
def produceResource(self, request, segments, viewer):
if segments == tuple([self.redirectFrom]):
return (URL.fromRequest(request).child(self.redirectTo), ())