equal
deleted
inserted
replaced
312 self._finalizecallback[category] = callback |
312 self._finalizecallback[category] = callback |
313 |
313 |
314 @active |
314 @active |
315 def addpostclose(self, category, callback): |
315 def addpostclose(self, category, callback): |
316 """add a callback to be called after the transaction is closed |
316 """add a callback to be called after the transaction is closed |
|
317 |
|
318 The transaction will be given as callback's first argument. |
317 |
319 |
318 Category is a unique identifier to allow overwriting an old callback |
320 Category is a unique identifier to allow overwriting an old callback |
319 with a newer callback. |
321 with a newer callback. |
320 """ |
322 """ |
321 self._postclosecallback[category] = callback |
323 self._postclosecallback[category] = callback |
348 self._backupentries = [] |
350 self._backupentries = [] |
349 self.journal = None |
351 self.journal = None |
350 # run post close action |
352 # run post close action |
351 categories = sorted(self._postclosecallback) |
353 categories = sorted(self._postclosecallback) |
352 for cat in categories: |
354 for cat in categories: |
353 self._postclosecallback[cat]() |
355 self._postclosecallback[cat](self) |
354 |
356 |
355 @active |
357 @active |
356 def abort(self): |
358 def abort(self): |
357 '''abort the transaction (generally called on error, or when the |
359 '''abort the transaction (generally called on error, or when the |
358 transaction is not explicitly committed before going out of |
360 transaction is not explicitly committed before going out of |