Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 2032:5a7ec0c63095
fixes to some unit tests, and a cleanup
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 20 Feb 2004 03:48:16 +0000 |
| parents | 8fab5d394f22 |
| children | d124af927369 |
comparison
equal
deleted
inserted
replaced
| 2031:bcb21e5722b8 | 2032:5a7ec0c63095 |
|---|---|
| 1 # $Id: client.py,v 1.161 2004-02-15 10:08:20 jlgijsbers Exp $ | 1 # $Id: client.py,v 1.162 2004-02-20 03:48:16 richard Exp $ |
| 2 | 2 |
| 3 """WWW request handler (also used in the stand-alone server). | 3 """WWW request handler (also used in the stand-alone server). |
| 4 """ | 4 """ |
| 5 __docformat__ = 'restructuredtext' | 5 __docformat__ = 'restructuredtext' |
| 6 | 6 |
| 237 # everything else | 237 # everything else |
| 238 self.write(cgitb.html()) | 238 self.write(cgitb.html()) |
| 239 | 239 |
| 240 def clean_sessions(self): | 240 def clean_sessions(self): |
| 241 """Age sessions, remove when they haven't been used for a week. | 241 """Age sessions, remove when they haven't been used for a week. |
| 242 | 242 |
| 243 Do it only once an hour. | 243 Do it only once an hour. |
| 244 | 244 |
| 245 Note: also cleans One Time Keys, and other "session" based stuff. | 245 Note: also cleans One Time Keys, and other "session" based stuff. |
| 246 """ | 246 """ |
| 247 sessions = self.db.sessions | 247 sessions = self.db.sessions |
| 556 # call the mapped action | 556 # call the mapped action |
| 557 if isinstance(action_klass, type('')): | 557 if isinstance(action_klass, type('')): |
| 558 # old way of specifying actions | 558 # old way of specifying actions |
| 559 getattr(self, action_klass)() | 559 getattr(self, action_klass)() |
| 560 else: | 560 else: |
| 561 action_klass(self).handle() | 561 action_klass(self).execute() |
| 562 | 562 |
| 563 except ValueError, err: | 563 except ValueError, err: |
| 564 self.error_message.append(str(err)) | 564 self.error_message.append(str(err)) |
| 565 | 565 |
| 566 def write(self, content): | 566 def write(self, content): |
| 567 if not self.headers_done: | 567 if not self.headers_done: |
