[CMF-checkins] CVS: Products/CMFCore - utils.py:1.66
Yvo Schubbe
y.2005- at wcm-solutions.de
Tue Apr 5 05:27:25 EDT 2005
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv4750/CMFCore
Modified Files:
utils.py
Log Message:
- replaced get_transaction() by the transaction API used in Zope 2.8
- added utils.transaction for Zope 2.7 compatibility
- replaced commit() by commit(1) in test_PortalFolder.py
- related import and whitespace cleanup
=== Products/CMFCore/utils.py 1.65 => 1.66 ===
--- Products/CMFCore/utils.py:1.65 Sun Mar 13 15:40:30 2005
+++ Products/CMFCore/utils.py Tue Apr 5 05:26:54 2005
@@ -25,11 +25,11 @@
from AccessControl.Permission import Permission
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl.Role import gather_permissions
-from Acquisition import Implicit
from Acquisition import aq_base
from Acquisition import aq_get
from Acquisition import aq_inner
from Acquisition import aq_parent
+from Acquisition import Implicit
from ExtensionClass import Base
from Globals import HTMLFile
from Globals import ImageFile
@@ -380,10 +380,10 @@
)
if self.icon:
- icon = os_path.split(self.icon)[1]
+ icon = os_path.split(self.icon)[1]
else:
icon = None
-
+
for tool in self.tools:
tool.__factory_meta_type__ = self.meta_type
tool.icon = 'misc_/%s/%s' % (self.product_name, icon)
@@ -637,9 +637,24 @@
break
return p.replace('\\','/')
+
class SimpleRecord:
""" record-like class """
def __init__(self, **kw):
self.__dict__.update(kw)
+
+# BBB: for Zope 2.7
+class BBBTransaction:
+
+ def begin(self):
+ get_transaction().begin()
+
+ def commit(self, sub=False):
+ get_transaction().commit(sub)
+
+ def abort(self, sub=False):
+ get_transaction().abort(sub)
+
+transaction = BBBTransaction()
More information about the CMF-checkins
mailing list