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__ = """
2121Hyperdatabase implementation, especially field types.
3535class String :
3636 """An object designating a String property."""
3737 def __repr__ (self ):
38+ ' more useful for dumps '
3839 return '<%s>' % self .__class__
3940
4041class Password :
4142 """An object designating a Password property."""
4243 def __repr__ (self ):
44+ ' more useful for dumps '
4345 return '<%s>' % self .__class__
4446
4547class Date :
4648 """An object designating a Date property."""
4749 def __repr__ (self ):
50+ ' more useful for dumps '
4851 return '<%s>' % self .__class__
4952
5053class Interval :
5154 """An object designating an Interval property."""
5255 def __repr__ (self ):
56+ ' more useful for dumps '
5357 return '<%s>' % self .__class__
5458
5559class 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
6471class 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
7989class 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
10301043class 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