public
Description: A version of the Google App Engine SDK modified to work with AppDrop.com
Homepage: http://appdrop.com
Clone URL: git://github.com/jchris/portable-google-app-engine-sdk.git
working on storing nicknames
jchris (author)
Sun Apr 13 23:50:00 -0700 2008
commit  598e42f628fe2b7f6e3d0ccd0e9874d0009c46ea
tree    90a5406158bb5c57627b49fb18e9e024bff50eb6
parent  8fc65b2bd0bc31ae2c20669ac4043c4d09f35015
...
62
63
64
65
 
66
67
68
...
76
77
78
 
 
 
 
79
80
81
...
83
84
85
 
86
87
88
...
93
94
95
 
 
96
97
98
...
62
63
64
 
65
66
67
68
...
76
77
78
79
80
81
82
83
84
85
...
87
88
89
90
91
92
93
...
98
99
100
101
102
103
104
105
0
@@ -62,7 +62,7 @@ class User(object):
0
   """
0
 
0
 
0
- def __init__(self, email=None, _auth_domain=None):
0
+ def __init__(self, email=None, _auth_domain=None, nickname=None):
0
     """Constructor.
0
 
0
     Args:
0
@@ -76,6 +76,10 @@ class User(object):
0
 
0
     assert _auth_domain
0
 
0
+ if nickname is None:
0
+ assert 'USER_NICKNAME' in os.environ
0
+ nickname = os.environ['USER_NICKNAME']
0
+
0
     if email is None:
0
       assert 'USER_EMAIL' in os.environ
0
       email = os.environ['USER_EMAIL']
0
@@ -83,6 +87,7 @@ class User(object):
0
     if not email:
0
       raise UserNotFoundError
0
 
0
+ self.__nickname = nickname
0
     self.__email = email
0
     self.__auth_domain = _auth_domain
0
 
0
@@ -93,6 +98,8 @@ class User(object):
0
     with respect to this application. It will be an email address for some
0
     users, but not all.
0
     """
0
+ if self.__nickname:
0
+ return self.__nickname
0
     if (self.__email and self.__auth_domain and
0
         self.__email.endswith('@' + self.__auth_domain)):
0
       suffix_len = len(self.__auth_domain) + 1
...
492
493
494
 
495
496
497
...
492
493
494
495
496
497
498
0
@@ -492,6 +492,7 @@ def SetupEnvironment(cgi_path,
0
   cookies = ', '.join(headers.getheaders('cookie'))
0
   email, nickname, admin, valid_cookie = get_user_info(cookies)
0
   env['USER_EMAIL'] = email
0
+ env['USER_NICKNAME'] = nickname
0
 
0
   if admin:
0
     env['USER_IS_ADMIN'] = '1'

Comments

    No one has commented yet.