CVS commit (wiking): request.py

Milan Zamazal pdm at devel.brailcom.org
Fri May 15 21:48:02 CEST 2009


Update of /var/lib/cvs/wiking/lib/wiking
In directory devel:/tmp/cvs-serv21630/lib/wiking

Modified Files:
	request.py 
Log Message:
New method User.lang


/var/www/hosts/cvs.freebsoft.org/src/wiking:
Index: lib/wiking/request.py
===================================================================
RCS file: /var/lib/cvs/wiking/lib/wiking/request.py,v
retrieving revision 1.81
retrieving revision 1.80
diff -u -r1.81 -r1.80
--- lib/wiking/request.py	7 May 2009 16:25:00 -0000	1.80
+++ lib/wiking/request.py	15 May 2009 19:48:00 -0000	1.81
@@ -674,7 +674,8 @@
     """
     
     def __init__(self, login, uid=None, name=None, roles=(), email=None, data=None,
-                 passwd_expiration=None, uri=None, organization_id=None, organization=None):
+                 passwd_expiration=None, uri=None, organization_id=None, organization=None,
+                 lang='en'):
         """Initialize the instance.
 
         Arguments:
@@ -690,6 +691,7 @@
           organization_id -- id of the user's organization as an Integer
           organization -- name of the user's organization as a string or
             unicode; or 'None' if the user doesn't belong to any organization
+          lang -- code of the user's preferred language
 
         Please note, that password expiration date has currently no impact on the authentication
         process.  It will just be displayed in the login panel, if defined.
@@ -710,6 +712,7 @@
         if organization is not None:
             organization = unicode(organization)
         self._organization = organization
+        self._lang = lang
         self._auto_authentication = False
         self._authentication_method = None
         
@@ -761,6 +764,10 @@
         """
         return self._organization
 
+    def lang(self):
+        """Return code of the user's preferred language."""
+        return self._lang
+
     def auto_authentication(self):
         """Return true iff the user was authenticated automatically."""
         return self._auto_authentication
Index: lib/wiking/cms/cms.py
===================================================================
RCS file: /var/lib/cvs/wiking/lib/wiking/cms/cms.py,v
retrieving revision 1.175
retrieving revision 1.174
diff -u -r1.175 -r1.174
--- lib/wiking/cms/cms.py	15 May 2009 19:47:50 -0000	1.174
+++ lib/wiking/cms/cms.py	15 May 2009 19:48:00 -0000	1.175
@@ -2156,7 +2156,7 @@
         #    organization = None
         return dict(login=login, name=record['user'].value(), uid=record['uid'].value(),
                     uri=uri, email=record['email'].value(), data=record,
-                    roles=self.Spec._roles(record))
+                    roles=self.Spec._roles(record), lang=record['lang'].value())
                     #organization_id=organization_id, organization=organization)
 
     def _make_user(self, kwargs):




More information about the Wiking-cvs mailing list