[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/ Oops, fix some tests I broke. So sorry, I really thought I had the

Ross Patterson me at rpatterson.net
Tue Nov 27 14:34:20 EST 2007


Log message for revision 81991:
  
  Oops, fix some tests I broke.  So sorry, I really thought I had the
  tests passing before I committed.
  

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/metadata.py
  U   Products.GenericSetup/trunk/Products/GenericSetup/registry.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/metadata.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/metadata.py	2007-11-26 23:54:10 UTC (rev 81990)
+++ Products.GenericSetup/trunk/Products/GenericSetup/metadata.py	2007-11-27 19:34:19 UTC (rev 81991)
@@ -16,7 +16,7 @@
 """
 import os
 
-from utils import ImportConfiguratorBase
+from utils import ImportConfiguratorBase, _getProductPath
 from utils import CONVERTER, DEFAULT, KEY
 
 METADATA_XML = 'metadata.xml'
@@ -25,11 +25,21 @@
     """ Extracts profile metadata from metadata.xml file.
     """
 
-    def __init__( self, path, encoding=None ):
+    def __init__( self, path, encoding=None, product=None ):
 
         # don't call the base class __init__ b/c we don't have (or need)
         # a site
+
         self._path = path
+        if product is not None:
+            # Handle relative paths
+            try:
+                product_path = _getProductPath(product)
+            except ValueError:
+                pass
+            else:
+                self._path = os.path.join(product_path, path)
+
         self._encoding = encoding
 
     def __call__( self ):

Modified: Products.GenericSetup/trunk/Products/GenericSetup/registry.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/registry.py	2007-11-26 23:54:10 UTC (rev 81990)
+++ Products.GenericSetup/trunk/Products/GenericSetup/registry.py	2007-11-27 19:34:19 UTC (rev 81991)
@@ -38,7 +38,6 @@
 from utils import _resolveDottedName
 from utils import _extractDocstring
 from utils import _computeTopologicalSort
-from utils import _getProductPath
 
 
 class BaseStepRegistry( Implicit ):
@@ -552,8 +551,7 @@
                , 'for': for_
                }
 
-        metadata = ProfileMetadata(
-            os.path.join(_getProductPath(product), path) )()
+        metadata = ProfileMetadata(path, product=product)()
 
         version = metadata.get( 'version', None )
         if version is None and product is not None:



More information about the Checkins mailing list