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
07dc4664
Commit
07dc4664
authored
Feb 28, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applied changes from Hotfix_2001_02_23.
parent
3b4b2216
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
27 deletions
+42
-27
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+4
-4
lib/python/OFS/PropertyManager.py
lib/python/OFS/PropertyManager.py
+10
-3
lib/python/OFS/PropertySheets.py
lib/python/OFS/PropertySheets.py
+24
-20
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+4
-0
No files found.
lib/python/OFS/ObjectManager.py
View file @
07dc4664
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.12
6 2001/02/13 20:26:09 brian
Exp $"""
$Id: ObjectManager.py,v 1.12
7 2001/02/28 19:31:56 shane
Exp $"""
__version__
=
'$Revision: 1.12
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.12
7
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
Globals
,
CopySupport
,
Products
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -384,7 +384,7 @@ class ObjectManager(
def
objectMap
(
self
):
# Return a tuple of mappings containing subobject meta-data
return
self
.
_objects
return
map
(
lambda
dict
:
dict
.
copy
(),
self
.
_objects
)
def
objectIds_d
(
self
,
t
=
None
):
if
hasattr
(
self
,
'_reserved_names'
):
n
=
self
.
_reserved_names
...
...
@@ -413,7 +413,7 @@ class ObjectManager(
r
=
[]
a
=
r
.
append
for
d
in
self
.
_objects
:
if
d
[
'id'
]
not
in
n
:
a
(
d
)
if
d
[
'id'
]
not
in
n
:
a
(
d
.
copy
()
)
return
r
def
superValues
(
self
,
t
):
...
...
lib/python/OFS/PropertyManager.py
View file @
07dc4664
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property management"""
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
import
ExtensionClass
,
Globals
import
ZDOM
...
...
@@ -288,10 +288,17 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
"""Return a list of (id,property) tuples """
return
map
(
lambda
i
,
s
=
self
:
(
i
[
'id'
],
getattr
(
s
,
i
[
'id'
])),
self
.
_properties
)
def
propertyMap
(
self
):
def
_
propertyMap
(
self
):
"""Return a tuple of mappings, giving meta-data for properties """
return
self
.
_properties
def
propertyMap
(
self
):
"""
Return a tuple of mappings, giving meta-data for properties.
Return copies of the real definitions for security.
"""
return
map
(
lambda
dict
:
dict
.
copy
(),
self
.
_propertyMap
())
def
propertyLabel
(
self
,
id
):
"""Return a label for the given property id
"""
...
...
@@ -322,7 +329,7 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
get turned off will be ignored. Use manage_changeProperties()
instead for most situations.
"""
for
prop
in
self
.
propertyMap
():
for
prop
in
self
.
_
propertyMap
():
name
=
prop
[
'id'
]
if
'w'
in
prop
.
get
(
'mode'
,
'wd'
):
value
=
REQUEST
.
get
(
name
,
''
)
...
...
lib/python/OFS/PropertySheets.py
View file @
07dc4664
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__
=
'$Revision: 1.6
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
6
$'
[
11
:
-
2
]
import
time
,
string
,
App
.
Management
,
Globals
from
webdav.WriteLockInterface
import
WriteLockInterface
...
...
@@ -213,7 +213,7 @@ class PropertySheet(Traversable, Persistent, Implicit):
def
hasProperty
(
self
,
id
):
# Return a true value if a property exists with the given id.
for
prop
in
self
.
propertyMap
():
for
prop
in
self
.
_
propertyMap
():
if
id
==
prop
[
'id'
]:
return
1
return
0
...
...
@@ -312,36 +312,37 @@ class PropertySheet(Traversable, Persistent, Implicit):
def
propertyIds
(
self
):
# Return a list of property ids.
return
map
(
lambda
i
:
i
[
'id'
],
self
.
propertyMap
())
return
map
(
lambda
i
:
i
[
'id'
],
self
.
_
propertyMap
())
def
propertyValues
(
self
):
# Return a list of property values.
return
map
(
lambda
i
,
s
=
self
:
s
.
getProperty
(
i
[
'id'
]),
self
.
propertyMap
())
self
.
_
propertyMap
())
def
propertyItems
(
self
):
# Return a list of (id, property) tuples.
return
map
(
lambda
i
,
s
=
self
:
(
i
[
'id'
],
s
.
getProperty
(
i
[
'id'
])),
self
.
propertyMap
())
self
.
_
propertyMap
())
def
propertyInfo
(
self
,
id
):
# Return a mapping containing property meta-data
for
p
in
self
.
propertyMap
():
for
p
in
self
.
_
propertyMap
():
if
p
[
'id'
]
==
id
:
return
p
raise
ValueError
,
'The property %s does not exist.'
%
id
def
propertyMap
(
self
):
def
_
propertyMap
(
self
):
# Return a tuple of mappings, giving meta-data for properties.
# Some ZClass instances dont seem to have an _properties, so
# we have to fake it...
return
self
.
p_self
().
_properties
def
propertyMap
(
self
):
# Returns a secure copy of the property definitions.
return
map
(
lambda
dict
:
dict
.
copy
(),
self
.
_propertyMap
())
def
_propdict
(
self
):
dict
=
{}
for
p
in
self
.
propertyMap
():
for
p
in
self
.
_
propertyMap
():
dict
[
p
[
'id'
]]
=
p
return
dict
...
...
@@ -360,7 +361,7 @@ class PropertySheet(Traversable, Persistent, Implicit):
# DAV helper method - return one or more propstat elements
# indicating property names and values for all properties.
result
=
[]
for
item
in
self
.
propertyMap
():
for
item
in
self
.
_
propertyMap
():
name
,
type
=
item
[
'id'
],
item
.
get
(
'type'
,
'string'
)
value
=
self
.
getProperty
(
name
)
if
type
==
'tokens'
:
...
...
@@ -453,7 +454,7 @@ class PropertySheet(Traversable, Persistent, Implicit):
def
manage_editProperties
(
self
,
REQUEST
):
"""Edit object properties via the web."""
for
prop
in
self
.
propertyMap
():
for
prop
in
self
.
_
propertyMap
():
name
=
prop
[
'id'
]
if
'w'
in
prop
.
get
(
'mode'
,
'wd'
):
value
=
REQUEST
.
get
(
name
,
''
)
...
...
@@ -551,9 +552,12 @@ class DAVProperties(Virtual, PropertySheet, View):
def
_delProperty
(
self
,
id
):
raise
ValueError
,
'%s cannot be deleted.'
%
id
def
propertyMap
(
self
):
def
_
propertyMap
(
self
):
return
self
.
pm
def
propertyMap
(
self
):
return
map
(
lambda
dict
:
dict
.
copy
(),
self
.
_propertyMap
())
def
dav__creationdate
(
self
):
return
iso8601_date
(
43200.0
)
...
...
@@ -759,20 +763,20 @@ class FixedSchema(PropertySheet):
FixedSchema
.
inheritedAttribute
(
'__init__'
)(
self
,
id
,
md
)
self
.
_base
=
base
def
propertyMap
(
self
):
def
_
propertyMap
(
self
):
# Return a tuple of mappings, giving meta-data for properties.
r
=
[]
for
d
in
self
.
_base
.
propertyMap
():
mode
=
d
.
get
(
'mode'
,
'wd'
)
r
=
[]
for
d
in
self
.
_base
.
_propertyMap
():
d
=
d
.
copy
()
mode
=
d
.
get
(
'mode'
,
'wd'
)
if
'd'
in
mode
:
dd
=
{}
dd
.
update
(
d
)
d
=
dd
d
[
'mode'
]
=
filter
(
lambda
c
:
c
!=
'd'
,
mode
)
r
.
append
(
d
)
return
tuple
(
r
)
propertyMap
=
_propertyMap
def
property_extensible_schema__
(
self
):
return
0
return
self
.
_base
.
_extensible
...
...
lib/python/ZClasses/ZClass.py
View file @
07dc4664
...
...
@@ -407,6 +407,7 @@ class ZClass( Base
return
'*'
+
id
changeClassId__roles__
=
()
# Private
def
changeClassId
(
self
,
newid
=
None
):
if
not
dbVersionEquals
(
'3'
):
return
...
...
@@ -572,6 +573,7 @@ class ZClass( Base
r
.
sort
()
return
r
getClassAttr__roles__
=
()
# Private
def
getClassAttr
(
self
,
name
,
default
=
_marker
,
inherit
=
0
):
if
default
is
_marker
:
if
inherit
:
return
getattr
(
self
.
_zclass_
,
name
)
...
...
@@ -581,6 +583,7 @@ class ZClass( Base
else
:
return
self
.
_zclass_
.
__dict__
[
name
]
except
:
return
default
setClassAttr__roles__
=
()
# Private
def
setClassAttr
(
self
,
name
,
value
):
c
=
self
.
_zclass_
setattr
(
c
,
name
,
value
)
...
...
@@ -588,6 +591,7 @@ class ZClass( Base
get_transaction
().
register
(
c
)
c
.
_p_changed
=
1
delClassAttr__roles__
=
()
# Private
def
delClassAttr
(
self
,
name
):
c
=
self
.
_zclass_
delattr
(
c
,
name
)
...
...
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