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
da088f0b
Commit
da088f0b
authored
Jul 11, 2012
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- more syncing with zope.browserpage
parent
b4d37a31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
src/Products/Five/browser/metaconfigure.py
src/Products/Five/browser/metaconfigure.py
+20
-10
No files found.
src/Products/Five/browser/metaconfigure.py
View file @
da088f0b
...
...
@@ -18,14 +18,17 @@ namespace in ZCML known from zope.app.
"""
import
os
import
sys
from
inspect
import
ismethod
from
zope.component
import
queryMultiAdapter
from
zope.component.interface
import
provideInterface
from
zope.component.zcml
import
handler
from
zope.configuration.exceptions
import
ConfigurationError
from
zope.interface
import
classImplements
from
zope.interface
import
Interface
from
zope.publisher.interfaces
import
NotFound
from
zope.publisher.interfaces.browser
import
IBrowserPublisher
from
zope.publisher.interfaces.browser
import
IBrowserRequest
from
zope.publisher.interfaces.browser
import
IDefaultBrowserLayer
from
zope.security.zcml
import
Permission
...
...
@@ -122,14 +125,17 @@ def page(_context, name, permission, for_=Interface,
# class and template
new_class
=
SimpleViewClass
(
template
,
bases
=
(
class_
,
),
name
=
name
)
else
:
cdict
=
getSecurityInfo
(
class_
)
if
not
hasattr
(
class_
,
'browserDefault'
):
cdict
.
update
(
{
cdict
=
{
'browserDefault'
:
lambda
self
,
request
:
(
getattr
(
self
,
attribute
),
())
})
}
else
:
cdict
=
{}
cdict
[
'__name__'
]
=
name
cdict
[
'__page_attribute__'
]
=
attribute
cdict
.
update
(
getSecurityInfo
(
class_
))
new_class
=
type
(
class_
.
__name__
,
(
class_
,
simple
,),
cdict
)
if
attribute
!=
"__call__"
:
...
...
@@ -146,6 +152,9 @@ def page(_context, name, permission, for_=Interface,
func
=
func
.
im_func
func
.
__doc__
=
"Stub docstring to make ZPublisher work"
if
hasattr
(
class_
,
'__implements__'
):
classImplements
(
new_class
,
IBrowserPublisher
)
else
:
# template
new_class
=
SimpleViewClass
(
template
,
name
=
name
)
...
...
@@ -444,16 +453,17 @@ class ViewMixinForTemplates(zope.browserpage.simpleviewclass.simple):
# Original version: zope.browserpage.simpleviewclass.SimpleViewClass
def
SimpleViewClass
(
src
,
offering
=
None
,
used_for
=
None
,
bases
=
(),
name
=
u''
):
if
bases
:
cdict
=
getSecurityInfo
(
bases
[
0
])
else
:
cdict
=
{}
cdict
.
update
({
'index'
:
ViewPageTemplateFile
(
src
,
offering
),
'__name__'
:
name
})
if
offering
is
None
:
offering
=
sys
.
_getframe
(
1
).
f_globals
bases
+=
(
ViewMixinForTemplates
,)
class_
=
type
(
"SimpleViewClass from %s"
%
src
,
bases
,
cdict
)
cdict
=
{
'index'
:
ViewPageTemplateFile
(
src
,
offering
),
'__name__'
:
name
}
if
bases
:
cdict
.
update
(
getSecurityInfo
(
bases
[
0
]))
class_
=
type
(
"SimpleViewClass from %s"
%
src
,
bases
,
cdict
)
if
used_for
is
not
None
:
class_
.
__used_for__
=
used_for
...
...
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