[Zope-CMF] Re: Multiline properties in Filesystem Properties Object
(.props)
Tres Seaver
tseaver at zope.com
Tue Apr 20 16:25:34 EDT 2004
David Convent wrote:
> i've been trying to set up multiline properties (mainly 'lines' and
> 'text') in a Filesystem Properties Object (.props) without success:
> I think what i need to know is what could be the line separator for
> those kinds of types.
>
> if anyone could help me with that it would be really appreciated
I'm afraid you can't do that with the existing code. Here is the
expression used to parse the options (from
CMFCore.FSMetadata.CMFConfigParser)::
class CMFConfigParser(ConfigParser):
""" This our wrapper around ConfigParser to
solve a few minor niggles with the code """
# adding in a space so that names can contain spaces
OPTCRE = re.compile(
r'(?P<option>[]\-[ \w_.*,(){}]+)' # stuff found by IvL
r'[ \t]*(?P<vi>[:=])[ \t]*' # any number of space/tab,
# followed by separator
# (either : or =), followed
# by any # space/tab
r'(?P<value>.*)$' # everything up to eol
)
You could monkey-patch this expression from your own code to add
multi-line support.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope-CMF
mailing list