def __init__(self, portal, callback=None, errback=None):
"""Constructs a UsernamePasswordWrapper around the given portal.
@param portal: A cred portal for your web application. The checkers
associated with this portal must be able to accept username/password
credentials.
@type portal: L{twisted.cred.portal.Portal}
@param callback: Gets called after a successful login attempt.
A resource that redirects to "." will display the avatar resource.
If this parameter isn't provided, defaults to a standard Woven
"Thank You" page.
@type callback: A callable that accepts a Woven
L{model<twisted.web.woven.interfaces.IModel>} and returns a
L{IResource<twisted.web.resource.Resource>}.
@param errback: Gets called after a failed login attempt.
If this parameter is not provided, defaults to a the standard Woven
form error (i.e. The original form on a page of its own, with
errors noted.)
@type errback: A callable that accepts a Woven
L{model<twisted.web.woven.interfaces.IModel>} and returns a
L{IResource<twisted.web.resource.Resource>}.
"""
Resource.__init__(self)
self.portal = portal
self.callback = callback
self.errback = errback
评论列表
文章目录