[Zope-Checkins] SVN: Zope/trunk/ Reuse IInclude from zope.configuration.xmlconfig.
Hanno Schlichting
hannosch at hannosch.eu
Fri Jan 1 12:27:26 EST 2010
Log message for revision 107506:
Reuse IInclude from zope.configuration.xmlconfig.
Changed:
U Zope/trunk/doc/CHANGES.rst
U Zope/trunk/src/Products/Five/fiveconfigure.py
U Zope/trunk/src/Products/Five/fivedirectives.py
U Zope/trunk/src/Products/Five/meta.zcml
-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst 2010-01-01 17:23:01 UTC (rev 107505)
+++ Zope/trunk/doc/CHANGES.rst 2010-01-01 17:27:25 UTC (rev 107506)
@@ -11,6 +11,10 @@
Restructuring
+++++++++++++
+- Reuse IInclude from zope.configuration.xmlconfig.
+
+- Reuse IMenuItemType from zope.browsermenu.
+
- Moved TaintedString from ZPublisher to Shared.
This resolves a circular import issue.
Modified: Zope/trunk/src/Products/Five/fiveconfigure.py
===================================================================
--- Zope/trunk/src/Products/Five/fiveconfigure.py 2010-01-01 17:23:01 UTC (rev 107505)
+++ Zope/trunk/src/Products/Five/fiveconfigure.py 2010-01-01 17:27:25 UTC (rev 107506)
@@ -59,11 +59,14 @@
# side. //regebro
LOG.error('Could not import Product %s' % product.__name__, exc_info=True)
-def loadProducts(_context, file=None):
+def loadProducts(_context, file=None, files=None, package=None):
if file is None:
# set the default
file = 'configure.zcml'
-
+
+ if files is not None or package is not None:
+ raise ValueError("Neither the files or package argument is supported.")
+
# now load the files if they exist
for product in findProducts():
zcml = os.path.join(os.path.dirname(product.__file__), file)
@@ -73,11 +76,14 @@
except: # Yes, really, *any* kind of error.
handleBrokenProduct(product)
-def loadProductsOverrides(_context, file=None):
+def loadProductsOverrides(_context, file=None, files=None, package=None):
if file is None:
# set the default
file = 'overrides.zcml'
-
+
+ if files is not None or package is not None:
+ raise ValueError("Neither the files or package argument is supported.")
+
# now load the files if they exist
for product in findProducts():
zcml = os.path.join(os.path.dirname(product.__file__), file)
Modified: Zope/trunk/src/Products/Five/fivedirectives.py
===================================================================
--- Zope/trunk/src/Products/Five/fivedirectives.py 2010-01-01 17:23:01 UTC (rev 107505)
+++ Zope/trunk/src/Products/Five/fivedirectives.py 2010-01-01 17:27:25 UTC (rev 107506)
@@ -20,8 +20,9 @@
from zope.security.zcml import Permission
from zope.configuration.fields import GlobalObject, Tokens, PythonIdentifier
from zope.configuration.fields import Bool
-from zope.schema import ASCII, TextLine, BytesLine
+from zope.schema import ASCII, TextLine
+
class IImplementsDirective(Interface):
"""State that a class implements something.
"""
@@ -147,16 +148,6 @@
)
-
-class IInclude(Interface):
-
- file = BytesLine(
- title=u'Configuration file name',
- description=u'Name of a configuration file to be included for each '
- u'installed Product. If the file does not exist, for a '
- u'particular product, no error is raised.',
- required=False)
-
class IRegisterPackageDirective(Interface):
"""Registers the given python package which at a minimum fools zope2 into
thinking of it as a zope2 product.
@@ -173,3 +164,10 @@
u'with a ProductContext instance',
required=False
)
+
+
+from zope.deferredimport import deprecated
+
+deprecated("Please import from zope.configuration.xmlconfig",
+ IInclude = 'zope.configuration.xmlconfig:IInclude',
+)
Modified: Zope/trunk/src/Products/Five/meta.zcml
===================================================================
--- Zope/trunk/src/Products/Five/meta.zcml 2010-01-01 17:23:01 UTC (rev 107505)
+++ Zope/trunk/src/Products/Five/meta.zcml 2010-01-01 17:27:25 UTC (rev 107506)
@@ -25,13 +25,13 @@
<meta:directive
name="loadProducts"
- schema=".fivedirectives.IInclude"
+ schema="zope.configuration.xmlconfig.IInclude"
handler=".fiveconfigure.loadProducts"
/>
<meta:directive
name="loadProductsOverrides"
- schema=".fivedirectives.IInclude"
+ schema="zope.configuration.xmlconfig.IInclude"
handler=".fiveconfigure.loadProductsOverrides"
/>
More information about the Zope-Checkins
mailing list