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
9d22d6e2
Commit
9d22d6e2
authored
Nov 15, 2008
by
Malthe Borch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward-ported viewlet manager directive fix (see c69896).
parent
197985ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
doc/CHANGES.txt
doc/CHANGES.txt
+4
-0
lib/python/Products/Five/viewlet/manager.py
lib/python/Products/Five/viewlet/manager.py
+7
-5
No files found.
doc/CHANGES.txt
View file @
9d22d6e2
...
...
@@ -219,6 +219,10 @@ Zope Changes
Bugs Fixed
- Ported c69896 to Five. This fix makes it possible to provide a
template using Python, and not have it being set to `None` by
the viewlet manager directive.
- Made Five.testbrowser compatible with mechanize 0.1.7b.
- Ensure that response header values cannot embed CRLF pairs, which
...
...
lib/python/Products/Five/viewlet/manager.py
View file @
9d22d6e2
...
...
@@ -27,6 +27,8 @@ from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
class
ViewletManagerBase
(
origManagerBase
):
"""A base class for Viewlet managers to work in Zope2"""
template
=
None
def
__getitem__
(
self
,
name
):
"""See zope.interface.common.mapping.IReadMapping"""
# Find the viewlet
...
...
@@ -75,9 +77,10 @@ class ViewletManagerBase(origManagerBase):
return
sorted
(
viewlets
,
lambda
x
,
y
:
cmp
(
aq_base
(
x
[
1
]),
aq_base
(
y
[
1
])))
def
ViewletManager
(
name
,
interface
,
template
=
None
,
bases
=
()):
attrDict
=
{
'__name__'
:
name
}
if
template
is
not
None
:
template
=
ZopeTwoPageTemplateFile
(
template
)
attrDict
[
'template'
]
=
ZopeTwoPageTemplateFile
(
template
)
if
ViewletManagerBase
not
in
bases
:
# Make sure that we do not get a default viewlet manager mixin, if the
...
...
@@ -87,8 +90,7 @@ def ViewletManager(name, interface, template=None, bases=()):
bases
=
bases
+
(
ViewletManagerBase
,)
ViewletManager
=
type
(
'<ViewletManager providing %s>'
%
interface
.
getName
(),
bases
,
{
'template'
:
template
,
'__name__'
:
name
})
'<ViewletManager providing %s>'
%
interface
.
getName
(),
bases
,
attrDict
)
zope
.
interface
.
classImplements
(
ViewletManager
,
interface
)
return
ViewletManager
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