@@ -1065,10 +1065,12 @@ def unserialise(self, classname, node):
10651065 """
10661066 return node
10671067
1068- def getnode (self , classname , nodeid ):
1068+ def getnode (self , classname , nodeid , allow_abort = True ):
10691069 """Get a node from the database.
10701070
10711071 'cache' exists for backwards compatibility, and is not used.
1072+ 'allow_abort' determines if we allow that the current
1073+ transaction is aborted due to a data error (e.g. invalid nodeid).
10721074 """
10731075 raise NotImplementedError
10741076
@@ -1235,14 +1237,16 @@ def create(self, **propvalues):
12351237 """
12361238 raise NotImplementedError
12371239
1238- def get (self , nodeid , propname , default = _marker , cache = 1 ):
1240+ def get (self , nodeid , propname , default = _marker , cache = 1 , allow_abort = True ):
12391241 """Get the value of a property on an existing node of this class.
12401242
12411243 'nodeid' must be the id of an existing node of this class or an
12421244 IndexError is raised. 'propname' must be the name of a property
12431245 of this class or a KeyError is raised.
12441246
12451247 'cache' exists for backwards compatibility, and is not used.
1248+ 'allow_abort' determines if we allow that the current
1249+ transaction is aborted due to a data error (e.g. invalid nodeid).
12461250 """
12471251 raise NotImplementedError
12481252
@@ -1300,8 +1304,10 @@ def restore(self, nodeid):
13001304 """
13011305 raise NotImplementedError
13021306
1303- def is_retired (self , nodeid ):
1307+ def is_retired (self , nodeid , allow_abort = True ):
13041308 """Return true if the node is rerired
1309+ 'allow_abort' specifies if we allow the transaction to be
1310+ aborted if a syntactically invalid nodeid is passed.
13051311 """
13061312 raise NotImplementedError
13071313
@@ -2182,10 +2188,13 @@ def export_files(self, dirname, nodeid):
21822188 ensureParentsExist (dest )
21832189 shutil .copyfile (source , dest )
21842190
2185- def get (self , nodeid , propname , default = _marker , cache = 1 ):
2191+ def get (self , nodeid , propname , default = _marker , cache = 1 , allow_abort = True ):
21862192 """ Trap the content propname and get it from the file
21872193
21882194 'cache' exists for backwards compatibility, and is not used.
2195+
2196+ 'allow_abort' determines if we allow that the current
2197+ transaction is aborted due to a data error (e.g. invalid nodeid).
21892198 """
21902199 poss_msg = 'Possibly an access right configuration problem.'
21912200 if propname == 'content' :
@@ -2212,9 +2221,11 @@ def get(self, nodeid, propname, default=_marker, cache=1):
22122221 return self .db .getfile (self .classname , nodeid , None )
22132222
22142223 if default is not _marker :
2215- return self .subclass .get (self , nodeid , propname , default )
2224+ return self .subclass .get (self , nodeid , propname , default ,
2225+ allow_abort = allow_abort )
22162226 else :
2217- return self .subclass .get (self , nodeid , propname )
2227+ return self .subclass .get (self , nodeid , propname ,
2228+ allow_abort = allow_abort )
22182229
22192230 def import_files (self , dirname , nodeid ):
22202231 """ Import the "content" property as a file
0 commit comments