|
From: Jeremy G. <jr...@gm...> - 2009-10-17 18:42:10
|
at risk of getting academic about this (sorry, that's my day job, being an academic :-) ), I have one more thought.... and I want to emphasize that I'm certainly not asking for a new feature, or somehow insisting that there's a bug. not at all! its your program, it works, and I'm glad to be using it. >> then there is at least the >> possibility that they have been changed right under the user's nose. >> > > Only if they didn't supply them (i.e. nothing has 'changed'). this may be true most of the time. in my case, however, I allow users to edit the config files (which I recognize is probably a bad idea, and I plan to rewrite so they can't do this). currently, my users can set specific values to something other than the defaults. if the user then deletes only the section name, all values within that section revert to defaults when validate is called -- so something has indeed changed. (the previously-edited values are retained but now they are in a different section, and so no longer accessible reliably.) and there's not a handy flag that I can catch to handle this situation. I could track which items were non-default, and then after validating check if some of the values had become the default (by comparing each against using config.defaults). but it would seem more straightforward to have validation fail and report a missing section, which could then be reset to defaults if so desired. (in my case I would not do that -- its not always a desirable action). anyway, just my .02 -- its a very nice set of tools. > You can always use 'config.defaults' for a list of all entries filled > from default values. interesting... looking forward to 4.7, --Jeremy > All the best, > > Michael Foord >> eventually I'll be structuring things so that my users cannot edit the >> config file directly, avoiding this situation. >> >> >>> In order to fill in the default >>> ConfigObj *has* to create the section so it is no longer missing. >>> >> >> that makes sense. >> >> thanks again, >> >> --Jeremy >> >> >> >>> It would also make things harder for error handling code - if you have >>> to handle a missing section then you would no longer know if the section >>> is actually present in the resulting ConfigObj instance or not... >>> >>> All the best, >>> >>> Michael Foord >>> >>>> --Jeremy >>>> >>>> ------------------------------------------------------------------------------ >>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>>> is the only developer event you need to attend this year. Jumpstart your >>>> developing skills, take BlackBerry mobile applications to market and stay >>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >>>> http://p.sf.net/sfu/devconference >>>> _______________________________________________ >>>> Configobj-develop mailing list >>>> Con...@li... >>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>>> >>>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/blog >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>> is the only developer event you need to attend this year. Jumpstart your >>> developing skills, take BlackBerry mobile applications to market and stay >>> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >>> http://p.sf.net/sfu/devconference >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>> >>> >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > |