[Checkins] SVN: zope.paste/trunk/ Support a 'features' config option in the PasteDeploy INI file.
Marius Gedminas
cvs-admin at zope.org
Mon Aug 20 15:02:29 UTC 2012
Log message for revision 127531:
Support a 'features' config option in the PasteDeploy INI file.
Changed:
U zope.paste/trunk/CHANGES.txt
U zope.paste/trunk/zope/paste/factory.py
-=-
Modified: zope.paste/trunk/CHANGES.txt
===================================================================
--- zope.paste/trunk/CHANGES.txt 2012-08-20 15:02:18 UTC (rev 127530)
+++ zope.paste/trunk/CHANGES.txt 2012-08-20 15:02:25 UTC (rev 127531)
@@ -7,7 +7,16 @@
- Add this changelog, reconstructed from svn logs and release dates on
PyPI.
+- Support a 'features' config option in the PasteDeploy INI file, which
+ can contain a space-separated list of feature names. These can be
+ tested for in ZCML files with the <*directive*
+ zcml:condition="have *featurename*"> syntax.
+ Previously the only feature that could be enabled was 'devmode' and
+ it had its own option. For backwards compatibility, ``devmode = on``
+ adds a 'devmode' feature to the feature list.
+
+
0.3 (2007-06-02)
~~~~~~~~~~~~~~~~
Modified: zope.paste/trunk/zope/paste/factory.py
===================================================================
--- zope.paste/trunk/zope/paste/factory.py 2012-08-20 15:02:18 UTC (rev 127530)
+++ zope.paste/trunk/zope/paste/factory.py 2012-08-20 15:02:25 UTC (rev 127531)
@@ -23,13 +23,16 @@
_zope_app = None
def zope_app_factory(global_conf, site_definition, file_storage=None,
- db_definition=None, devmode='no'):
+ db_definition=None, devmode='no', features=''):
global _zope_app
if _zope_app is not None:
return _zope_app
# load ZCML (usually site.zcml)
- features = ()
+ if isinstance(features, str):
+ features = tuple(features.split())
+ else:
+ features = tuple(features)
if devmode.lower() in ('yes', 'true', 'on'):
features += ('devmode',)
filename = os.path.join(global_conf['here'], site_definition)
More information about the checkins
mailing list