equal
deleted
inserted
replaced
410 """ |
410 """ |
411 self._finalizecallback[category] = callback |
411 self._finalizecallback[category] = callback |
412 |
412 |
413 @active |
413 @active |
414 def addpostclose(self, category, callback): |
414 def addpostclose(self, category, callback): |
415 """add a callback to be called after the transaction is closed |
415 """add or replace a callback to be called after the transaction closed |
416 |
416 |
417 The transaction will be given as callback's first argument. |
417 The transaction will be given as callback's first argument. |
418 |
418 |
419 Category is a unique identifier to allow overwriting an old callback |
419 Category is a unique identifier to allow overwriting an old callback |
420 with a newer callback. |
420 with a newer callback. |
421 """ |
421 """ |
422 self._postclosecallback[category] = callback |
422 self._postclosecallback[category] = callback |
|
423 |
|
424 @active |
|
425 def getpostclose(self, category): |
|
426 """return a postclose callback added before, or None""" |
|
427 return self._postclosecallback.get(category, None) |
423 |
428 |
424 @active |
429 @active |
425 def addabort(self, category, callback): |
430 def addabort(self, category, callback): |
426 """add a callback to be called when the transaction is aborted. |
431 """add a callback to be called when the transaction is aborted. |
427 |
432 |