[CMF-checkins] CVS: Products/CMFDefault - Document.py:1.74 Link.py:1.34

Yvo Schubbe y.2005- at wcm-solutions.de
Tue Apr 5 05:27:25 EDT 2005


Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv4750/CMFDefault

Modified Files:
	Document.py Link.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/CMFDefault/Document.py 1.73 => 1.74 ===
--- Products/CMFDefault/Document.py:1.73	Wed Oct 27 05:25:47 2004
+++ Products/CMFDefault/Document.py	Tue Apr  5 05:26:54 2005
@@ -15,29 +15,34 @@
 $Id$
 """
 
-from Globals import DTMLFile
-from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 from AccessControl import getSecurityManager
 from Acquisition import aq_base
 from DocumentTemplate.DT_Util import html_quote
+from Globals import DTMLFile
+from Globals import InitializeClass
 from StructuredText.StructuredText import HTML
+try:
+    import transaction
+except ImportError:
+    # BBB: for Zope 2.7
+    from Products.CMFCore.utils import transaction
 
 from Products.CMFCore.PortalContent import PortalContent
-from Products.CMFCore.utils import keywordsplitter
 from Products.CMFCore.utils import contributorsplitter
+from Products.CMFCore.utils import keywordsplitter
 
 from DublinCore import DefaultDublinCoreImpl
 from exceptions import EditingConflict
 from exceptions import ResourceLockedError
-from permissions import View
 from permissions import ModifyPortalContent
-from utils import parseHeadersBody
-from utils import formatRFC822Headers
-from utils import SimpleHTMLParser
-from utils import bodyfinder
+from permissions import View
 from utils import _dtmldir
+from utils import bodyfinder
+from utils import formatRFC822Headers
 from utils import html_headcheck
+from utils import parseHeadersBody
+from utils import SimpleHTMLParser
 
 factory_type_information = (
   { 'id'             : 'Document'
@@ -370,11 +375,11 @@
             # XXX Can we get an error msg through?  Should we be raising an
             #     exception, to be handled in the FTP mechanism?  Inquiring
             #     minds...
-            get_transaction().abort()
+            transaction.abort()
             RESPONSE.setStatus(450)
             return RESPONSE
         except ResourceLockedError, msg:
-            get_transaction().abort()
+            transaction.abort()
             RESPONSE.setStatus(423)
             return RESPONSE
 


=== Products/CMFDefault/Link.py 1.33 => 1.34 ===
--- Products/CMFDefault/Link.py:1.33	Tue Aug 24 17:12:58 2004
+++ Products/CMFDefault/Link.py	Tue Apr  5 05:26:54 2005
@@ -17,20 +17,26 @@
 
 import urlparse
 
-from Globals import InitializeClass, DTMLFile
 from AccessControl import ClassSecurityInfo
+from Globals import DTMLFile
+from Globals import InitializeClass
+try:
+    import transaction
+except ImportError:
+    # BBB: for Zope 2.7
+    from Products.CMFCore.utils import transaction
 from webdav.Lockable import ResourceLockedError
 
 from Products.CMFCore.PortalContent import PortalContent
-from Products.CMFCore.utils import keywordsplitter
 from Products.CMFCore.utils import contributorsplitter
+from Products.CMFCore.utils import keywordsplitter
 
 from DublinCore import DefaultDublinCoreImpl
-from permissions import View
 from permissions import ModifyPortalContent
+from permissions import View
+from utils import _dtmldir
 from utils import formatRFC822Headers
 from utils import parseHeadersBody
-from utils import _dtmldir
 
 factory_type_information = (
   { 'id'             : 'Link'
@@ -206,7 +212,7 @@
             RESPONSE.setStatus(204)
             return RESPONSE
         except ResourceLockedError, msg:
-            get_transaction().abort()
+            transaction.abort()
             RESPONSE.setStatus(423)
             return RESPONSE
 
@@ -223,10 +229,8 @@
 
     security.declareProtected(View, 'get_size')
     def get_size( self ):
-        """
-            Used for FTP and apparently the ZMI now too 
+        """ Used for FTP and apparently the ZMI now too.
         """
         return len(self.manage_FTPget())
 
 InitializeClass( Link )
-



More information about the CMF-checkins mailing list