[CMF-checkins] CVS: CMF/CMFSetup - context.py:1.13

Yvo Schubbe y.2004_ at wcm-solutions.de
Thu Aug 5 04:31:22 EDT 2004


Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv21590/CMFSetup

Modified Files:
	context.py 
Log Message:
- changed getSite(): it now removes the setup context from _site's acquisition chain to fix role / permission export
  (sometimes I hate implicit acquisition)
- sorted imports


=== CMF/CMFSetup/context.py 1.12 => 1.13 ===
--- CMF/CMFSetup/context.py:1.12	Tue Jul 20 17:53:20 2004
+++ CMF/CMFSetup/context.py	Thu Aug  5 04:31:22 2004
@@ -6,14 +6,15 @@
 """
 import os
 import time
+from StringIO import StringIO
 from tarfile import TarFile
 from tarfile import TarInfo
-from StringIO import StringIO
 
 from AccessControl import ClassSecurityInfo
-from Acquisition import Implicit
 from Acquisition import aq_inner
 from Acquisition import aq_parent
+from Acquisition import aq_self
+from Acquisition import Implicit
 from DateTime.DateTime import DateTime
 from Globals import InitializeClass
 from OFS.DTMLDocument import DTMLDocument
@@ -23,9 +24,10 @@
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from Products.PythonScripts.PythonScript import PythonScript
 
-from permissions import ManagePortal
-from interfaces import IImportContext
 from interfaces import IExportContext
+from interfaces import IImportContext
+from permissions import ManagePortal
+
 
 class DirectoryImportContext( Implicit ):
 
@@ -50,7 +52,7 @@
 
         """ See ISetupContext.
         """
-        return self._site
+        return aq_self(self._site)
 
     security.declareProtected( ManagePortal, 'getEncoding' )
     def getEncoding( self ):
@@ -109,7 +111,7 @@
         """
         if path is None:
             path = ''
-            
+
         full_path = os.path.join( self._profile_path, path )
 
         if not os.path.exists( full_path ) or not os.path.isdir( full_path ):
@@ -128,6 +130,7 @@
 
 InitializeClass( DirectoryImportContext )
 
+
 class DirectoryExportContext( Implicit ):
 
     __implements__ = ( IExportContext, )
@@ -144,7 +147,7 @@
 
         """ See ISetupContext.
         """
-        return self._site
+        return aq_self(self._site)
 
     security.declareProtected( ManagePortal, 'writeDataFile' )
     def writeDataFile( self, filename, text, content_type, subdir=None ):
@@ -169,6 +172,7 @@
 
 InitializeClass( DirectoryExportContext )
 
+
 class TarballExportContext( Implicit ):
 
     __implements__ = ( IExportContext, )
@@ -192,7 +196,7 @@
 
         """ See ISetupContext.
         """
-        return self._site
+        return aq_self(self._site)
 
     security.declareProtected( ManagePortal, 'writeDataFile' )
     def writeDataFile( self, filename, text, content_type, subdir=None ):
@@ -225,6 +229,7 @@
 
 InitializeClass( TarballExportContext )
 
+
 class SnapshotExportContext( Implicit ):
 
     __implements__ = ( IExportContext, )
@@ -242,7 +247,7 @@
 
         """ See ISetupContext.
         """
-        return self._site
+        return aq_self(self._site)
 
     security.declareProtected( ManagePortal, 'writeDataFile' )
     def writeDataFile( self, filename, text, content_type, subdir=None ):
@@ -348,7 +353,7 @@
 
         """ See ISetupContext.
         """
-        return self._site
+        return aq_self(self._site)
 
     security.declareProtected( ManagePortal, 'getEncoding' )
     def getEncoding( self ):



More information about the CMF-checkins mailing list