summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a4c5677)
raw | patch | inline | side by side (parent: a4c5677)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 16 Dec 2001 10:53:38 +0000 (10:53 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 16 Dec 2001 10:53:38 +0000 (10:53 +0000) |
operation doesn't modify the oldvalues structure
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@472 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@472 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_anydbm.py | patch | blob | history | |
roundup/hyperdb.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
index 219eb7c3b08608f5ce59d1d8d5d205cdcbd59faa..b11a461513e5fe6a29b1a9dd89a674f4e0164038 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.17 2001-12-14 23:42:57 richard Exp $
+#$Id: back_anydbm.py,v 1.18 2001-12-16 10:53:38 richard Exp $
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
self.transactions.append((self._doSaveNode, (classname, nodeid, node)))
def getnode(self, classname, nodeid, db=None):
- ''' add the specified node to its class's db
+ ''' get a node from the database
'''
if DEBUG:
print 'getnode', (self, classname, nodeid, cldb)
return res
def hasnode(self, classname, nodeid, db=None):
- ''' add the specified node to its class's db
+ ''' determine if the database has a given node
'''
if DEBUG:
print 'hasnode', (self, classname, nodeid, cldb)
#
#$Log: not supported by cvs2svn $
+#Revision 1.17 2001/12/14 23:42:57 richard
+#yuck, a gdbm instance tests false :(
+#I've left the debugging code in - it should be removed one day if we're ever
+#_really_ anal about performace :)
+#
#Revision 1.16 2001/12/12 03:23:14 richard
#Cor blimey this anydbm/whichdb stuff is yecchy. Turns out that whichdb
#incorrectly identifies a dbm file as a dbhash file on my system. This has
diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py
index b44e399068a4b3c3faf5dce2b8da46c33615d085..88376f27640e89d66bbf3e71633a40edd5334128 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: hyperdb.py,v 1.41 2001-12-15 23:47:47 richard Exp $
+# $Id: hyperdb.py,v 1.42 2001-12-16 10:53:37 richard Exp $
__doc__ = """
Hyperdatabase implementation, especially field types.
try:
return self.cl.get(self.nodeid, name)
except KeyError, value:
- raise AttributeError, str(value)
+ # we trap this but re-raise it as AttributeError - all other
+ # exceptions should pass through untrapped
+ pass
+ # nope, no such attribute
+ raise AttributeError, str(value)
def __getitem__(self, name):
return self.cl.get(self.nodeid, name)
def __setattr__(self, name, value):
#
# $Log: not supported by cvs2svn $
+# Revision 1.41 2001/12/15 23:47:47 richard
+# Cleaned up some bare except statements
+#
# Revision 1.40 2001/12/14 23:42:57 richard
# yuck, a gdbm instance tests false :(
# I've left the debugging code in - it should be removed one day if we're ever
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index e6c3e8871a25d14f55d0d818ad23777e582f040e..f57139ed49d33716f6779915d051773325dc5a58 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.32 2001-12-15 23:48:35 richard Exp $
+# $Id: roundupdb.py,v 1.33 2001-12-16 10:53:37 richard Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
"""
-import re, os, smtplib, socket
+import re, os, smtplib, socket, copy
import mimetools, MimeWriter, cStringIO
import base64, mimetypes
raise KeyError, '"creation" and "activity" are reserved'
for audit in self.auditors['set']:
audit(self.db, self, nodeid, propvalues)
- oldvalues = self.db.getnode(self.classname, nodeid)
+ # take a copy of the node dict so that the subsequent set
+ # operation doesn't modify the oldvalues structure
+ oldvalues = copy.deepcopy(self.db.getnode(self.classname, nodeid))
hyperdb.Class.set(self, nodeid, **propvalues)
for react in self.reactors['set']:
react(self.db, self, nodeid, oldvalues)
#
# $Log: not supported by cvs2svn $
+# Revision 1.32 2001/12/15 23:48:35 richard
+# Added ROUNDUPDBSENDMAILDEBUG so one can test the sendmail method without
+# actually sending mail :)
+#
# Revision 1.31 2001/12/15 19:24:39 rochecompaan
# . Modified cgi interface to change properties only once all changes are
# collected, files created and messages generated.