# HG changeset patch # User paulb # Date 1169581125 0 # Node ID b4cfa34bb331d540c2b0f5db96de472404e5ed2b # Parent 8c1577cfd19b88ec76d354a71b89754bb9843228 [project @ 2007-01-23 19:38:45 by paulb] Added a separate page encoding to the Login class initialiser. Adjusted get_target to work better with transactions whose default_charset has been initialised previously. diff -r 8c1577cfd19b -r b4cfa34bb331 WebStack/Resources/Login.py --- a/WebStack/Resources/Login.py Sun Jan 21 00:32:06 2007 +0000 +++ b/WebStack/Resources/Login.py Tue Jan 23 19:38:45 2007 +0000 @@ -30,7 +30,7 @@ encoding = "utf-8" - def __init__(self, authenticator, use_redirect=1, urlencoding=None): + def __init__(self, authenticator, use_redirect=1, urlencoding=None, encoding=None): """ Initialise the resource with an 'authenticator'. @@ -42,6 +42,9 @@ The optional 'urlencoding' parameter allows a special encoding to be used in producing the redirection path. + The optional 'encoding' parameter allows a special encoding to be used + in producing the login pages. + To change the pages employed by this resource, either redefine the 'login_page' and 'success_page' attributes in instances of this class or a subclass, or override the 'show_login' and 'show_success' methods. @@ -49,7 +52,8 @@ self.authenticator = authenticator self.use_redirect = use_redirect - self.urlencoding = urlencoding or self.encoding + self.urlencoding = urlencoding + self.encoding = encoding or self.encoding def respond(self, trans): @@ -192,10 +196,10 @@ # General functions. -def get_target(trans, urlencoding, encoding): +def get_target(trans, urlencoding=None, encoding=None): """ - Return the application, path and query string for 'trans' using the given + Return the application, path and query string for 'trans' using the optional 'urlencoding' (or path encoding) and request body 'encoding'. """