[CMF-checkins] CVS: CMF/CMFSetup - interfaces.py:1.9 registry.py:1.10 tool.py:1.11

Tres Seaver tseaver at zope.com
Tue May 25 09:18:52 EDT 2004


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

Modified Files:
	interfaces.py registry.py tool.py 
Log Message:


  - interfaces.py, registry.py:

    o Conform spelling of import / export methods to those being used
      elsewhere.

  - tool.py:

    o Conform spelling of import / export methods to those being used
      elsewhere.

    o Take an optional encoding to 'setProfileDirectory', and propagate.

  - tests/*.py:

    o Add sample tests for explicitly passed encodings.


=== CMF/CMFSetup/interfaces.py 1.8 => 1.9 ===
--- CMF/CMFSetup/interfaces.py:1.8	Tue May 25 08:48:53 2004
+++ CMF/CMFSetup/interfaces.py	Tue May 25 09:18:21 2004
@@ -155,14 +155,14 @@
         o The 'handler' metadata is available via 'getStep'.
         """
 
-    def exportAsXML():
+    def generateXML():
 
         """ Return a round-trippable XML representation of the registry.
 
         o 'handler' values are serialized using their dotted names.
         """
 
-    def importFromXML( text ):
+    def parseXML( text ):
 
         """ Parse 'text' into a clean registry.
         """


=== CMF/CMFSetup/registry.py 1.9 => 1.10 ===
--- CMF/CMFSetup/registry.py:1.9	Tue May 25 08:48:53 2004
+++ CMF/CMFSetup/registry.py	Tue May 25 09:18:21 2004
@@ -105,8 +105,8 @@
         step_ids.sort()
         return [ self.getStepMetadata( x ) for x in step_ids ]
 
-    security.declareProtected( ManagePortal, 'exportAsXML' )
-    def exportAsXML( self ):
+    security.declareProtected( ManagePortal, 'generateXML' )
+    def generateXML( self ):
 
         """ Return a round-trippable XML representation of the registry.
 
@@ -190,8 +190,8 @@
 
         self._registered[ id ] = info
 
-    security.declarePrivate( 'importFromXML' )
-    def importFromXML( self, text, encoding=None ):
+    security.declarePrivate( 'parseXML' )
+    def parseXML( self, text, encoding=None ):
 
         """ Parse 'text' into a clean registry.
         """
@@ -375,8 +375,8 @@
         step_ids.sort()
         return [ self.getStepMetadata( x ) for x in step_ids ]
 
-    security.declareProtected( ManagePortal, 'exportAsXML' )
-    def exportAsXML( self ):
+    security.declareProtected( ManagePortal, 'generateXML' )
+    def generateXML( self ):
 
         """ Return a round-trippable XML representation of the registry.
 
@@ -436,8 +436,8 @@
 
         self._registered[ id ] = info
 
-    security.declarePrivate( 'importFromXML' )
-    def importFromXML( self, text, encoding=None ):
+    security.declarePrivate( 'parseXML' )
+    def parseXML( self, text, encoding=None ):
 
         """ Parse 'text' into a clean registry.
         """


=== CMF/CMFSetup/tool.py 1.10 => 1.11 ===
--- CMF/CMFSetup/tool.py:1.10	Mon May 24 15:53:56 2004
+++ CMF/CMFSetup/tool.py	Tue May 25 09:18:21 2004
@@ -71,7 +71,7 @@
                )
 
     security.declareProtected( ManagePortal, 'setProfileDirectory' )
-    def setProfileDirectory( self, path, product_name=None ):
+    def setProfileDirectory( self, path, product_name=None, encoding=None ):
 
         """ See ISetupTool.
         """
@@ -96,8 +96,8 @@
         self._profile_directory = path
         self._product_name = product_name
 
-        self._updateImportStepsRegistry()
-        self._updateExportStepsRegistry()
+        self._updateImportStepsRegistry( encoding )
+        self._updateExportStepsRegistry( encoding )
     
     security.declareProtected( ManagePortal, 'getImportStepRegistry' )
     def getImportStepRegistry( self ):
@@ -403,7 +403,7 @@
         return self._profile_directory
 
     security.declarePrivate( '_updateImportStepsRegistry' )
-    def _updateImportStepsRegistry( self ):
+    def _updateImportStepsRegistry( self, encoding ):
 
         """ Update our import steps registry from our profile.
         """
@@ -413,10 +413,10 @@
         xml = f.read()
         f.close()
 
-        self._import_registry.importFromXML( xml )
+        self._import_registry.parseXML( xml, encoding )
 
     security.declarePrivate( '_updateExportStepsRegistry' )
-    def _updateExportStepsRegistry( self ):
+    def _updateExportStepsRegistry( self, encoding ):
 
         """ Update our export steps registry from our profile.
         """
@@ -426,7 +426,7 @@
         xml = f.read()
         f.close()
 
-        self._export_registry.importFromXML( xml )
+        self._export_registry.parseXML( xml, encoding )
 
     security.declarePrivate( '_doRunImportStep' )
     def _doRunImportStep( self, step_id, context ):
@@ -474,10 +474,10 @@
     site = context.getSite()
     tool = getToolByName( site, 'portal_setup' )
 
-    import_steps_xml = tool.getImportStepRegistry().exportAsXML()
+    import_steps_xml = tool.getImportStepRegistry().generateXML()
     context.writeDataFile( 'import_steps.xml', import_steps_xml, 'text/xml' )
 
-    export_steps_xml = tool.getExportStepRegistry().exportAsXML()
+    export_steps_xml = tool.getExportStepRegistry().generateXML()
     context.writeDataFile( 'export_steps.xml', export_steps_xml, 'text/xml' )
 
     return 'Step registries exported'




More information about the CMF-checkins mailing list