Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1576370d
Commit
1576370d
authored
Jan 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse IInclude from zope.configuration.xmlconfig.
parent
a8b7cd82
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
17 deletions
+25
-17
doc/CHANGES.rst
doc/CHANGES.rst
+4
-0
src/Products/Five/fiveconfigure.py
src/Products/Five/fiveconfigure.py
+10
-4
src/Products/Five/fivedirectives.py
src/Products/Five/fivedirectives.py
+9
-11
src/Products/Five/meta.zcml
src/Products/Five/meta.zcml
+2
-2
No files found.
doc/CHANGES.rst
View file @
1576370d
...
...
@@ -11,6 +11,10 @@ Trunk (unreleased)
Restructuring
+++++++++++++
- Reuse IInclude from zope.configuration.xmlconfig.
- Reuse IMenuItemType from zope.browsermenu.
- Moved TaintedString from ZPublisher to Shared.
This resolves a circular import issue.
...
...
src/Products/Five/fiveconfigure.py
View file @
1576370d
...
...
@@ -59,11 +59,14 @@ def handleBrokenProduct(product):
# 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 @@ def loadProducts(_context, file=None):
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
)
...
...
src/Products/Five/fivedirectives.py
View file @
1576370d
...
...
@@ -20,7 +20,8 @@ from zope.browserresource.metadirectives import IBasicResourceInformation
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 IRegisterClassDirective(Interface):
)
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 @@ class IRegisterPackageDirective(Interface):
u'with a ProductContext instance'
,
required
=
False
)
from
zope.deferredimport
import
deprecated
deprecated
(
"Please import from zope.configuration.xmlconfig"
,
IInclude
=
'zope.configuration.xmlconfig:IInclude'
,
)
src/Products/Five/meta.zcml
View file @
1576370d
...
...
@@ -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"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment