]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Update docstrings for get_user_locale and get_error_html.
authorBen Darnell <ben@bendarnell.com>
Mon, 7 Mar 2011 02:31:51 +0000 (18:31 -0800)
committerBen Darnell <ben@bendarnell.com>
Mon, 7 Mar 2011 02:31:51 +0000 (18:31 -0800)
tornado/web.py

index 06aacdccce4610eafd1ce52587928b804ca23e55..e32f03bf1dac4617f433f5fb63920fb7a28eb08a 100644 (file)
@@ -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