|
From: Michael F. <fuz...@vo...> - 2008-12-01 22:22:07
|
T. Hariharan wrote: > When you have a keyword that has a list of values, eg: > > PathList = /path1, /path2 > > config['PathList'] returns a list of values. However if you have only one value: > > PathList = /path1 > > config['PathList'] returns a string value. > > It would be nice if you can tell ConfigObj to always return values for certain keywords as a list, even if there is only one value. In the second case above, config['PathList'] would return [ '/path1' ]. Is there a way to do this? I'm sure others would have run into this issue. > The correct syntax for a list with a single member is: PathList = /path1, Otherwise the code to check for a string first and turn it into a single membered list is quite straightforward. :-) All the best, Michael > Thanks, > Hari > > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |