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
ee0526ec
Commit
ee0526ec
authored
Mar 04, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
4f5b11dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
lib/python/OFS/PropertySheets.py
lib/python/OFS/PropertySheets.py
+19
-11
No files found.
lib/python/OFS/PropertySheets.py
View file @
ee0526ec
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
import
time
,
string
,
App
.
Management
from
ZPublisher.Converters
import
type_converters
...
...
@@ -283,15 +283,19 @@ class PropertySheet(Persistent, Implicit):
# return property names and values.
for
item
in
self
.
propertyMap
():
name
,
type
=
item
[
'id'
],
item
.
get
(
'type'
,
'string'
)
meta
=
item
.
get
(
'meta'
,
{})
value
=
self
.
getProperty
(
name
)
if
type
==
'tokens'
:
value
=
join
(
value
,
' '
)
elif
type
==
'lines'
:
value
=
join
(
value
,
'
\
n
'
)
if
meta
.
get
(
'dav_xml'
,
0
):
prop
=
value
else
:
prop
=
' <n:%s>%s</n:%s>'
%
(
name
,
value
,
name
)
# allow for xml properties
meta
=
item
.
get
(
'meta'
,
{})
attrs
=
meta
.
get
(
'__xml_attrs__'
,
''
)
if
attrs
:
attrs
=
map
(
lambda
n
,
v
:
' %s="%s"'
,
attrs
.
items
())
attrs
=
join
(
attrs
,
''
)
prop
=
' <n:%s%s>%s</n:%s>'
%
(
name
,
attrs
,
value
,
name
)
result
.
append
(
prop
)
if
not
result
:
return
''
result
=
join
(
result
,
'
\
n
'
)
...
...
@@ -304,21 +308,25 @@ class PropertySheet(Persistent, Implicit):
if
ns
==
xml_id
:
if
not
propdict
.
has_key
(
name
):
prop
=
' <n:%s/>'
%
name
emsg
=
errormsg
%
'Property not found: %s'
%
name
emsg
=
errormsg
%
(
'The property %s does not exist.'
%
name
)
result
.
append
(
propstat
%
(
prop
,
'404 Not Found'
,
emsg
))
else
:
item
=
propdict
[
name
]
name
,
type
=
item
[
'id'
],
item
.
get
(
'type'
,
'string'
)
meta
=
item
.
get
(
'meta'
,
{})
value
=
self
.
getProperty
(
name
)
if
type
==
'tokens'
:
value
=
join
(
value
,
' '
)
elif
type
==
'lines'
:
value
=
join
(
value
,
'
\
n
'
)
if
meta
.
get
(
'dav_xml'
,
0
):
prop
=
value
else
:
prop
=
' <n:%s>%s</n:%s>'
%
(
name
,
value
,
name
)
# allow for xml properties
meta
=
item
.
get
(
'meta'
,
{})
attrs
=
meta
.
get
(
'__xml_attrs__'
,
''
)
if
attrs
:
attrs
=
map
(
lambda
n
,
v
:
' %s="%s"'
,
attrs
.
items
())
attrs
=
join
(
attrs
,
''
)
prop
=
' <n:%s%s>%s</n:%s>'
%
(
name
,
attrs
,
value
,
name
)
result
.
append
(
propstat
%
(
prop
,
'200 OK'
,
''
))
if
not
result
:
return
''
return
join
(
result
,
''
)
...
...
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