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
592d22c3
Commit
592d22c3
authored
Feb 16, 2012
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- LP #933307: Fixed ++skin++ namespace handling.
parent
d499c14e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
6 deletions
+35
-6
doc/CHANGES.rst
doc/CHANGES.rst
+4
-0
src/Products/Five/browser/tests/pages.py
src/Products/Five/browser/tests/pages.py
+17
-1
src/Products/Five/browser/tests/skin.txt
src/Products/Five/browser/tests/skin.txt
+5
-3
src/Products/Five/browser/tests/skin.zcml
src/Products/Five/browser/tests/skin.zcml
+1
-1
src/ZPublisher/HTTPRequest.py
src/ZPublisher/HTTPRequest.py
+8
-1
No files found.
doc/CHANGES.rst
View file @
592d22c3
...
...
@@ -8,6 +8,10 @@ http://docs.zope.org/zope2/releases/.
2.13.13 (unreleased)
--------------------
- LP #933307: Fixed ++skin++ namespace handling.
Ported the ``shiftNameToApplication`` implementation from zope.publisher to
ZPublisher.HTTPRequest.HTTPRequest.
- Ensure that ObjectManager's ``get`` and ``__getitem__`` methods return only
"items" (no attributes / methods from the class or from acquisition).
Thanks to Richard Mitchell at Netsight for the report.
...
...
src/Products/Five/browser/tests/pages.py
View file @
592d22c3
...
...
@@ -18,45 +18,59 @@ from Products.Five import BrowserView
from
Products.Five.browser.pagetemplatefile
import
ViewPageTemplateFile
from
OFS.SimpleItem
import
SimpleItem
class
SimpleView
(
BrowserView
):
"""More docstring. Please Zope"""
def
eagle
(
self
):
"""Docstring"""
return
u"The eagle has landed"
def
eagle2
(
self
):
"""Docstring"""
return
u"The eagle has landed:
\
n
%s"
%
self
.
context
.
absolute_url
()
def
mouse
(
self
):
"""Docstring"""
return
u"The mouse has been eaten by the eagle"
class
FancyView
(
BrowserView
):
"""Fancy, fancy stuff"""
def
view
(
self
):
return
u"Fancy, fancy"
class
CallView
(
BrowserView
):
def
__call__
(
self
):
return
u"I was __call__()'ed"
class
PermissionView
(
BrowserView
,
SimpleItem
):
def
__call__
(
self
):
return
u"I was __call__()'ed"
class
CallTemplate
(
BrowserView
):
__call__
=
ViewPageTemplateFile
(
'falcon.pt'
)
class
CallableNoDocstring
:
def
__call__
(
self
):
return
u"No docstring"
def
function_no_docstring
(
self
):
return
u"No docstring"
class
NoDocstringView
(
BrowserView
):
def
method
(
self
):
...
...
@@ -66,7 +80,9 @@ class NoDocstringView(BrowserView):
object
=
CallableNoDocstring
()
class
NewStyleClass
(
object
):
"""
This is a testclass to verify that new style classes work
in browser:page
...
...
src/Products/Five/browser/tests/skin.txt
View file @
592d22c3
...
...
@@ -25,11 +25,12 @@ why we can't access it straight away:
It works when we explicitly use the skin that includes that layer:
>>> print http(r"""
... GET /
test_folder_1_/testoid/++skin++TestSkin
/eagle.html HTTP/1.1
... GET /
++skin++TestSkin/test_folder_1_/testoid
/eagle.html HTTP/1.1
... """)
HTTP/1.1 200 OK
...
The eagle has landed
The eagle has landed:
http://localhost/++skin++TestSkin/test_folder_1_/testoid
Or when we make that skin the default skin:
...
...
@@ -44,7 +45,8 @@ Or when we make that skin the default skin:
... """)
HTTP/1.1 200 OK
...
The eagle has landed
The eagle has landed:
http://localhost/test_folder_1_/testoid
Clean up
...
...
src/Products/Five/browser/tests/skin.zcml
View file @
592d22c3
...
...
@@ -14,7 +14,7 @@
<browser:page
for="Products.Five.tests.testing.simplecontent.ISimpleContent"
class=".pages.SimpleView"
attribute="eagle"
attribute="eagle
2
"
name="eagle.html"
permission="zope2.Public"
layer=".skin.ITestSkin"
...
...
src/ZPublisher/HTTPRequest.py
View file @
592d22c3
...
...
@@ -1528,9 +1528,16 @@ class HTTPRequest(BaseRequest):
def
taintWrapper
(
self
,
enabled
=
TAINTING_ENABLED
):
return
enabled
and
TaintRequestWrapper
(
self
)
or
self
# Original version: zope.publisher.http.HTTPRequest.shiftNameToApplication
def
shiftNameToApplication
(
self
):
"""see zope.publisher.interfaces.http.IVirtualHostRequest"""
# this is needed for ++skin++
if
len
(
self
.
_steps
)
==
1
:
self
.
_script
.
append
(
self
.
_steps
.
pop
())
self
.
_resetURLS
()
return
raise
ValueError
(
"Can only shift leading traversal "
"names to application names"
)
def
getURL
(
self
):
return
self
.
URL
...
...
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