Skip to content

Commit 3f2e106

Browse files
author
Richard Jones
committed
more pychecker warnings removed
1 parent 9b7e0da commit 3f2e106

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

roundup/cgi_client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.111 2002-02-25 04:32:21 richard Exp $
18+
# $Id: cgi_client.py,v 1.112 2002-03-12 22:52:26 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
2222
"""
2323

24-
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
24+
import os, cgi, StringIO, urlparse, re, traceback, mimetypes
2525
import binascii, Cookie, time, random
2626

2727
import roundupdb, htmltemplate, date, hyperdb, password
@@ -74,9 +74,11 @@ def __init__(self, instance, request, env, form=None):
7474
def getuid(self):
7575
return self.db.user.lookup(self.user)
7676

77-
def header(self, headers={'Content-Type':'text/html'}):
77+
def header(self, headers=None):
7878
'''Put up the appropriate header.
7979
'''
80+
if headers is None:
81+
headers = {'Content-Type':'text/html'}
8082
if not headers.has_key('Content-Type'):
8183
headers['Content-Type'] = 'text/html'
8284
self.request.send_response(200)
@@ -1325,6 +1327,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
13251327

13261328
#
13271329
# $Log: not supported by cvs2svn $
1330+
# Revision 1.111 2002/02/25 04:32:21 richard
1331+
# ahem
1332+
#
13281333
# Revision 1.110 2002/02/21 07:19:08 richard
13291334
# ... and label, width and height control for extra flavour!
13301335
#

roundup/hyperdb.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.58 2002-02-27 03:23:16 richard Exp $
18+
# $Id: hyperdb.py,v 1.59 2002-03-12 22:52:26 richard Exp $
1919

2020
__doc__ = """
2121
Hyperdatabase implementation, especially field types.
@@ -35,30 +35,37 @@
3535
class String:
3636
"""An object designating a String property."""
3737
def __repr__(self):
38+
' more useful for dumps '
3839
return '<%s>'%self.__class__
3940

4041
class Password:
4142
"""An object designating a Password property."""
4243
def __repr__(self):
44+
' more useful for dumps '
4345
return '<%s>'%self.__class__
4446

4547
class Date:
4648
"""An object designating a Date property."""
4749
def __repr__(self):
50+
' more useful for dumps '
4851
return '<%s>'%self.__class__
4952

5053
class Interval:
5154
"""An object designating an Interval property."""
5255
def __repr__(self):
56+
' more useful for dumps '
5357
return '<%s>'%self.__class__
5458

5559
class Link:
5660
"""An object designating a Link property that links to a
5761
node in a specified class."""
5862
def __init__(self, classname, do_journal='no'):
63+
''' Default is to not journal link and unlink events
64+
'''
5965
self.classname = classname
6066
self.do_journal = do_journal == 'yes'
6167
def __repr__(self):
68+
' more useful for dumps '
6269
return '<%s to "%s">'%(self.__class__, self.classname)
6370

6471
class Multilink:
@@ -71,12 +78,17 @@ class Multilink:
7178
'link' and 'unlink' events placed in their journal
7279
"""
7380
def __init__(self, classname, do_journal='no'):
81+
''' Default is to not journal link and unlink events
82+
'''
7483
self.classname = classname
7584
self.do_journal = do_journal == 'yes'
7685
def __repr__(self):
86+
' more useful for dumps '
7787
return '<%s to "%s">'%(self.__class__, self.classname)
7888

7989
class DatabaseError(ValueError):
90+
'''Error to be raised when there is some problem in the database code
91+
'''
8092
pass
8193

8294

@@ -256,6 +268,8 @@ def __init__(self, db, classname, **properties):
256268
db.addclass(self)
257269

258270
def __repr__(self):
271+
'''Slightly more useful representation
272+
'''
259273
return '<hypderdb.Class "%s">'%self.classname
260274

261275
# Editing nodes:
@@ -1025,7 +1039,6 @@ def addprop(self, **properties):
10251039
raise ValueError, key
10261040
self.properties.update(properties)
10271041

1028-
10291042
# XXX not in spec
10301043
class Node:
10311044
''' A convenience wrapper for the given node
@@ -1084,6 +1097,9 @@ def Choice(name, db, *options):
10841097

10851098
#
10861099
# $Log: not supported by cvs2svn $
1100+
# Revision 1.58 2002/02/27 03:23:16 richard
1101+
# Ran it through pychecker, made fixes
1102+
#
10871103
# Revision 1.57 2002/02/20 05:23:24 richard
10881104
# Didn't accomodate new values for new properties
10891105
#

0 commit comments

Comments
 (0)