1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: hyperdb.py,v 1.87 2003-03-17 22:03:03 kedder Exp $
18+ # $Id: hyperdb.py,v 1.87.2.1 2003-09-04 23:09:48 richard Exp $
1919
2020"""
2121Hyperdatabase implementation, especially field types.
@@ -245,6 +245,8 @@ def unserialise(self, classname, node):
245245
246246 def getnode (self , classname , nodeid , db = None , cache = 1 ):
247247 '''Get a node from the database.
248+
249+ 'cache' exists for backwards compatibility, and is not used.
248250 '''
249251 raise NotImplementedError
250252
@@ -365,10 +367,7 @@ def get(self, nodeid, propname, default=_marker, cache=1):
365367 IndexError is raised. 'propname' must be the name of a property
366368 of this class or a KeyError is raised.
367369
368- 'cache' indicates whether the transaction cache should be queried
369- for the node. If the node has been modified and you need to
370- determine what its values prior to modification are, you need to
371- set cache=0.
370+ 'cache' exists for backwards compatibility, and is not used.
372371 """
373372 raise NotImplementedError
374373
@@ -378,12 +377,9 @@ def getnode(self, nodeid, cache=1):
378377 'nodeid' must be the id of an existing node of this class or an
379378 IndexError is raised.
380379
381- 'cache' indicates whether the transaction cache should be queried
382- for the node. If the node has been modified and you need to
383- determine what its values prior to modification are, you need to
384- set cache=0.
380+ 'cache' exists for backwards compatibility, and is not used.
385381 '''
386- return Node (self , nodeid , cache = cache )
382+ return Node (self , nodeid )
387383
388384 def set (self , nodeid , ** propvalues ):
389385 """Modify a property on an existing node of this class.
@@ -580,18 +576,17 @@ class Node:
580576 def __init__ (self , cl , nodeid , cache = 1 ):
581577 self .__dict__ ['cl' ] = cl
582578 self .__dict__ ['nodeid' ] = nodeid
583- self .__dict__ ['cache' ] = cache
584579 def keys (self , protected = 1 ):
585580 return self .cl .getprops (protected = protected ).keys ()
586581 def values (self , protected = 1 ):
587582 l = []
588583 for name in self .cl .getprops (protected = protected ).keys ():
589- l .append (self .cl .get (self .nodeid , name , cache = self . cache ))
584+ l .append (self .cl .get (self .nodeid , name ))
590585 return l
591586 def items (self , protected = 1 ):
592587 l = []
593588 for name in self .cl .getprops (protected = protected ).keys ():
594- l .append ((name , self .cl .get (self .nodeid , name , cache = self . cache )))
589+ l .append ((name , self .cl .get (self .nodeid , name )))
595590 return l
596591 def has_key (self , name ):
597592 return self .cl .getprops ().has_key (name )
@@ -604,15 +599,15 @@ def __getattr__(self, name):
604599 if self .__dict__ .has_key (name ):
605600 return self .__dict__ [name ]
606601 try :
607- return self .cl .get (self .nodeid , name , cache = self . cache )
602+ return self .cl .get (self .nodeid , name )
608603 except KeyError , value :
609604 # we trap this but re-raise it as AttributeError - all other
610605 # exceptions should pass through untrapped
611606 pass
612607 # nope, no such attribute
613608 raise AttributeError , str (value )
614609 def __getitem__ (self , name ):
615- return self .cl .get (self .nodeid , name , cache = self . cache )
610+ return self .cl .get (self .nodeid , name )
616611 def __setattr__ (self , name , value ):
617612 try :
618613 return self .cl .set (self .nodeid , ** {name : value })
0 commit comments