equal
deleted
inserted
replaced
327 self._postclosecallback[category] = callback |
327 self._postclosecallback[category] = callback |
328 |
328 |
329 @active |
329 @active |
330 def close(self): |
330 def close(self): |
331 '''commit the transaction''' |
331 '''commit the transaction''' |
332 if self.count == 1 and self.onclose is not None: |
332 if self.count == 1: |
333 self._generatefiles() |
333 self._generatefiles() |
334 categories = sorted(self._finalizecallback) |
334 categories = sorted(self._finalizecallback) |
335 for cat in categories: |
335 for cat in categories: |
336 self._finalizecallback[cat](self) |
336 self._finalizecallback[cat](self) |
337 self.onclose() |
337 if self.onclose is not None: |
|
338 self.onclose() |
338 |
339 |
339 self.count -= 1 |
340 self.count -= 1 |
340 if self.count != 0: |
341 if self.count != 0: |
341 return |
342 return |
342 self.file.close() |
343 self.file.close() |