From: Ben Darnell Date: Mon, 7 Mar 2011 02:31:51 +0000 (-0800) Subject: Update docstrings for get_user_locale and get_error_html. X-Git-Tag: v2.0.0~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6923539ba6937c523d3eb3690e41297f0bd0227b;p=thirdparty%2Ftornado.git Update docstrings for get_user_locale and get_error_html. --- diff --git a/tornado/web.py b/tornado/web.py index 06aacdccc..e32f03bf1 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -612,6 +612,11 @@ class RequestHandler(object): def get_error_html(self, status_code, **kwargs): """Override to implement custom error pages. + get_error_html() should return a string containing the error page, + and should not produce output via self.write(). If you use a + Tornado template for the error page, you must use + "return self.render_string(...)" instead of "self.render()". + If this error was caused by an uncaught exception, the exception object can be found in kwargs e.g. kwargs['exception'] """ @@ -640,7 +645,10 @@ class RequestHandler(object): def get_user_locale(self): """Override to determine the locale from the authenticated user. - If None is returned, we use the Accept-Language header. + If None is returned, we fall back to get_browser_locale(). + + This method should return a tornado.locale.Locale object, + most likely obtained via a call like tornado.locale.get("en") """ return None