changeset 657:e0a1cc7538e9

more pychecker warnings removed
author Richard Jones <richard@users.sourceforge.net>
date Tue, 12 Mar 2002 22:52:26 +0000
parents eae9b69a0115
children 1409d4d55f92
files roundup/cgi_client.py roundup/hyperdb.py
diffstat 2 files changed, 26 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi_client.py	Tue Mar 12 22:51:47 2002 +0000
+++ b/roundup/cgi_client.py	Tue Mar 12 22:52:26 2002 +0000
@@ -15,13 +15,13 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: cgi_client.py,v 1.111 2002-02-25 04:32:21 richard Exp $
+# $Id: cgi_client.py,v 1.112 2002-03-12 22:52:26 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
 """
 
-import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
+import os, cgi, StringIO, urlparse, re, traceback, mimetypes
 import binascii, Cookie, time, random
 
 import roundupdb, htmltemplate, date, hyperdb, password
@@ -74,9 +74,11 @@
     def getuid(self):
         return self.db.user.lookup(self.user)
 
-    def header(self, headers={'Content-Type':'text/html'}):
+    def header(self, headers=None):
         '''Put up the appropriate header.
         '''
+	if headers is None:
+	    headers = {'Content-Type':'text/html'}
         if not headers.has_key('Content-Type'):
             headers['Content-Type'] = 'text/html'
         self.request.send_response(200)
@@ -1325,6 +1327,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.111  2002/02/25 04:32:21  richard
+# ahem
+#
 # Revision 1.110  2002/02/21 07:19:08  richard
 # ... and label, width and height control for extra flavour!
 #
--- a/roundup/hyperdb.py	Tue Mar 12 22:51:47 2002 +0000
+++ b/roundup/hyperdb.py	Tue Mar 12 22:52:26 2002 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: hyperdb.py,v 1.58 2002-02-27 03:23:16 richard Exp $
+# $Id: hyperdb.py,v 1.59 2002-03-12 22:52:26 richard Exp $
 
 __doc__ = """
 Hyperdatabase implementation, especially field types.
@@ -35,30 +35,37 @@
 class String:
     """An object designating a String property."""
     def __repr__(self):
+        ' more useful for dumps '
         return '<%s>'%self.__class__
 
 class Password:
     """An object designating a Password property."""
     def __repr__(self):
+        ' more useful for dumps '
         return '<%s>'%self.__class__
 
 class Date:
     """An object designating a Date property."""
     def __repr__(self):
+        ' more useful for dumps '
         return '<%s>'%self.__class__
 
 class Interval:
     """An object designating an Interval property."""
     def __repr__(self):
+        ' more useful for dumps '
         return '<%s>'%self.__class__
 
 class Link:
     """An object designating a Link property that links to a
        node in a specified class."""
     def __init__(self, classname, do_journal='no'):
+        ''' Default is to not journal link and unlink events
+        '''
         self.classname = classname
         self.do_journal = do_journal == 'yes'
     def __repr__(self):
+        ' more useful for dumps '
         return '<%s to "%s">'%(self.__class__, self.classname)
 
 class Multilink:
@@ -71,12 +78,17 @@
                     'link' and 'unlink' events placed in their journal
     """
     def __init__(self, classname, do_journal='no'):
+        ''' Default is to not journal link and unlink events
+        '''
         self.classname = classname
         self.do_journal = do_journal == 'yes'
     def __repr__(self):
+        ' more useful for dumps '
         return '<%s to "%s">'%(self.__class__, self.classname)
 
 class DatabaseError(ValueError):
+    '''Error to be raised when there is some problem in the database code
+    '''
     pass
 
 
@@ -256,6 +268,8 @@
         db.addclass(self)
 
     def __repr__(self):
+        '''Slightly more useful representation
+        '''
         return '<hypderdb.Class "%s">'%self.classname
 
     # Editing nodes:
@@ -1025,7 +1039,6 @@
                 raise ValueError, key
         self.properties.update(properties)
 
-
 # XXX not in spec
 class Node:
     ''' A convenience wrapper for the given node
@@ -1084,6 +1097,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.58  2002/02/27 03:23:16  richard
+# Ran it through pychecker, made fixes
+#
 # Revision 1.57  2002/02/20 05:23:24  richard
 # Didn't accomodate new values for new properties
 #

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