|
From: David H. <neg...@gm...> - 2009-01-28 23:13:32
|
I'm having a devil of a time getting validate to allow for the default value
of a string check to consist of a string that includes a newline character
('\n'). I've tried several syntactic variants, and nothing is working - the
validation fails everytime.
E.g.:
spec = { u'val': u"string(default='%s')" % ('\n') }
cfgdict = {}
vtor = validate.Validator()
cfg = configobj.ConfigObj(cfgdict, configspec=spec)
results = cfg.validate(vtor, preserve_errors=True)
In addition to the spec as shown above, I've tried:
spec = { u'val': u"string(default='\n')" }
spec = { u'val': u""""string(default='
')""" }
I even tried putting the spec into a text block and using splitlines() and
giving that as the configspec argument (where the text block used the
'''<value>''' syntax for multi-line values).
No joy.
The validation parser seems to treat any newline as the end of the spec
definition for that particular value, and either bombs out with a parse
error, or returns False upon validation.
Any tips? Bug?
thanks,
- David Hostetler
|