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
54b4525e
Commit
54b4525e
authored
Jan 03, 2009
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- made InitializeClass the default name
parent
e9a4608e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lib/python/App/class_init.py
lib/python/App/class_init.py
+9
-6
No files found.
lib/python/App/class_init.py
View file @
54b4525e
...
@@ -7,21 +7,24 @@
...
@@ -7,21 +7,24 @@
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# FOR A PARTICULAR PURPOSE
.
#
#
##############################################################################
##############################################################################
"""Class initialization.
$Id$
"""
import
logging
import
logging
from
AccessControl.Permission
import
ApplicationDefaultPermissions
# BBB
from
AccessControl.Permission
import
ApplicationDefaultPermissions
# BBB
def
InitializeClass
(
self
):
def
default__class_init__
(
self
):
from
AccessControl.Permission
import
registerPermissions
from
AccessControl.Permission
import
registerPermissions
from
AccessControl.PermissionRole
import
PermissionRole
from
AccessControl.PermissionRole
import
PermissionRole
dict
=
self
.
__dict__
dict
=
self
.
__dict__
have
=
dict
.
has_key
have
=
dict
.
has_key
ft
=
type
(
default__class_init__
)
ft
=
type
(
InitializeClass
)
dict_items
=
dict
.
items
()
dict_items
=
dict
.
items
()
for
name
,
v
in
dict_items
:
for
name
,
v
in
dict_items
:
...
@@ -71,7 +74,7 @@ def default__class_init__(self):
...
@@ -71,7 +74,7 @@ def default__class_init__(self):
roles
=
acp
[
2
]
roles
=
acp
[
2
]
pr
=
PermissionRole
(
pname
,
roles
)
pr
=
PermissionRole
(
pname
,
roles
)
else
:
else
:
pr
=
PermissionRole
(
pname
)
pr
=
PermissionRole
(
pname
)
for
mname
in
mnames
:
for
mname
in
mnames
:
setattr
(
self
,
mname
+
'__roles__'
,
pr
)
setattr
(
self
,
mname
+
'__roles__'
,
pr
)
if
mname
and
not
hasattr
(
self
,
mname
):
if
mname
and
not
hasattr
(
self
,
mname
):
...
@@ -80,4 +83,4 @@ def default__class_init__(self):
...
@@ -80,4 +83,4 @@ def default__class_init__(self):
"nonexistent method %r"
,
self
.
__module__
,
"nonexistent method %r"
,
self
.
__module__
,
self
.
__name__
,
mname
)
self
.
__name__
,
mname
)
InitializeClass
=
default__class_init__
# instead of Globals.Initializ
e
default__class_init__
=
InitializeClass
# BBB: old nam
e
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