Commit 823b7cb6 authored by Tres Seaver's avatar Tres Seaver

ws

parent 46985225
...@@ -490,6 +490,7 @@ class Transaction(object): ...@@ -490,6 +490,7 @@ class Transaction(object):
# TODO: We need a better name for the adapters. # TODO: We need a better name for the adapters.
class MultiObjectResourceAdapter(object): class MultiObjectResourceAdapter(object):
"""Adapt the old-style register() call to the new-style join(). """Adapt the old-style register() call to the new-style join().
...@@ -497,7 +498,6 @@ class MultiObjectResourceAdapter(object): ...@@ -497,7 +498,6 @@ class MultiObjectResourceAdapter(object):
the transaction manager. With register(), an individual object the transaction manager. With register(), an individual object
is passed to register(). is passed to register().
""" """
def __init__(self, jar): def __init__(self, jar):
self.manager = jar self.manager = jar
self.objects = [] self.objects = []
...@@ -548,6 +548,7 @@ class MultiObjectResourceAdapter(object): ...@@ -548,6 +548,7 @@ class MultiObjectResourceAdapter(object):
finally: finally:
del t, v, tb del t, v, tb
def rm_key(rm): def rm_key(rm):
func = getattr(rm, 'sortKey', None) func = getattr(rm, 'sortKey', None)
if func is not None: if func is not None:
...@@ -581,6 +582,7 @@ def oid_repr(oid): ...@@ -581,6 +582,7 @@ def oid_repr(oid):
else: else:
return repr(oid) return repr(oid)
# TODO: deprecate for 3.6. # TODO: deprecate for 3.6.
class DataManagerAdapter(object): class DataManagerAdapter(object):
"""Adapt zodb 4-style data managers to zodb3 style """Adapt zodb 4-style data managers to zodb3 style
...@@ -624,6 +626,7 @@ class DataManagerAdapter(object): ...@@ -624,6 +626,7 @@ class DataManagerAdapter(object):
def sortKey(self): def sortKey(self):
return self._datamanager.sortKey() return self._datamanager.sortKey()
@implementer(interfaces.ISavepoint) @implementer(interfaces.ISavepoint)
class Savepoint: class Savepoint:
"""Transaction savepoint. """Transaction savepoint.
...@@ -666,6 +669,7 @@ class Savepoint: ...@@ -666,6 +669,7 @@ class Savepoint:
# Mark the transaction as failed. # Mark the transaction as failed.
transaction._saveAndRaiseCommitishError() # reraises! transaction._saveAndRaiseCommitishError() # reraises!
class AbortSavepoint: class AbortSavepoint:
def __init__(self, datamanager, transaction): def __init__(self, datamanager, transaction):
...@@ -676,6 +680,7 @@ class AbortSavepoint: ...@@ -676,6 +680,7 @@ class AbortSavepoint:
self.datamanager.abort(self.transaction) self.datamanager.abort(self.transaction)
self.transaction._unjoin(self.datamanager) self.transaction._unjoin(self.datamanager)
class NoRollbackSavepoint: class NoRollbackSavepoint:
def __init__(self, datamanager): def __init__(self, datamanager):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment