Author: ianb
Date: 2004-04-24 20:53:16 -0600 (Sat, 24 Apr 2004)
New Revision: 99
Modified:
LoginKit/forgotten.py
LoginKit/simpleuser.py
Log:
Fixed typo, added __repr__ to user
Modified: LoginKit/forgotten.py
===================================================================
--- LoginKit/forgotten.py 2004-04-25 02:26:15 UTC (rev 98)
+++ LoginKit/forgotten.py 2004-04-25 02:53:16 UTC (rev 99)
@@ -190,6 +190,7 @@
'not found in our system')
return
+ print repr(user)
expiration = time.time() + (self._expiration * 360)
# Round up, use hours:
expiration = int(expiration / 360 + 0.9)
@@ -205,7 +206,7 @@
'e': expiration,
's': str(signature)},
absolute=True)
- body = """You have requested that you're email address be reset. To reset your
+ body = """You have requested that your email address be reset. To reset your
password, go to this URL:
%s
""" % url
@@ -234,6 +235,7 @@
msg['Subject'] = subject
msg['From'] = fromAddress
msg['To'] = toAddress
+ print msg
server = smtplib.SMTP(self._smtpHost)
#server.set_debuglevel(10)
server.sendmail(fromAddress, [toAddress], msg.as_string())
Modified: LoginKit/simpleuser.py
===================================================================
--- LoginKit/simpleuser.py 2004-04-25 02:26:15 UTC (rev 98)
+++ LoginKit/simpleuser.py 2004-04-25 02:53:16 UTC (rev 99)
@@ -132,3 +132,11 @@
self._email = d.get('email', '')
self._userID = int(d['id'])
+ def __repr__(self):
+ args = []
+ for fieldDesc in self.fieldDescription:
+ if fieldDesc.get('readwrite', 'readwrite') in (
+ 'read', 'readwrite'):
+ args.append(' %s=%r' % (fieldDesc['field'], getattr(self, fieldDesc['field'])()))
+ return '<User %s%s>' % (self.userID(), ''.join(args))
+
|