comparison roundup/hyperdb.py @ 460:9c895b44240a

take a copy of the node dict... so that the subsequent set operation doesn't modify the oldvalues structure
author Richard Jones <richard@users.sourceforge.net>
date Sun, 16 Dec 2001 10:53:38 +0000
parents 6abdddc506e9
children a3548136f7bb
comparison
equal deleted inserted replaced
459:65a8f4fd5485 460:9c895b44240a
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: hyperdb.py,v 1.41 2001-12-15 23:47:47 richard Exp $ 18 # $Id: hyperdb.py,v 1.42 2001-12-16 10:53:37 richard Exp $
19 19
20 __doc__ = """ 20 __doc__ = """
21 Hyperdatabase implementation, especially field types. 21 Hyperdatabase implementation, especially field types.
22 """ 22 """
23 23
842 if self.__dict__.has_key(name): 842 if self.__dict__.has_key(name):
843 return self.__dict__[name] 843 return self.__dict__[name]
844 try: 844 try:
845 return self.cl.get(self.nodeid, name) 845 return self.cl.get(self.nodeid, name)
846 except KeyError, value: 846 except KeyError, value:
847 raise AttributeError, str(value) 847 # we trap this but re-raise it as AttributeError - all other
848 # exceptions should pass through untrapped
849 pass
850 # nope, no such attribute
851 raise AttributeError, str(value)
848 def __getitem__(self, name): 852 def __getitem__(self, name):
849 return self.cl.get(self.nodeid, name) 853 return self.cl.get(self.nodeid, name)
850 def __setattr__(self, name, value): 854 def __setattr__(self, name, value):
851 try: 855 try:
852 return self.cl.set(self.nodeid, **{name: value}) 856 return self.cl.set(self.nodeid, **{name: value})
866 cl.create(name=option[i], order=i) 870 cl.create(name=option[i], order=i)
867 return hyperdb.Link(name) 871 return hyperdb.Link(name)
868 872
869 # 873 #
870 # $Log: not supported by cvs2svn $ 874 # $Log: not supported by cvs2svn $
875 # Revision 1.41 2001/12/15 23:47:47 richard
876 # Cleaned up some bare except statements
877 #
871 # Revision 1.40 2001/12/14 23:42:57 richard 878 # Revision 1.40 2001/12/14 23:42:57 richard
872 # yuck, a gdbm instance tests false :( 879 # yuck, a gdbm instance tests false :(
873 # I've left the debugging code in - it should be removed one day if we're ever 880 # I've left the debugging code in - it should be removed one day if we're ever
874 # _really_ anal about performace :) 881 # _really_ anal about performace :)
875 # 882 #

Roundup Issue Tracker: http://roundup-tracker.org/