[Zope3-checkins] SVN: Zope3/trunk/ get_transaction() is officially
deprecated in ZODB 3.4.
Tim Peters
tim.one at comcast.net
Mon Mar 28 14:26:23 EST 2005
Log message for revision 29703:
get_transaction() is officially deprecated in ZODB 3.4.
Got rid of it in the Zope source. The remaining instances are in
code stitched in from ZODB. Those will go away by magic when
ZODB 3.4 gets stitched in.
Changed:
U Zope3/trunk/doc/FTEST.txt
U Zope3/trunk/ft.py
U Zope3/trunk/src/zodbcode/tests/test_class.py
U Zope3/trunk/src/zodbcode/tests/test_module.py
U Zope3/trunk/src/zope/app/appsetup/bootstrap.py
U Zope3/trunk/src/zope/app/appsetup/tests.py
U Zope3/trunk/src/zope/app/component/tests/test_adapter.py
U Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py
U Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py
U Zope3/trunk/src/zope/app/container/tests/test_contained.py
U Zope3/trunk/src/zope/app/dav/ftests/dav.py
U Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py
U Zope3/trunk/src/zope/app/dav/tests/test_proppatch.py
U Zope3/trunk/src/zope/app/error/bootstrap.py
U Zope3/trunk/src/zope/app/file/file.py
U Zope3/trunk/src/zope/app/form/browser/editview.py
U Zope3/trunk/src/zope/app/form/browser/formview.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
U Zope3/trunk/src/zope/app/fssync/browser/__init__.py
U Zope3/trunk/src/zope/app/generations/browser/managers.py
U Zope3/trunk/src/zope/app/interface/tests/test_interface.py
U Zope3/trunk/src/zope/app/mail/delivery.py
U Zope3/trunk/src/zope/app/mail/tests/test_delivery.py
U Zope3/trunk/src/zope/app/module/README.txt
U Zope3/trunk/src/zope/app/observable/observable.txt
U Zope3/trunk/src/zope/app/principalannotation/bootstrap.py
U Zope3/trunk/src/zope/app/publication/tests/test_browserpublication.py
U Zope3/trunk/src/zope/app/publication/tests/test_zopepublication.py
U Zope3/trunk/src/zope/app/publication/zopepublication.py
U Zope3/trunk/src/zope/app/rdb/__init__.py
U Zope3/trunk/src/zope/app/rdb/tests/test_zopeconnection.py
U Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py
U Zope3/trunk/src/zope/app/session/bootstrap.py
U Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py
U Zope3/trunk/src/zope/app/undo/__init__.py
U Zope3/trunk/src/zope/app/undo/tests/test_zodbundomanager.py
U Zope3/trunk/src/zope/index/text/tests/indexhtml.py
U Zope3/trunk/src/zope/index/text/tests/mhindex.py
-=-
Modified: Zope3/trunk/doc/FTEST.txt
===================================================================
--- Zope3/trunk/doc/FTEST.txt 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/doc/FTEST.txt 2005-03-28 19:26:23 UTC (rev 29703)
@@ -71,8 +71,8 @@
self.getRootFolder() available to an emulated request, make sure to commit
the transaction. Here's how you do it::
- from transaction import get_transaction
- get_transaction().commit()
+ import transaction
+ transaction.commit()
- Functional tests should not change any global registries. In particular,
functional unit test cases should not inherit from
Modified: Zope3/trunk/ft.py
===================================================================
--- Zope3/trunk/ft.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/ft.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -40,8 +40,8 @@
#
# If you add something to the root folder or in general change
# anything in the ZODB, you might need to perform a
- # from zope.transaction import get_transaction
- # get_transaction().commit()
+ # import transaction
+ # transaction.commit()
# for those changes to become visible to the publisher.
def tearDown(self):
Modified: Zope3/trunk/src/zodbcode/tests/test_class.py
===================================================================
--- Zope3/trunk/src/zodbcode/tests/test_class.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zodbcode/tests/test_class.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -15,7 +15,7 @@
from zodbcode.tests.test_module import TestBase
-from transaction import get_transaction
+import transaction
from persistent.cPersistence import CHANGED, UPTODATE
class TestClass(TestBase):
@@ -51,7 +51,7 @@
def testClassWithInit(self):
self.registry.newModule("testclass", self.class_with_init)
- get_transaction().commit()
+ transaction.commit()
import testclass
x = testclass.Foo(12)
self.assertEqual(x.var, 12)
@@ -75,7 +75,7 @@
def testClassAndInstance(self):
self.registry.newModule("testclass", self.class_and_instance)
- get_transaction().commit()
+ transaction.commit()
import testclass
self.assertEqual(testclass.x.var, 12)
@@ -98,7 +98,7 @@
# this doesn't do a proper zope interface, but we're really
# only concerned about handling of the __implements__ attribute.
self.registry.newModule("testclass", self.class_interface)
- get_transaction().commit()
+ transaction.commit()
import testclass
obj = testclass.Foo()
self.assertEqual(obj.__implements__, 1)
@@ -107,9 +107,9 @@
def testCrossModuleImport(self):
self.registry.newModule("testclass", self.class_with_init)
- get_transaction().commit()
+ transaction.commit()
self.registry.newModule("another", self.cross_module_import)
- get_transaction().commit()
+ transaction.commit()
update_in_place1 = """class Foo:
def meth(self, arg):
@@ -121,7 +121,7 @@
def testUpdateInPlace(self):
self.registry.newModule("testclass", self.update_in_place1)
- get_transaction().commit()
+ transaction.commit()
import testclass
inst = testclass.Foo()
self.assertEqual(inst.meth(4), 12)
@@ -131,7 +131,7 @@
self.assertEqual(inst2.meth(4), 12)
self.registry.updateModule("testclass", self.update_in_place2)
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(inst.meth(4), 7)
# The old instance's connection hasn't processed the
@@ -159,11 +159,11 @@
def testInheritanceAcrossModules(self):
self.registry.newModule("parent", self.parent1)
self.registry.newModule("child", self.child)
- get_transaction().commit()
+ transaction.commit()
import child
self.assertEqual(child.Bar().meth(3), 3*2+5)
self.registry.updateModule("parent", self.parent2)
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(child.Bar().meth(3), 3//2+5)
Bar = self._load_name("child.Bar")
@@ -175,7 +175,7 @@
def testPersistentSubclass(self):
self.registry.newModule("persist", self.persist)
- get_transaction().commit()
+ transaction.commit()
import persist
# Verify that the instances are persistent and that the
# _p_ namespace is separate.
@@ -192,19 +192,19 @@
def testSavePersistentSubclass(self):
self.registry.newModule("persist", self.persist)
- get_transaction().commit()
+ transaction.commit()
import persist
self.registry.newModule("save_persist", self.save_persist)
- get_transaction().commit()
+ transaction.commit()
import save_persist
def XXXtestUpdateClassAttribute(self):
self.registry.newModule("parent", self.parent1)
- get_transaction().commit()
+ transaction.commit()
import parent
parent.Foo.attr = 2
self.assertEqual(parent.Foo._p_state, CHANGED)
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(parent.Foo._p_state, UPTODATE)
Foo = self._load_name("parent.Foo")
Modified: Zope3/trunk/src/zodbcode/tests/test_module.py
===================================================================
--- Zope3/trunk/src/zodbcode/tests/test_module.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zodbcode/tests/test_module.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
from persistent.dict import PersistentDict
from persistent import UPTODATE
-from transaction import get_transaction
+import transaction
import ZODB.tests.util
from zodbcode import tests # import this package, to get at __file__ reliably
@@ -92,14 +92,14 @@
self.importer = TestPersistentModuleImporter(self.registry)
self.importer.install()
self.root["registry"] = self.registry
- get_transaction().commit()
+ transaction.commit()
_dir, _file = os.path.split(tests.__file__)
self._pmtest = os.path.join(_dir, "_pmtest.py")
def tearDown(self):
self.importer.uninstall()
# just in case
- get_transaction().abort()
+ transaction.abort()
self.db.close()
def sameModules(self, registry):
@@ -126,14 +126,14 @@
# modified. need to figure out what is going wrong, but for
# now just abort the transaction.
##assert not cn._registered
- get_transaction().abort()
+ transaction.abort()
cn.close()
class TestModule(TestBase):
def testModule(self):
self.registry.newModule("pmtest", open(self._pmtest).read())
- get_transaction().commit()
+ transaction.commit()
self.assert_(self.registry.findModule("pmtest"))
import pmtest
pmtest._p_deactivate()
@@ -143,12 +143,12 @@
def testUpdateFunction(self):
self.registry.newModule("pmtest", "def f(x): return x")
- get_transaction().commit()
+ transaction.commit()
import pmtest
self.assertEqual(pmtest.f(3), 3)
copy = pmtest.f
self.registry.updateModule("pmtest", "def f(x): return x + 1")
- get_transaction().commit()
+ transaction.commit()
pmtest._p_deactivate()
self.assertEqual(pmtest.f(3), 4)
self.assertEqual(copy(3), 4)
@@ -156,7 +156,7 @@
def testUpdateClass(self):
self.registry.newModule("pmtest", src)
- get_transaction().commit()
+ transaction.commit()
import pmtest
inst = pmtest.Foo()
v0 = inst.x
@@ -165,7 +165,7 @@
self.assertEqual(v1 - 1, v2)
self.assertEqual(v0 + 1, v1)
self.registry.updateModule("pmtest", src2)
- get_transaction().commit()
+ transaction.commit()
self.assertRaises(AttributeError, getattr, inst, "n")
self.useNewConnection()
@@ -180,7 +180,7 @@
self.registry.newModule("baz", "from foo import *")
import foo, bar, baz, quux
self.assert_(foo._p_oid is None)
- get_transaction().commit()
+ transaction.commit()
self.assert_(foo._p_oid)
self.assert_(bar._p_oid)
self.assert_(baz._p_oid)
@@ -193,7 +193,7 @@
self.assert_(foo.f is baz.f)
foo.x = 42
self.assertEqual(quux.f(4), 5)
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(quux.f(4), 5)
foo._p_deactivate()
# foo is deactivated, which means its dict is empty when f()
@@ -209,7 +209,7 @@
import foo
A = foo.f.attr = "attr"
self.assertEqual(foo.f.attr, A)
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(foo.f.attr, A)
foo.f._p_deactivate()
self.assertEqual(foo.f.attr, A)
@@ -222,14 +222,14 @@
self.registry.newModule("effect", side_effect_src)
import effect
effect.inc()
- get_transaction().commit()
+ transaction.commit()
effect.inc()
self.assert_(effect._p_changed)
self.useNewConnection()
def testBuiltins(self):
self.registry.newModule("test", builtin_src)
- get_transaction().commit()
+ transaction.commit()
import test
self.assertEqual(test.f(), len(test.x))
test._p_deactivate()
@@ -240,7 +240,7 @@
self.assertRaises(TypeError,
self.registry.newModule, "nested", nested_err_src)
self.registry.newModule("nested", nested_src)
- get_transaction().commit()
+ transaction.commit()
import nested
g = nested.f(3)
self.assertEqual(g(4), 7)
@@ -249,19 +249,19 @@
# test a lambda that contains another lambda as a default
self.registry.newModule("test",
"f = lambda x, y = lambda: 1: x + y()")
- get_transaction().commit()
+ transaction.commit()
import test
self.assertEqual(test.f(1), 2)
self.useNewConnection()
def testClass(self):
self.registry.newModule("foo", src)
- get_transaction().commit()
+ transaction.commit()
import foo
obj = foo.Foo()
obj.m()
self.root["m"] = obj
- get_transaction().commit()
+ transaction.commit()
foo._p_deactivate()
o = foo.Foo()
i = o.m()
@@ -271,7 +271,7 @@
def testPackage(self):
self.registry.newModule("A.B.C", "def f(x): return x")
- get_transaction().commit()
+ transaction.commit()
import A.B.C
self.assert_(isinstance(A, PersistentPackage))
@@ -281,7 +281,7 @@
"A.B", "def f(x): return x + 1")
self.registry.newModule("A.B.D", "def f(x): return x")
- get_transaction().commit()
+ transaction.commit()
from A.B import D
self.assert_(hasattr(A.B.D, "f"))
@@ -289,12 +289,12 @@
def testPackageInit(self):
self.registry.newModule("A.B.C", "def f(x): return x")
- get_transaction().commit()
+ transaction.commit()
import A.B.C
self.registry.newModule("A.B.__init__", "x = 2")
- get_transaction().commit()
+ transaction.commit()
import A.B
self.assert_(hasattr(A.B, "C"))
@@ -306,16 +306,16 @@
def testPackageRelativeImport(self):
self.registry.newModule("A.B.C", "def f(x): return x")
- get_transaction().commit()
+ transaction.commit()
self.registry.newModule("A.Q", "from B.C import f")
- get_transaction().commit()
+ transaction.commit()
import A.Q
self.assertEqual(A.B.C.f, A.Q.f)
self.registry.updateModule("A.Q", "import B.C")
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(A.B.C.f, A.Q.B.C.f)
@@ -328,7 +328,7 @@
def testImportAll(self):
self.registry.newModule("A.B.C",
"""__all__ = ["a", "b"]; a, b, c = 1, 2, 3""")
- get_transaction().commit()
+ transaction.commit()
d = {}
exec "from A.B.C import *" in d
@@ -337,7 +337,7 @@
self.assertRaises(KeyError, d.__getitem__, "c")
self.registry.newModule("A.B.D", "from C import *")
- get_transaction().commit()
+ transaction.commit()
import A.B.D
self.assert_(hasattr(A.B.D, "a"))
@@ -345,10 +345,10 @@
self.assert_(not hasattr(A.B.D, "c"))
self.registry.newModule("A.__init__", """__all__ = ["B", "F"]""")
- get_transaction().commit()
+ transaction.commit()
self.registry.newModule("A.F", "spam = 1")
- get_transaction().commit()
+ transaction.commit()
import A
self.assertEqual(A.F.spam, 1)
@@ -364,7 +364,7 @@
self._pmtest = os.path.join(_dir, "_pmtest.py")
def tearDown(self):
- get_transaction().abort()
+ transaction.abort()
self.db.close()
def open(self):
@@ -375,7 +375,7 @@
self.root["registry"] = self.registry = ManagedRegistry()
self.importer = TestPersistentModuleImporter(self.registry)
self.importer.install()
- get_transaction().commit()
+ transaction.commit()
def close(self):
self.importer.uninstall()
@@ -383,7 +383,7 @@
def testModuleReload(self):
self.registry.newModule("pmtest", open(self._pmtest).read())
- get_transaction().commit()
+ transaction.commit()
import pmtest
pmtest._p_deactivate()
self.assertEqual(pmtest.a, 1)
@@ -397,13 +397,13 @@
def testClassReload(self):
self.registry.newModule("foo", src)
- get_transaction().commit()
+ transaction.commit()
import foo
obj = foo.Foo()
obj.m()
self.root["d"] = d = PersistentDict()
d["m"] = obj
- get_transaction().commit()
+ transaction.commit()
self.close()
foo._p_deactivate()
self.importer.uninstall()
Modified: Zope3/trunk/src/zope/app/appsetup/bootstrap.py
===================================================================
--- Zope3/trunk/src/zope/app/appsetup/bootstrap.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/appsetup/bootstrap.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -19,7 +19,7 @@
$Id$
"""
__docformat__ = 'restructuredtext'
-from transaction import get_transaction
+import transaction
import zope.event
@@ -142,7 +142,7 @@
site_manager = site.LocalSiteManager(root_folder)
root_folder.setSiteManager(site_manager)
- get_transaction().commit()
+ transaction.commit()
connection.close()
Modified: Zope3/trunk/src/zope/app/appsetup/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/appsetup/tests.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/appsetup/tests.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,7 +16,7 @@
$Id$
"""
import unittest
-from transaction import get_transaction
+import transaction
from zope.testing import doctest
from ZODB.tests.util import DB
@@ -60,7 +60,7 @@
root = cx.root()
self.root_folder = rootFolder()
root[ZopePublication.root_name] = self.root_folder
- get_transaction().commit()
+ transaction.commit()
cx.close()
def createRFAndSM(self):
@@ -70,7 +70,7 @@
root[ZopePublication.root_name] = self.root_folder
self.site_manager = LocalSiteManager(self.root_folder)
self.root_folder.setSiteManager(self.site_manager)
- get_transaction().commit()
+ transaction.commit()
cx.close()
def test_notify(self):
@@ -112,7 +112,7 @@
self.assert_(IErrorReportingUtility.providedBy(
traverse(package, 'ErrorReporting')))
- get_transaction().commit()
+ transaction.commit()
cx.close()
Modified: Zope3/trunk/src/zope/app/component/tests/test_adapter.py
===================================================================
--- Zope3/trunk/src/zope/app/component/tests/test_adapter.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/component/tests/test_adapter.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
__docformat__ = "reStructuredText"
import unittest
-from transaction import get_transaction
+import transaction
from ZODB.tests.util import DB
import zope.component.testing as placelesssetup
@@ -563,7 +563,7 @@
>>> L2.lookup([IF2], IB1, 'bob')
'A112'
- >>> get_transaction().commit()
+ >>> transaction.commit()
Now, let's open another transaction:
@@ -600,7 +600,7 @@
>>> L2.lookup([IF2], IB1, 'bob')
'A11G'
- >>> get_transaction().commit()
+ >>> transaction.commit()
If we look back at the first connection, we should get the same data:
Modified: Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -19,7 +19,7 @@
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import implements
from zope.app.annotation.interfaces import IAttributeAnnotatable
@@ -79,7 +79,7 @@
root = self.getRootFolder()
root['foo'] = File()
self.assert_('foo' in root)
- get_transaction().commit()
+ transaction.commit()
# Check that we don't change mode if there are no items selected
@@ -127,7 +127,7 @@
root = self.getRootFolder()
root['foo'] = File()
self.assert_('foo' in root)
- get_transaction().commit()
+ transaction.commit()
response = self.publish('/@@contents.html',
basic='mgr:mgrpw',
@@ -154,7 +154,7 @@
def test_inplace_change_title(self):
root = self.getRootFolder()
root['foo'] = File()
- get_transaction().commit()
+ transaction.commit()
self.assert_('foo' in root)
dc = IZopeDublinCore(root['foo'])
self.assert_(dc.title == '')
@@ -191,7 +191,7 @@
root['foo'] = File() # item to be copied/deleted
root['bar'] = File() # ensures that there's always an item in
# the collection view
- get_transaction().commit()
+ transaction.commit()
# confirm foo in contents, Copy button visible, Paste not visible
response = self.publish('/@@contents.html', basic='mgr:mgrpw')
@@ -217,7 +217,7 @@
# delete foo -> nothing valid to paste -> Paste should not be visible
del root['foo']
- get_transaction().commit()
+ transaction.commit()
response = self.publish('/@@contents.html', basic='mgr:mgrpw')
self.assertEqual(response.getStatus(), 200)
self.assert_(response.getBody().find(
@@ -230,7 +230,7 @@
root = self.getRootFolder()
root['foo'] = File()
root['bar'] = File()
- get_transaction().commit()
+ transaction.commit()
# confirm foo/bar in contents, Copy button visible, Paste not visible
response = self.publish('/@@contents.html', basic='mgr:mgrpw')
@@ -258,7 +258,7 @@
# delete only foo -> bar still available -> Paste should be visible
del root['foo']
- get_transaction().commit()
+ transaction.commit()
response = self.publish('/@@contents.html', basic='mgr:mgrpw')
self.assertEqual(response.getStatus(), 200)
self.assert_(response.getBody().find(
@@ -278,7 +278,7 @@
def test_readonly_display(self):
root = self.getRootFolder()
root['foo'] = ReadOnlyContainer()
- get_transaction().commit()
+ transaction.commit()
response = self.publish('/foo/@@contents.html', basic='mgr:mgrpw')
self.assertEqual(response.getStatus(), 200)
Modified: Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py
===================================================================
--- Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,7 +16,7 @@
$Id: $
"""
import unittest
-from transaction import get_transaction
+import transaction
from zope.security.interfaces import Unauthorized
@@ -39,7 +39,7 @@
file = File()
self.getRootFolder()['file'] = file
IZopeDublinCore(file).title = u'My File'
- get_transaction().commit()
+ transaction.commit()
response = self.publish('/')
self.assertEquals(response.getStatus(), 200)
@@ -60,7 +60,7 @@
# deny zope.View to zope.Anonymous
prm = IRolePermissionManager(self.getRootFolder())
prm.denyPermissionToRole('zope.View', 'zope.Anonymous')
- get_transaction().commit()
+ transaction.commit()
# confirm Unauthorized when viewing root folder
self.assertRaises(Unauthorized, self.publish, '/')
@@ -80,7 +80,7 @@
# deny zope.app.dublincore.view to zope.Anonymous
prm = IRolePermissionManager(self.getRootFolder())
prm.denyPermissionToRole('zope.app.dublincore.view', 'zope.Anonymous')
- get_transaction().commit()
+ transaction.commit()
response = self.publish('/')
self.assertEquals(response.getStatus(), 200)
Modified: Zope3/trunk/src/zope/app/container/tests/test_contained.py
===================================================================
--- Zope3/trunk/src/zope/app/container/tests/test_contained.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/container/tests/test_contained.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -19,7 +19,7 @@
import gc
from ZODB.DemoStorage import DemoStorage
from ZODB.DB import DB
-from transaction import get_transaction
+import transaction
from persistent import Persistent
import zope.interface
@@ -66,7 +66,7 @@
>>> db = DB(DemoStorage('test_storage'))
>>> c = db.open()
>>> c.root()['p'] = p
- >>> get_transaction().commit()
+ >>> transaction.commit()
>>> c2 = db.open()
>>> p2 = c2.root()['p']
@@ -175,7 +175,7 @@
>>> c1 = db.open()
>>> c1.root()['parent'] = parent
>>> c1.root()['other'] = other
- >>> get_transaction().commit()
+ >>> transaction.commit()
We'll open a second connection and verify that we have the data we
expect:
@@ -210,7 +210,7 @@
And save the changes:
- >>> get_transaction().commit()
+ >>> transaction.commit()
Now we'll reopen the first connection and verify that we can see
the changes:
@@ -246,7 +246,7 @@
>>> for i in range(10):
... conn.root()[i] = MyOb()
- >>> get_transaction().commit()
+ >>> transaction.commit()
Let's get the oid of our proxy:
Modified: Zope3/trunk/src/zope/app/dav/ftests/dav.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftests/dav.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/dav/ftests/dav.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,7 +16,7 @@
$Id$
"""
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import implements
from zope.app.testing.functional import HTTPTestCase
@@ -47,7 +47,7 @@
def createObject(self, path, obj):
folder, id = self.createFolders(path)
folder[id] = obj
- get_transaction().commit()
+ transaction.commit()
def addPage(self, path, content):
page = Page()
Modified: Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -18,19 +18,19 @@
import unittest
from zope.app.dav.ftests.dav import DAVTestCase
-from transaction import get_transaction
+import transaction
class TestMKCOL(DAVTestCase):
def test_mkcol_not_folderish(self):
self.addPage('/bar/pt', u'<span />')
- get_transaction().commit()
+ transaction.commit()
self.verifyStatus(path='/bar/pt/foo', body='', basic='mgr:mgrpw',
expected=404)
def test_mkcol_not_folderish_existing(self):
self.addPage('/bar/pt', u'<span />')
- get_transaction().commit()
+ transaction.commit()
self.verifyStatus(path='/bar/pt', body='', basic='mgr:mgrpw',
expected=405)
@@ -44,7 +44,7 @@
def test_mkcol_existing(self):
self.createFolders('/bar/mkcol_test')
- get_transaction().commit()
+ transaction.commit()
self.verifyStatus(path='/bar', body='', basic='mgr:mgrpw',
expected=405)
Modified: Zope3/trunk/src/zope/app/dav/tests/test_proppatch.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/tests/test_proppatch.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/dav/tests/test_proppatch.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -170,7 +170,7 @@
self.conn = self.db.open()
root = self.conn.root()
root['Application'] = self.rootFolder
- get_transaction().commit()
+ transaction.commit()
def tearDown(self):
self.db.close()
Modified: Zope3/trunk/src/zope/app/error/bootstrap.py
===================================================================
--- Zope3/trunk/src/zope/app/error/bootstrap.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/error/bootstrap.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,6 +16,8 @@
$Id: bootstrap.py 28023 2004-10-12 18:11:29Z anguenot $
"""
+import transaction
+
from zope.app.appsetup.bootstrap import ensureUtility, getInformationFromEvent
from zope.app.error.error import RootErrorReportingUtility
@@ -32,5 +34,5 @@
ensureUtility(root_folder, IErrorReportingUtility, 'ErrorReporting',
RootErrorReportingUtility, copy_to_zlog=False)
- get_transaction().commit()
+ transaction.commit()
connection.close()
Modified: Zope3/trunk/src/zope/app/file/file.py
===================================================================
--- Zope3/trunk/src/zope/app/file/file.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/file/file.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -18,7 +18,7 @@
__docformat__ = 'restructuredtext'
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import implements
import zope.app.publication.interfaces
from zope.app.file import interfaces
@@ -164,7 +164,7 @@
# Make sure we have an _p_jar, even if we are a new object, by
# doing a sub-transaction commit.
- get_transaction().commit(1)
+ transaction.commit(1)
jar = self._p_jar
@@ -196,7 +196,7 @@
data.next = next
# Now make it get saved in a sub-transaction!
- get_transaction().commit(1)
+ transaction.commit(1)
# Now make it a ghost to free the memory. We
# don't need it anymore!
Modified: Zope3/trunk/src/zope/app/form/browser/editview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/editview.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/editview.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -18,7 +18,7 @@
__docformat__ = 'restructuredtext'
from datetime import datetime
-from transaction import get_transaction
+import transaction
from zope.interface import Interface
from zope.schema import getFieldNamesInOrder
@@ -102,7 +102,7 @@
except WidgetsError, errors:
self.errors = errors
status = _("An error occured.")
- get_transaction().abort()
+ transaction.abort()
else:
setUpEditWidgets(self, self.schema, source=self.adapted,
ignoreStickyValues=True,
Modified: Zope3/trunk/src/zope/app/form/browser/formview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/formview.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/formview.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,7 +16,7 @@
$Id: editview.py 29143 2005-02-14 22:43:16Z srichter $
"""
__docformat__ = 'restructuredtext'
-from transaction import get_transaction
+import transaction
from zope.app.form.interfaces import WidgetsError, IInputWidget
@@ -73,7 +73,7 @@
except WidgetsError, errors:
self.errors = errors
status = _("An error occured.")
- get_transaction().abort()
+ transaction.abort()
else:
if changed:
self.setData(self.data)
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from support import *
@@ -54,7 +54,7 @@
def test_display_editform(self):
self.getRootFolder()['foo'] = Foo()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/foo/edit.html')
@@ -77,7 +77,7 @@
def test_submit_editform(self):
self.getRootFolder()['foo'] = Foo()
- get_transaction().commit()
+ transaction.commit()
# submit edit view
response = self.publish('/foo/edit.html', form={
@@ -93,7 +93,7 @@
def test_missing_value(self):
self.getRootFolder()['foo'] = Foo()
- get_transaction().commit()
+ transaction.commit()
# temporarily make bar field not required
IFoo['bar'].required = False
@@ -116,7 +116,7 @@
def test_required_validation(self):
self.getRootFolder()['foo'] = Foo()
- get_transaction().commit()
+ transaction.commit()
self.assert_(IFoo['bar'].required)
@@ -132,7 +132,7 @@
def test_invalid_allowed_value(self):
self.getRootFolder()['foo'] = Foo()
- get_transaction().commit()
+ transaction.commit()
# submit a value for bar isn't allowed
response = self.publish('/foo/edit.html', form={
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import Interface
from zope.interface import implements
@@ -59,7 +59,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = BoolTest()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/test/edit.html')
@@ -82,7 +82,7 @@
def test_submit_editform(self):
self.getRootFolder()['test'] = BoolTest()
- get_transaction().commit()
+ transaction.commit()
# submit edit view
response = self.publish('/test/edit.html', form={
@@ -103,7 +103,7 @@
object.b1 = True
object.b2 = True
self.getRootFolder()['test'] = object
- get_transaction().commit()
+ transaction.commit()
# submit invalud type for text line
response = self.publish('/test/edit.html', form={
@@ -124,7 +124,7 @@
# test confirms that one cannot set a Bool field to None.
self.getRootFolder()['test'] = BoolTest()
- get_transaction().commit()
+ transaction.commit()
# confirm default value of b1 is True
object = traverse(self.getRootFolder(), 'test')
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -18,7 +18,7 @@
import unittest
import re
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from datetime import datetime
from zope.app.datetimeutils import parseDatetimetz, tzinfo
@@ -94,7 +94,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
object = traverse(self.getRootFolder(), 'test')
# display edit view
@@ -109,7 +109,7 @@
def test_submit_editform(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
d1 = datetime(2003, 2, 1, tzinfo=tzinfo(0))
d2 = datetime(2003, 2, 2, tzinfo=tzinfo(0))
@@ -134,7 +134,7 @@
def test_missing_value(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for d2 and d3
response = self.publish('/test/edit.html', form={
@@ -153,7 +153,7 @@
def test_required_validation(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for required field d1
response = self.publish('/test/edit.html', form={
@@ -171,7 +171,7 @@
def test_invalid_value(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
# submit a value for d3 that isn't allowed
response = self.publish('/test/edit.html', form={
@@ -183,7 +183,7 @@
def test_min_max_validation(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for d1 that is too low
response = self.publish('/test/edit.html', form={
@@ -204,7 +204,7 @@
def test_omitted_value(self):
self.getRootFolder()['test'] = DatetimeTest()
- get_transaction().commit()
+ transaction.commit()
# remember default values
object = traverse(self.getRootFolder(), 'test')
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import Interface
from zope.interface import implements
@@ -59,7 +59,7 @@
self.getRootFolder()['foo'] = Foo()
self.getRootFolder()['foo'].required_text = u'initial required'
self.getRootFolder()['foo'].optional_text = u'initial optional'
- get_transaction().commit()
+ transaction.commit()
# submit form with legal value for optional_text and invalid for
# required_text
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -18,7 +18,7 @@
import unittest
from StringIO import StringIO
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import Interface
from zope.interface import implements
@@ -83,7 +83,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = FileTest()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/test/edit.html')
@@ -98,7 +98,7 @@
def test_submit_text(self):
self.getRootFolder()['test'] = FileTest()
- get_transaction().commit()
+ transaction.commit()
object = traverse(self.getRootFolder(), 'test')
self.assert_(object.f1 is None)
self.assertEqual(object.f2, 'foo')
@@ -119,7 +119,7 @@
def test_invalid_value(self):
self.getRootFolder()['test'] = FileTest()
- get_transaction().commit()
+ transaction.commit()
# submit an invalid file value
response = self.publish('/test/edit.html', form={
@@ -135,7 +135,7 @@
# my patience looking at it.
def XXX_test_required_validation(self):
self.getRootFolder()['test'] = FileTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing value for required field f1
response = self.publish('/test/edit.html', form={
@@ -151,7 +151,7 @@
def test_empty_file(self):
self.getRootFolder()['test'] = FileTest()
- get_transaction().commit()
+ transaction.commit()
# submit an empty text file
response = self.publish('/test/edit.html', form={
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from support import *
@@ -66,7 +66,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/test/edit.html')
@@ -88,7 +88,7 @@
def test_submit_editform(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# submit edit view
response = self.publish('/test/edit.html', form={
@@ -108,7 +108,7 @@
def test_missing_value(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for f2 and f3
response = self.publish('/test/edit.html', form={
@@ -128,7 +128,7 @@
def test_required_validation(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for required field f1
response = self.publish('/test/edit.html', form={
@@ -146,7 +146,7 @@
def test_invalid_allowed_value(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# submit a value for f3 that isn't allowed
response = self.publish('/test/edit.html', form={
@@ -158,7 +158,7 @@
def test_min_max_validation(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for f1 that is too low
response = self.publish('/test/edit.html', form={
@@ -179,7 +179,7 @@
def test_omitted_value(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# confirm default values
object = traverse(self.getRootFolder(), 'test')
@@ -204,7 +204,7 @@
def test_conversion(self):
self.getRootFolder()['test'] = FloatTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for f1 that cannot be convert to an float
response = self.publish('/test/edit.html', form={
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from support import *
@@ -88,7 +88,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/test/edit.html')
@@ -110,7 +110,7 @@
def test_submit_editform(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# submit edit view
response = self.publish('/test/edit.html', form={
@@ -130,7 +130,7 @@
def test_missing_value(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for i2 and i3
response = self.publish('/test/edit.html', form={
@@ -154,7 +154,7 @@
"""
self.getRootFolder()['test'] = IntTest2() # note alt. class
- get_transaction().commit()
+ transaction.commit()
# display edit form
response = self.publish('/test/edit.html')
@@ -184,7 +184,7 @@
def test_required_validation(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for required field i1
response = self.publish('/test/edit.html', form={
@@ -202,7 +202,7 @@
def test_invalid_allowed_value(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# submit a value for i3 that isn't allowed
response = self.publish('/test/edit.html', form={
@@ -214,7 +214,7 @@
def test_min_max_validation(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for i1 that is too low
response = self.publish('/test/edit.html', form={
@@ -235,7 +235,7 @@
def test_omitted_value(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# confirm default values
object = traverse(self.getRootFolder(), 'test')
@@ -260,7 +260,7 @@
def test_conversion(self):
self.getRootFolder()['test'] = IntTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for i1 that cannot be convert to an int
response = self.publish('/test/edit.html', form={
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import Interface
from zope.interface import implements
@@ -64,7 +64,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/test/edit.html')
@@ -84,7 +84,7 @@
def test_submit_editform(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# submit edit view
response = self.publish('/test/edit.html', form={
@@ -109,7 +109,7 @@
unicode.
"""
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# submit invalid type for text
response = self.publish('/test/edit.html', form={
@@ -124,7 +124,7 @@
def test_missing_value(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for s2 and s3
response = self.publish('/test/edit.html', form={
@@ -144,7 +144,7 @@
def test_required_validation(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for required field s1
response = self.publish('/test/edit.html', form={
@@ -162,7 +162,7 @@
def test_length_validation(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for s1 that is too short
response = self.publish('/test/edit.html', form={
@@ -183,7 +183,7 @@
def test_omitted_value(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# confirm default values
object = traverse(self.getRootFolder(), 'test')
@@ -208,7 +208,7 @@
def test_conversion(self):
self.getRootFolder()['test'] = TextTest()
- get_transaction().commit()
+ transaction.commit()
# confirm that line terminators are converted correctly on post
response = self.publish('/test/edit.html', form={
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
import unittest
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from zope.interface import Interface, implements
from zope.schema import TextLine, Choice
@@ -62,7 +62,7 @@
def test_display_editform(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# display edit view
response = self.publish('/test/edit.html')
@@ -83,7 +83,7 @@
def test_submit_editform(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# submit edit view
response = self.publish('/test/edit.html', form={
@@ -108,7 +108,7 @@
unicode.
"""
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# submit invalud type for text line
response = self.publish('/test/edit.html', form={
@@ -124,7 +124,7 @@
def test_missing_value(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for s2 and s3
response = self.publish('/test/edit.html', form={
@@ -144,7 +144,7 @@
def test_required_validation(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# submit missing values for required field s1
response = self.publish('/test/edit.html', form={
@@ -162,7 +162,7 @@
def test_invalid_value(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# submit a value for s3 that isn't allowed
response = self.publish('/test/edit.html', form={
@@ -174,7 +174,7 @@
def test_length_validation(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# submit value for s1 that is too short
response = self.publish('/test/edit.html', form={
@@ -195,7 +195,7 @@
def test_omitted_value(self):
self.getRootFolder()['test'] = TextLineTest()
- get_transaction().commit()
+ transaction.commit()
# confirm default values
object = traverse(self.getRootFolder(), 'test')
Modified: Zope3/trunk/src/zope/app/fssync/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/fssync/browser/__init__.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/fssync/browser/__init__.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -22,7 +22,7 @@
import shutil
import tempfile
-from transaction import get_transaction
+import transaction
from zope.app.publisher.browser import BrowserView
from zope.app.traversing.api import getName, getParent, getRoot
@@ -92,7 +92,7 @@
raise ValueError(_("Content-Type is not application/x-snarf"))
def set_transaction(self):
- self.txn = get_transaction()
+ self.txn = transaction.get()
def parse_args(self):
# The query string in the URL didn't get parsed, because we're
Modified: Zope3/trunk/src/zope/app/generations/browser/managers.py
===================================================================
--- Zope3/trunk/src/zope/app/generations/browser/managers.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/generations/browser/managers.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,6 +17,8 @@
"""
__docformat__ = 'restructuredtext'
+import transaction
+
from zope.app import zapi
from zope.app.generations.interfaces import ISchemaManager
from zope.app.generations.generations import generations_key, Context
@@ -177,12 +179,12 @@
generation += 1
manager.evolve(context, generation)
generations[key] = generation
- get_transaction().commit()
+ transaction.commit()
return {'app': key, 'to': generation}
return None
finally:
- get_transaction().abort()
+ transaction.abort()
conn.close()
def applications(self):
Modified: Zope3/trunk/src/zope/app/interface/tests/test_interface.py
===================================================================
--- Zope3/trunk/src/zope/app/interface/tests/test_interface.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/interface/tests/test_interface.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -19,7 +19,7 @@
import unittest
-from transaction import get_transaction
+import transaction
from ZODB.tests.util import DB
from zodbcode.module import ManagedRegistry
@@ -49,10 +49,10 @@
self.root = self.db.open().root()
self.registry = ManagedRegistry()
self.root["registry"] = self.registry
- get_transaction().commit()
+ transaction.commit()
def tearDown(self):
- get_transaction().abort() # just in case
+ transaction.abort() # just in case
def test_creation(self):
class IFoo(PersistentInterface):
@@ -66,7 +66,7 @@
def test_patch(self):
self.registry.newModule("imodule", code)
- get_transaction().commit()
+ transaction.commit()
imodule = self.registry.findModule("imodule")
# test for a pickling bug
Modified: Zope3/trunk/src/zope/app/mail/delivery.py
===================================================================
--- Zope3/trunk/src/zope/app/mail/delivery.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/mail/delivery.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -35,7 +35,7 @@
from zope.app.mail.interfaces import IDirectMailDelivery, IQueuedMailDelivery
from zope.app.mail.maildir import Maildir
from transaction.interfaces import IDataManager
-from transaction import get_transaction
+import transaction
from transaction.util import NoSavepointSupportRollback
class MailDataManager(object):
@@ -82,7 +82,7 @@
else:
messageid = self.newMessageId()
message = 'Message-Id: <%s>\n%s' % (messageid, message)
- get_transaction().join(
+ transaction.get().join(
self.createDataManager(fromaddr, toaddrs, message))
return messageid
Modified: Zope3/trunk/src/zope/app/mail/tests/test_delivery.py
===================================================================
--- Zope3/trunk/src/zope/app/mail/tests/test_delivery.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/mail/tests/test_delivery.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -20,7 +20,7 @@
import os.path
from tempfile import mktemp
from unittest import TestCase, TestSuite, makeSuite
-from transaction import get_transaction
+import transaction
from zope.interface import implements
from zope.interface.verify import verifyObject
@@ -76,7 +76,7 @@
msgid = delivery.send(fromaddr, toaddrs, opt_headers + message)
self.assertEquals(msgid, '20030519.1234 at example.org')
self.assertEquals(mailer.sent_messages, [])
- get_transaction().commit()
+ transaction.commit()
self.assertEquals(mailer.sent_messages,
[(fromaddr, toaddrs, opt_headers + message)])
@@ -84,7 +84,7 @@
msgid = delivery.send(fromaddr, toaddrs, message)
self.assert_('@' in msgid)
self.assertEquals(mailer.sent_messages, [])
- get_transaction().commit()
+ transaction.commit()
self.assertEquals(len(mailer.sent_messages), 1)
self.assertEquals(mailer.sent_messages[0][0], fromaddr)
self.assertEquals(mailer.sent_messages[0][1], toaddrs)
@@ -95,7 +95,7 @@
mailer.sent_messages = []
msgid = delivery.send(fromaddr, toaddrs, opt_headers + message)
self.assertEquals(mailer.sent_messages, [])
- get_transaction().abort()
+ transaction.abort()
self.assertEquals(mailer.sent_messages, [])
@@ -203,7 +203,7 @@
self.assertEquals(msgid, '20030519.1234 at example.org')
self.assertEquals(MaildirWriterStub.commited_messages, [])
self.assertEquals(MaildirWriterStub.aborted_messages, [])
- get_transaction().commit()
+ transaction.commit()
self.assertEquals(MaildirWriterStub.commited_messages,
[zope_headers + opt_headers + message])
self.assertEquals(MaildirWriterStub.aborted_messages, [])
@@ -213,7 +213,7 @@
self.assert_('@' in msgid)
self.assertEquals(MaildirWriterStub.commited_messages, [])
self.assertEquals(MaildirWriterStub.aborted_messages, [])
- get_transaction().commit()
+ transaction.commit()
self.assertEquals(len(MaildirWriterStub.commited_messages), 1)
self.assert_(MaildirWriterStub.commited_messages[0].endswith(message))
new_headers = MaildirWriterStub.commited_messages[0][:-len(message)]
@@ -226,7 +226,7 @@
msgid = delivery.send(fromaddr, toaddrs, opt_headers + message)
self.assertEquals(MaildirWriterStub.commited_messages, [])
self.assertEquals(MaildirWriterStub.aborted_messages, [])
- get_transaction().abort()
+ transaction.abort()
self.assertEquals(MaildirWriterStub.commited_messages, [])
self.assertEquals(len(MaildirWriterStub.aborted_messages), 1)
Modified: Zope3/trunk/src/zope/app/module/README.txt
===================================================================
--- Zope3/trunk/src/zope/app/module/README.txt 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/module/README.txt 2005-03-28 19:26:23 UTC (rev 29703)
@@ -75,8 +75,8 @@
>>> conn = db.open()
>>> conn.root()['Application'] = root
- >>> from transaction import get_transaction
- >>> get_transaction().commit()
+ >>> import transaction
+ >>> transaction.commit()
Let's now reopen the database to test that the module can be seen from a
different connection.
Modified: Zope3/trunk/src/zope/app/observable/observable.txt
===================================================================
--- Zope3/trunk/src/zope/app/observable/observable.txt 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/observable/observable.txt 2005-03-28 19:26:23 UTC (rev 29703)
@@ -9,9 +9,10 @@
to the database by placing it in the root folder:
>>> from zope.app.container.contained import setitem
+ >>> import transaction
>>> root_folder = getRootFolder()
>>> setitem(root_folder, root_folder.__setitem__, u'chicken', Chicken())
- >>> get_transaction().commit()
+ >>> transaction.commit()
>>> chicken = root_folder['chicken']
Now consider a possible subscriber for an object event:
@@ -23,7 +24,7 @@
>>> from zope.app.event.interfaces import IObjectModifiedEvent
>>> observer = IObservable(chicken)
>>> observer.handle([IObjectModifiedEvent], chickenModified)
- >>> get_transaction().commit()
+ >>> transaction.commit()
When we now issue an ``IObjectModifiedEvent`` event, our subscriber
will be called:
Modified: Zope3/trunk/src/zope/app/principalannotation/bootstrap.py
===================================================================
--- Zope3/trunk/src/zope/app/principalannotation/bootstrap.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/principalannotation/bootstrap.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,6 +16,8 @@
$Id: bootstrap.py 28023 2004-10-12 18:11:29Z anguenot $
"""
+import transaction
+
from zope.app.appsetup.bootstrap import ensureUtility, getInformationFromEvent
from zope.app.principalannotation import PrincipalAnnotationUtility
@@ -32,5 +34,5 @@
ensureUtility(root_folder, IPrincipalAnnotationUtility,
'PrincipalAnnotation', PrincipalAnnotationUtility)
- get_transaction().commit()
+ transaction.commit()
connection.close()
Modified: Zope3/trunk/src/zope/app/publication/tests/test_browserpublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/tests/test_browserpublication.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/publication/tests/test_browserpublication.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -115,6 +115,7 @@
def _testBaseTags(self, url, expected):
# Make sure I1 and O1 are visible in the module namespace
# so that the classes can be pickled.
+ import transaction
pub = BrowserPublication(self.db)
@@ -129,12 +130,11 @@
'tim', 'timbot', 'ai at its best')
# now place our object inside the application
- from transaction import get_transaction
connection = self.db.open()
app = connection.root()['Application']
app.somepath = ob
- get_transaction().commit()
+ transaction.commit()
connection.close()
defineChecker(app.__class__, NamesChecker(somepath='xxx'))
Modified: Zope3/trunk/src/zope/app/publication/tests/test_zopepublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/tests/test_zopepublication.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/publication/tests/test_zopepublication.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -22,6 +22,7 @@
from persistent import Persistent
from ZODB.DB import DB
from ZODB.DemoStorage import DemoStorage
+import transaction
from zope.interface.verify import verifyClass
from zope.interface import implements, classImplements, implementedBy
@@ -119,7 +120,7 @@
from zope.app.folder import rootFolder
app = rootFolder()
root[ZopePublication.root_name] = app
- get_transaction().commit()
+ transaction.commit()
connection.close()
self.app = app
@@ -343,7 +344,7 @@
self.assertEqual(self.request.response._cookies, {})
def testAbortOrCommitTransaction(self):
- txn = get_transaction()
+ txn = transaction.get()
try:
raise Exception
except:
@@ -351,7 +352,7 @@
self.publication.handleException(
self.object, self.request, sys.exc_info(), retry_allowed=False)
# assert that we get a new transaction
- self.assert_(txn is not get_transaction())
+ self.assert_(txn is not transaction.get())
def testAbortTransactionWithErrorReportingUtility(self):
# provide our fake error reporting utility
@@ -400,7 +401,7 @@
f2 = f1['f2']
sm2 = setup.createSiteManager(f2)
setup.addUtility(sm2, '', IAuthenticationUtility, AuthUtility2())
- get_transaction().commit()
+ transaction.commit()
from zope.app.container.interfaces import ISimpleReadContainer
@@ -433,13 +434,13 @@
def testTransactionCommitAfterCall(self):
root = self.db.open().root()
- txn = get_transaction()
+ txn = transaction.get()
# we just need a change in the database to make the
# transaction notable in the undo log
root['foo'] = object()
last_txn_info = self.db.undoInfo()[0]
self.publication.afterCall(self.request, self.object)
- self.assert_(txn is not get_transaction())
+ self.assert_(txn is not transaction.get())
new_txn_info = self.db.undoInfo()[0]
self.failIfEqual(last_txn_info, new_txn_info)
Modified: Zope3/trunk/src/zope/app/publication/zopepublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/zopepublication.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/publication/zopepublication.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -155,7 +155,7 @@
return mapply(ob, request.getPositionalArguments(), request)
def afterCall(self, request, ob):
- txn = get_transaction()
+ txn = transaction.get()
self.annotateTransaction(txn, request, ob)
txn.commit()
@@ -224,16 +224,16 @@
# the zope log.
errUtility.raising(exc_info, request)
- get_transaction().commit()
+ transaction.commit()
except:
tryToLogException(
'Error while reporting an error to the Error Reporting utility')
- get_transaction().abort()
+ transaction.abort()
def handleException(self, object, request, exc_info, retry_allowed=True):
# This transaction had an exception that reached the publisher.
# It must definitely be aborted.
- get_transaction().abort()
+ transaction.abort()
# Convert ConflictErrors to Retry exceptions.
if retry_allowed and isinstance(exc_info[1], ConflictError):
@@ -311,7 +311,7 @@
# for the published object, not an exception view.
body = mapply(view, (), request)
response.setBody(body)
- get_transaction().commit()
+ transaction.commit()
if (ISystemErrorView.providedBy(view)
and view.isSystemError()):
# Got a system error, want to log the error
@@ -342,7 +342,7 @@
# because the view couldn't be rendered. In either case,
# we let the request handle it.
response.handleException(exc_info)
- get_transaction().abort()
+ transaction.abort()
# See if there's an IExceptionSideEffects adapter for the
# exception
@@ -360,12 +360,12 @@
# Although request is passed in here, it should be
# considered read-only.
adapter(object, request, exc_info)
- get_transaction().commit()
+ transaction.commit()
except:
tryToLogException(
'Exception while calling'
' IExceptionSideEffects adapter')
- get_transaction().abort()
+ transaction.abort()
def beginErrorHandlingTransaction(self, request, ob, note):
txn = transaction.begin()
Modified: Zope3/trunk/src/zope/app/rdb/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/__init__.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/rdb/__init__.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -25,7 +25,7 @@
from persistent import Persistent
-from transaction import get_transaction
+import transaction
from transaction.interfaces import IDataManager, IRollback
from transaction.util import NoSavepointSupportRollback
@@ -318,7 +318,7 @@
'See IZopeConnection'
if not self._txn_registered:
tm = ZopeDBTransactionManager(self)
- get_transaction().join(tm)
+ transaction.get().join(tm)
self._txn_registered = True
def commit(self):
Modified: Zope3/trunk/src/zope/app/rdb/tests/test_zopeconnection.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/tests/test_zopeconnection.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/rdb/tests/test_zopeconnection.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -38,7 +38,7 @@
cursor.execute('select * from blah')
self.assertEqual(zc._txn_registered, True)
- self.assertEqual(len(transaction.get_transaction()._resources), 1)
+ self.assertEqual(len(transaction.get()._resources), 1)
def test_commit(self):
transaction.begin()
Modified: Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,7 +16,7 @@
$Id$
"""
from unittest import TestCase, main, makeSuite, TestSuite
-from transaction import get_transaction
+import transaction
from transaction.tests.abstestIDataManager import IDataManagerTests
from zope.app.rdb import ZopeDBTransactionManager
from zope.app.rdb import ZopeConnection
@@ -29,18 +29,18 @@
zc = ZopeConnection(self.conn, TypeInfoStub())
self.datamgr = ZopeDBTransactionManager(zc)
zc.registerForTxn()
- self.txn_factory = get_transaction
+ self.txn_factory = transaction.get
def tearDown(self):
""" make sure the global env is clean"""
- get_transaction().abort()
+ transaction.abort()
def test_abort(self):
- get_transaction().abort()
+ transaction.abort()
self.assertEqual(self.conn._called.get('rollback'), 1)
def test_commit(self):
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(self.conn._called.get('commit'), 1)
@@ -58,19 +58,19 @@
self.datamgr1 = ZopeDBTransactionManager(zc2)
zc1.registerForTxn()
zc2.registerForTxn()
- self.txn_factory = get_transaction
+ self.txn_factory = transaction.get
def tearDown(self):
""" make sure the global env is clean"""
- get_transaction().abort()
+ transaction.abort()
def test_abort(self):
- get_transaction().abort()
+ transaction.abort()
self.assertEqual(self.conn1._called.get('rollback'), 1)
self.assertEqual(self.conn2._called.get('rollback'), 1)
def test_commit(self):
- get_transaction().commit()
+ transaction.commit()
self.assertEqual(self.conn1._called.get('commit'), 1)
self.assertEqual(self.conn2._called.get('commit'), 1)
Modified: Zope3/trunk/src/zope/app/session/bootstrap.py
===================================================================
--- Zope3/trunk/src/zope/app/session/bootstrap.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/session/bootstrap.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -20,6 +20,8 @@
$Id$
"""
+import transaction
+
from zope.app.appsetup.bootstrap import ensureUtility, getInformationFromEvent
from zope.app.session.interfaces import \
@@ -46,5 +48,5 @@
PersistentSessionDataContainer,
)
- get_transaction().commit()
+ transaction.commit()
connection.close()
Modified: Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -18,7 +18,7 @@
import unittest
from zope.app.testing import ztapi, functional
from zope.app.folder import Folder
-from transaction import get_transaction
+import transaction
from zope.app.publisher.browser.resource import Resource
from zope.app.traversing.api import traverse
from zope.security.checker import defineChecker, NamesChecker, NoProxy
@@ -150,7 +150,7 @@
def createObject(self, path, obj):
folder, id = self.createFolders(path)
folder[id] = obj
- get_transaction().commit()
+ transaction.commit()
def addPage(self, path, content):
page = ZPTPage()
Modified: Zope3/trunk/src/zope/app/undo/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/undo/__init__.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/undo/__init__.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -16,6 +16,9 @@
$Id$
"""
from datetime import datetime
+
+import transaction
+
from zope.interface import implements
from zope.app.security.interfaces import PrincipalLookupError
@@ -194,4 +197,4 @@
def _undo(self, ids):
for id in ids:
self.__db.undo(id)
- get_transaction().setExtendedInfo('undo', True)
+ transaction.get().setExtendedInfo('undo', True)
Modified: Zope3/trunk/src/zope/app/undo/tests/test_zodbundomanager.py
===================================================================
--- Zope3/trunk/src/zope/app/undo/tests/test_zodbundomanager.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/app/undo/tests/test_zodbundomanager.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -17,7 +17,7 @@
"""
from time import time
from unittest import TestCase, main, makeSuite
-from transaction import get_transaction
+import transaction
from zope.testing.cleanup import CleanUp
from zope.app.testing import ztapi
@@ -138,7 +138,7 @@
self.assertEqual(list(self.undo.getTransactions()), expected)
# assert that the transaction has been annotated
- txn = get_transaction()
+ txn = transaction.get()
self.assert_(txn._extension.has_key('undo'))
self.assert_(txn._extension['undo'] is True)
Modified: Zope3/trunk/src/zope/index/text/tests/indexhtml.py
===================================================================
--- Zope3/trunk/src/zope/index/text/tests/indexhtml.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/index/text/tests/indexhtml.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -28,6 +28,7 @@
from ZODB.Storage.FileStorage import FileStorage
from ZODB.BTrees.IOBTree import IOBTree
+import transaction
from zope.index.text.htmlsplitter import HTMLWordSplitter
from zope.index.text.lexicon import Lexicon, StopWordRemover
@@ -69,7 +70,7 @@
def main(db, root, dir):
rt["index"] = index = INDEX()
rt["files"] = paths = IOBTree()
- get_transaction().commit()
+ transaction.commit()
zodb_time = 0.0
pack_time = 0.0
@@ -94,7 +95,7 @@
f.close()
if docid % TXN_INTERVAL == 0:
z0 = clock()
- get_transaction().commit()
+ transaction.commit()
z1 = clock()
zodb_time += z1 - z0
if VERBOSE:
@@ -108,7 +109,7 @@
if VERBOSE:
print "pack took", p1 - p0, pack_time
z0 = clock()
- get_transaction().commit()
+ transaction.commit()
z1 = t1 = clock()
total_time = t1 - t0
zodb_time += z1 - z0
Modified: Zope3/trunk/src/zope/index/text/tests/mhindex.py
===================================================================
--- Zope3/trunk/src/zope/index/text/tests/mhindex.py 2005-03-28 19:00:25 UTC (rev 29702)
+++ Zope3/trunk/src/zope/index/text/tests/mhindex.py 2005-03-28 19:26:23 UTC (rev 29703)
@@ -61,7 +61,7 @@
from ZODB.DB import DB
from ZODB.Storage.FileStorage import FileStorage
-from transaction import get_transaction
+import transaction
from BTrees.IOBTree import IOBTree
from BTrees.OIBTree import OIBTree
from BTrees.IIBTree import IIBTree
@@ -566,7 +566,7 @@
def commit(self):
if self.trans_count > 0:
print "committing..."
- get_transaction().commit()
+ transaction.commit()
self.trans_count = 0
self.pack_count += 1
if self.pack_count >= self.pack_limit > 0:
More information about the Zope3-Checkins
mailing list