Converting List properties in DTML Documents to python lists
Is there an API call in Zope that takes the contents of a lines property (such as in a DTML Document) and returns a python list? I couldn't find one. In the alternative, does anyone have a code snippet for converting the contents of a lines property into a list (or appending it to an existing list? I want to write a python function that returns a list of the contents of a DTML Docments lines property. Thanks in advance, Ron
complaw@hal-pc.org wrote:
Is there an API call in Zope that takes the contents of a lines property (such as in a DTML Document) and returns a python list? I couldn't find one.
In the alternative, does anyone have a code snippet for converting the contents of a lines property into a list (or appending it to an existing list?
I want to write a python function that returns a list of the contents of a DTML Docments lines property.
Hi, Ron I think a lines property *is* a python list of strings. Refer to it by name. About the only thing special is that you have to use manage_changeProperties() if you want persistent changes to the property. -- Jim Washington
From: Jim Washington <jwashin@vt.edu>
I think a lines property *is* a python list of strings.
Yes, lines and tokens are both. Lines split on newline, tokens split on space, to make python lists. Actually, they might be tuples, I'm not sure.
participants (3)
-
complaw@hal-pc.org -
Jim Washington -
marc lindahl