Abstract base class for subclasses that handle HTTP requests for a URL.
def google.appengine.tools.devappserver2.url_handler.URLHandler.__init__ |
( |
|
self, |
|
|
|
url_pattern |
|
) |
| |
Initializer for URLHandler.
Args:
url_pattern: A re.RegexObject that matches URLs that should be handled by
this handler. It may also optionally bind groups.
def google.appengine.tools.devappserver2.url_handler.URLHandler.handle |
( |
|
self, |
|
|
|
match, |
|
|
|
environ, |
|
|
|
start_response |
|
) |
| |
Serves the content associated with this handler.
Args:
match: The re.MatchObject containing the result of matching the URL
against this handler's URL pattern.
environ: An environ dict for the current request as defined in PEP-333.
start_response: A function with semantics defined in PEP-333.
Returns:
An iterable over strings containing the body of the HTTP response.
def google.appengine.tools.devappserver2.url_handler.URLHandler.handle_authorization |
( |
|
self, |
|
|
|
environ, |
|
|
|
start_response |
|
) |
| |
Handles the response if the user is not authorized to access this URL.
If the user is authorized, this method returns None without side effects.
The default behaviour is to always authorize the user.
If the user is not authorized, this method acts as a WSGI handler, calling
the start_response function and returning the message body. The response
will either redirect to the login page, or contain an error message, as
specified by the 'auth_fail_action' setting.
Args:
environ: An environ dict for the current request as defined in PEP-333.
start_response: A function with semantics defined in PEP-333.
Returns:
An iterable over strings containing the body of an HTTP response, if the
authorization check fails or the login UI must be displayed. None if the
user is authorized to access the resource.
def google.appengine.tools.devappserver2.url_handler.URLHandler.match |
( |
|
self, |
|
|
|
url |
|
) |
| |
Tests whether a given URL string matches this handler.
Args:
url: A URL string to match.
Returns:
A re.MatchObject containing the result of the match, if the URL string
matches this handler. None, otherwise.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/tools/devappserver2/url_handler.py