diff 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
line wrap: on
line diff
--- a/roundup/cgi/client.py	Thu Sep 12 07:41:22 2002 +0000
+++ b/roundup/cgi/client.py	Fri Sep 13 00:08:44 2002 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.31 2002-09-12 07:00:41 richard Exp $
+# $Id: client.py,v 1.32 2002-09-13 00:08:44 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
@@ -105,6 +105,15 @@
         self.response_code = 200
 
     def main(self):
+        ''' Wrap the real main in a try/finally so we always close off the db.
+        '''
+        try:
+            self.inner_main()
+        finally:
+            if hasattr(self, 'db'):
+                self.db.close()
+
+    def inner_main(self):
         ''' Process a request.
 
             The most common requests are handled like so:

Roundup Issue Tracker: http://roundup-tracker.org/