Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 1133:36ec30d286ea
Cleaned up CHANGES/TODO
Added try/finally to enforce db.close()
Changed default classic issue item display to only show message summary
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 13 Sep 2002 00:08:44 +0000 |
| parents | 89bd02ffe4af |
| children | db13f46cb5f9 |
comparison
equal
deleted
inserted
replaced
| 1132:77581d5309f2 | 1133:36ec30d286ea |
|---|---|
| 1 # $Id: client.py,v 1.31 2002-09-12 07:00:41 richard Exp $ | 1 # $Id: client.py,v 1.32 2002-09-13 00:08:44 richard Exp $ |
| 2 | 2 |
| 3 __doc__ = """ | 3 __doc__ = """ |
| 4 WWW request handler (also used in the stand-alone server). | 4 WWW request handler (also used in the stand-alone server). |
| 5 """ | 5 """ |
| 6 | 6 |
| 103 # before the first write | 103 # before the first write |
| 104 self.additional_headers = {} | 104 self.additional_headers = {} |
| 105 self.response_code = 200 | 105 self.response_code = 200 |
| 106 | 106 |
| 107 def main(self): | 107 def main(self): |
| 108 ''' Wrap the real main in a try/finally so we always close off the db. | |
| 109 ''' | |
| 110 try: | |
| 111 self.inner_main() | |
| 112 finally: | |
| 113 if hasattr(self, 'db'): | |
| 114 self.db.close() | |
| 115 | |
| 116 def inner_main(self): | |
| 108 ''' Process a request. | 117 ''' Process a request. |
| 109 | 118 |
| 110 The most common requests are handled like so: | 119 The most common requests are handled like so: |
| 111 1. figure out who we are, defaulting to the "anonymous" user | 120 1. figure out who we are, defaulting to the "anonymous" user |
| 112 see determine_user | 121 see determine_user |
