From 43bdfbbba5efdc15b39d65b3971e9c1a7c4fc6da Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 12 Mar 2002 22:52:26 +0000 Subject: [PATCH] more pychecker warnings removed git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@669 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi_client.py | 11 ++++++++--- roundup/hyperdb.py | 20 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index aeb5fd6..a79f86a 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -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 @@ class Client: 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 @@ def parsePropsFromForm(db, cl, form, nodeid=0): # # $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! # diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index 9aa575a..3d3c97b 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -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 @@ DEBUG = os.environ.get('HYPERDBDEBUG', '') 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 @@ class Multilink: '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 @@ class Class: db.addclass(self) def __repr__(self): + '''Slightly more useful representation + ''' return ''%self.classname # Editing nodes: @@ -1025,7 +1039,6 @@ class Class: raise ValueError, key self.properties.update(properties) - # XXX not in spec class Node: ''' A convenience wrapper for the given node @@ -1084,6 +1097,9 @@ def Choice(name, db, *options): # # $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 # -- 2.30.2