1- # $Id: roundupdb.py,v 1.6 2001-07-30 00:05:54 richard Exp $
1+ # $Id: roundupdb.py,v 1.7 2001-07-30 02:38:31 richard Exp $
22
33import re , os , smtplib , socket
44
@@ -27,6 +27,7 @@ def uidFromAddress(self, address):
2727 return self .user .create (username = address , address = address ,
2828 realname = realname )
2929
30+ _marker = []
3031# XXX: added the 'creator' faked attribute
3132class Class (hyperdb .Class ):
3233 # Overridden methods:
@@ -71,9 +72,9 @@ def retire(self, nodeid):
7172 for react in self .reactors ['retire' ]:
7273 react (self .db , self , nodeid , None )
7374
74- def get (self , nodeid , propname ):
75+ def get (self , nodeid , propname , default = _marker ):
7576 """Attempts to get the "creation" or "activity" properties should
76- do the right thing
77+ do the right thing.
7778 """
7879 if propname == 'creation' :
7980 journal = self .db .getjournal (self .classname , nodeid )
@@ -96,7 +97,10 @@ def get(self, nodeid, propname):
9697 else :
9798 return None
9899 return self .db .user .lookup (name )
99- return hyperdb .Class .get (self , nodeid , propname )
100+ if default is not _marker :
101+ return hyperdb .Class .get (self , nodeid , propname , default )
102+ else :
103+ return hyperdb .Class .get (self , nodeid , propname )
100104
101105 def getprops (self ):
102106 """In addition to the actual properties on the node, these
@@ -145,12 +149,15 @@ def getcontent(self, classname, nodeid):
145149 '''
146150 return open (self .filename (classname , nodeid ), 'rb' ).read ()
147151
148- def get (self , nodeid , propname ):
152+ def get (self , nodeid , propname , default = _marker ):
149153 ''' trap the content propname and get it from the file
150154 '''
151155 if propname == 'content' :
152156 return self .getcontent (self .classname , nodeid )
153- return Class .get (self , nodeid , propname )
157+ if default is not _marker :
158+ return Class .get (self , nodeid , propname , default )
159+ else :
160+ return Class .get (self , nodeid , propname )
154161
155162 def getprops (self ):
156163 ''' In addition to the actual properties on the node, these methods
@@ -247,6 +254,10 @@ def sendmessage(self, nodeid, msgid):
247254
248255#
249256# $Log: not supported by cvs2svn $
257+ # Revision 1.6 2001/07/30 00:05:54 richard
258+ # Fixed IssueClass so that superseders links to its classname rather than
259+ # hard-coded to "issue".
260+ #
250261# Revision 1.5 2001/07/29 07:01:39 richard
251262# Added vim command to all source so that we don't get no steenkin' tabs :)
252263#
0 commit comments