Mercurial > hg > commentator
diff commentator/model.py @ 3:d0d8524d9495
finish basic API...still doesnt expire results correctly
author | k0s <k0scist@gmail.com> |
---|---|
date | Fri, 26 Feb 2010 11:06:48 -0500 |
parents | 689b9d928dc8 |
children | f02a3672254e |
line wrap: on
line diff
--- a/commentator/model.py Tue Jan 26 23:00:51 2010 -0500 +++ b/commentator/model.py Fri Feb 26 11:06:48 2010 -0500 @@ -2,6 +2,7 @@ import pickle from datetime import datetime +from webob import _UTC class PickleComments(object): # TODO: locking @@ -13,7 +14,13 @@ f.close() def comment(self, uri, **kw): - kw['date'] = datetime.now() + now = datetime.utcnow() + now.replace(tzinfo=_UTC()) + + # tzinfo crap +# now = datetime(*list(now.utctimetuple()[:-1]) + [_UTC()]) + + kw['date'] = now f = file(self.database) comments = pickle.load(f) f.close()