diff -r ad0c70fceea9 -r 3bdaee25ec3a src/ztfy/utils/zodb.py --- a/src/ztfy/utils/zodb.py Thu Oct 18 23:44:25 2012 +0200 +++ b/src/ztfy/utils/zodb.py Fri Oct 19 09:56:41 2012 +0200 @@ -41,7 +41,11 @@ class ZEOConnectionInfo(object): - """ZEO connection info""" + """ZEO connection info + + Provides a context manager which directly returns + ZEO connection root + """ implements(IZEOConnection) @@ -87,10 +91,11 @@ def connection(self): return self._connection + # Context management methods def __enter__(self): self._storage, self._db = self.getConnection(get_storage=True) self._connection = self._db.open() - return self + return self._connection.root() def __exit__(self, exc_type, exc_value, traceback): if self._connection is not None: