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
f54da6de
Commit
f54da6de
authored
Apr 19, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed to use new Product registration mechanism to register
"builtin" subclassable things.
parent
02368d66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+7
-15
No files found.
lib/python/ZClasses/ZClass.py
View file @
f54da6de
...
@@ -84,8 +84,8 @@
...
@@ -84,8 +84,8 @@
##############################################################################
##############################################################################
"""Zope Classes
"""Zope Classes
"""
"""
import
Globals
,
string
,
OFS
.
SimpleItem
,
OFS
.
PropertySheets
import
Globals
,
string
,
OFS
.
SimpleItem
,
OFS
.
PropertySheets
,
Products
import
Method
,
Basic
,
Property
,
ObjectManager
,
AccessControl
.
Role
import
Method
,
Basic
,
Property
,
AccessControl
.
Role
from
ZPublisher.mapply
import
mapply
from
ZPublisher.mapply
import
mapply
from
ExtensionClass
import
Base
from
ExtensionClass
import
Base
...
@@ -96,16 +96,6 @@ from OFS.misc_ import p_
...
@@ -96,16 +96,6 @@ from OFS.misc_ import p_
p_
.
ZClass_Icon
=
ImageFile
(
'class.gif'
,
globals
())
p_
.
ZClass_Icon
=
ImageFile
(
'class.gif'
,
globals
())
builtins
=
(
(
'ObjectManager ObjectManager'
,
'Object Manager'
,
ObjectManager
.
ZObjectManager
),
)
builtin_classes
=
{}
builtin_names
=
{}
for
id
,
name
,
c
in
builtins
:
builtin_classes
[
id
]
=
c
builtin_names
[
id
]
=
name
class
PersistentClass
(
Base
):
class
PersistentClass
(
Base
):
def
__class_init__
(
self
):
pass
def
__class_init__
(
self
):
pass
...
@@ -117,15 +107,17 @@ def manage_addZClass(self, id, title='', baseclasses=[], REQUEST=None):
...
@@ -117,15 +107,17 @@ def manage_addZClass(self, id, title='', baseclasses=[], REQUEST=None):
"""
"""
bases
=
[]
bases
=
[]
for
b
in
baseclasses
:
for
b
in
baseclasses
:
if
builtin_classes
.
has_key
(
b
):
bases
.
append
(
builtin_classes
[
b
])
if
Products
.
meta_classes
.
has_key
(
b
):
else
:
bases
.
append
(
getattr
(
self
,
b
))
bases
.
append
(
Products
.
meta_classes
[
b
])
else
:
bases
.
append
(
getattr
(
self
,
b
))
self
.
_setObject
(
id
,
ZClass
(
id
,
title
,
bases
))
self
.
_setObject
(
id
,
ZClass
(
id
,
title
,
bases
))
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
manage_subclassableClassNames
(
self
):
def
manage_subclassableClassNames
(
self
):
r
=
{}
r
=
{}
r
.
update
(
builtin_names
)
r
.
update
(
Products
.
meta_class_info
)
while
1
:
while
1
:
if
not
hasattr
(
self
,
'objectItems'
):
break
if
not
hasattr
(
self
,
'objectItems'
):
break
...
...
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