configobj

A

Andrea Crotti

I have a couple of questions about configobj, which I'm happily trying
to use for this project.

The first question is, how do I make a very long list of things?
Suppose I have declared in a spec file.

val = string_list

now I would like to do
val = one,
two,
three

but that's not allowed, and also
val = one, \
two, \
three

doesn't work, is there a way to avoid to write everything on one line?

The second question is, how do I avoid declaring twice the default
value?

For example supposing I have this spec:
skip_pesky_pyc_paths = string_list

I was giving for granted that (pseudocode ahead)
conf = ConfigObj(spec=myspec)
conf['skip_pesky_pyc_paths'] == []

but it's not the case, if it's not declared in the conf file it just
doesn't find the key?
Is there a magic option to make it create the key when they are not
declared from the spec?

Thanks,
Andrea

PS. and why by the way ConfigObj is not in the standard lib, instead of
ConfigParser,
which looked less complete and more cumbersome (to me at least)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top