|
From: Robert Š. <smo...@gm...> - 2009-06-22 08:35:34
|
Hi, after reading http://www.voidspace.org.uk/python/articles/configobj.shtml I am now wondering if it is possible to validate config that looks like this: >>>> [general] pid_file = 'some.pid' [scenario] name = X watched_dir = 'some dir X' [scenario] name = Y watched_dir = 'some dir Y' [worker] name = X [worker] name = Y <<<<< Is it possible to have multiple __many__ repeating, or do I have to create [scenario] and [worker] section and then list each scenario, worker in it as subsection? Thanks |
|
From: Michael F. <fuz...@vo...> - 2009-06-22 19:03:09
|
Hello Robery, Repeating sections in configspecs are for differing sections to be validated with the same spec - it doesn't allow you to have the same section name repeated many times I'm afraid. You'll need named sections or subsections to validate with __many__. Michael Robert Šmol wrote: > Hi, > after reading http://www.voidspace.org.uk/python/articles/configobj.shtml > I am now wondering if it is possible to validate config that looks > like this: > > > [general] > pid_file = 'some.pid' > > [scenario] > name = X > watched_dir = 'some dir X' > > [scenario] > name = Y > watched_dir = 'some dir Y' > > [worker] > name = X > > [worker] > name = Y > <<<<< > > Is it possible to have multiple __many__ repeating, or do I have to > create [scenario] and [worker] section and then list each scenario, > worker in it as subsection? > > Thanks > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge conference! > Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. > Need another reason to go? 24-hour hacker lounge. Register today! > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
|
From: Robert Š. <smo...@gm...> - 2009-06-22 20:12:11
|
Hi Michael, no problem. I've reworked design to have subsections. And it works ok. Thanks, Robert On Mon, Jun 22, 2009 at 9:02 PM, Michael Foord <fuz...@vo...>wrote: > Hello Robery, > > Repeating sections in configspecs are for differing sections to be > validated with the same spec - it doesn't allow you to have the same > section name repeated many times I'm afraid. You'll need named sections > or subsections to validate with __many__. > > Michael > > Robert Šmol wrote: > > Hi, > > after reading > http://www.voidspace.org.uk/python/articles/configobj.shtml > > I am now wondering if it is possible to validate config that looks > > like this: > > > > > > [general] > > pid_file = 'some.pid' > > > > [scenario] > > name = X > > watched_dir = 'some dir X' > > > > [scenario] > > name = Y > > watched_dir = 'some dir Y' > > > > [worker] > > name = X > > > > [worker] > > name = Y > > <<<<< > > > > Is it possible to have multiple __many__ repeating, or do I have to > > create [scenario] and [worker] section and then list each scenario, > > worker in it as subsection? > > > > Thanks > > > > > ------------------------------------------------------------------------------ > > Are you an open source citizen? Join us for the Open Source Bridge > conference! > > Portland, OR, June 17-19. Two days of sessions, one day of unconference: > $250. > > Need another reason to go? 24-hour hacker lounge. Register today! > > > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > > _______________________________________________ > > Configobj-develop mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge > conference! > Portland, OR, June 17-19. Two days of sessions, one day of unconference: > $250. > Need another reason to go? 24-hour hacker lounge. Register today! > > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |
|
From: Pascal C. <pyt...@gm...> - 2009-06-29 15:15:06
|
Hello
I just report a little confusion I once faced : I kept having a "missing
section" error message when validating my config.ini file, and I didn't
understand because the section WAS there. In the end, I realized that
there were just typos in the names of the variables inside that section,
and it made the validator believe that the section didn't exist at all
(actually it existed, but it was empty).
So well, if it's not too much trouble for such a minor bug, it might be
cool to replace this error message with a more accurate ones ("field
mysection.xxx is missing" or smth like that).
Cheers for all,
regards,
Pascal Chambon
|
|
From: Michael F. <fuz...@vo...> - 2009-06-29 17:08:30
|
That does sound like a bug in ConfigObj. Could you post an example ini file and code that shows the problem please. Thanks Michael -- http://www.ironpythoninaction.com On 29 Jun 2009, at 16:14, Pascal Chambon <pyt...@gm...> wrote: > Hello > > I just report a little confusion I once faced : I kept having a > "missing > section" error message when validating my config.ini file, and I > didn't > understand because the section WAS there. In the end, I realized that > there were just typos in the names of the variables inside that > section, > and it made the validator believe that the section didn't exist at all > (actually it existed, but it was empty). > So well, if it's not too much trouble for such a minor bug, it might > be > cool to replace this error message with a more accurate ones ("field > mysection.xxx is missing" or smth like that). > > Cheers for all, > regards, > Pascal Chambon > > --- > --- > --- > --------------------------------------------------------------------- > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop |
|
From: Pascal C. <pyt...@gm...> - 2009-06-29 17:46:58
|
Sure, I send it in one week (as soon I as get back from holiday to my work project...) Regards, Pascal Michael Foord wrote: > That does sound like a bug in ConfigObj. Could you post an example ini > file and code that shows the problem please. > > Thanks > > Michael > > > -- > http://www.ironpythoninaction.com > > On 29 Jun 2009, at 16:14, Pascal Chambon <pyt...@gm...> wrote: > > >> Hello >> >> I just report a little confusion I once faced : I kept having a >> "missing >> section" error message when validating my config.ini file, and I >> didn't >> understand because the section WAS there. In the end, I realized that >> there were just typos in the names of the variables inside that >> section, >> and it made the validator believe that the section didn't exist at all >> (actually it existed, but it was empty). >> So well, if it's not too much trouble for such a minor bug, it might >> be >> cool to replace this error message with a more accurate ones ("field >> mysection.xxx is missing" or smth like that). >> >> Cheers for all, >> regards, >> Pascal Chambon >> >> --- >> --- >> --- >> --------------------------------------------------------------------- >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> > > ------------------------------------------------------------------------------ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |