[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/
We said we would remove this, so lets do it
Wichert Akkerman
wichert at wiggy.net
Fri Apr 11 16:33:40 EDT 2008
Log message for revision 85258:
We said we would remove this, so lets do it
Changed:
U Products.GenericSetup/trunk/Products/GenericSetup/registry.py
U Products.GenericSetup/trunk/Products/GenericSetup/tests/test_profile_metadata.py
-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/registry.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/registry.py 2008-04-11 16:01:07 UTC (rev 85257)
+++ Products.GenericSetup/trunk/Products/GenericSetup/registry.py 2008-04-11 20:33:39 UTC (rev 85258)
@@ -723,32 +723,6 @@
metadata = ProfileMetadata(path, product=product)()
- version = metadata.get( 'version', None )
- if version is None and product is not None:
- prod_name = product.split('.')[-1]
- prod_module = getattr(App.Product.Products, prod_name, None)
- if prod_module is not None:
- prod_path = prod_module.__path__[0]
-
- # Retrieve version number from any suitable version.txt
- for fname in ('version.txt', 'VERSION.txt', 'VERSION.TXT'):
- try:
- fpath = os.path.join( prod_path, fname )
- fhandle = open( fpath, 'r' )
- version = fhandle.read().strip()
- fhandle.close()
- warn('Version for profile %s taken from version.txt. '
- 'This is deprecated behaviour and will be '
- 'removed in GenericSetup 1.5: please specify '
- 'the version in metadata.xml.' % profile_id,
- DeprecationWarning)
- break
- except IOError:
- continue
-
- if version is not None:
- metadata[ 'version' ] = version
-
# metadata.xml description trumps ZCML description... awkward
info.update( metadata )
Modified: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_profile_metadata.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tests/test_profile_metadata.py 2008-04-11 16:01:07 UTC (rev 85257)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tests/test_profile_metadata.py 2008-04-11 20:33:39 UTC (rev 85258)
@@ -54,26 +54,6 @@
parsed = metadata.parseXML( _METADATA_XML )
self.assertEqual(parsed, _METADATA_MAP)
- def test_versionFromProduct(self):
- import warnings
- warnings.filterwarnings('ignore')
- try:
- profile_id = 'dummy_profile'
- product_name = 'GenericSetup'
- directory = os.path.split(__file__)[0]
- path = os.path.join(directory, 'default_profile')
- profile_registry.registerProfile( profile_id,
- 'Dummy Profile',
- 'This is a dummy profile',
- path,
- product=product_name)
- profile_info = profile_registry.getProfileInfo(
- '%s:%s' % (product_name, profile_id))
- product = getattr(self.app.Control_Panel.Products, product_name)
- self.assertEqual(profile_info['version'], product.version)
- finally:
- warnings.resetwarnings()
-
def test_relativePath(self):
profile_id = 'dummy_profile2'
product_name = 'GenericSetup'
More information about the Checkins
mailing list