ConfManager

Hi all,
I wrote in a few months back about my ConfManager, and received some excellent help and advice with it.

Anyways, I've just written version 2 which I'm going to be using (because it's far more intuative than the first attempt).

Feel free to use it in your code, poke me with suggestions, hints, or complaints!

You get get the code from my github page with the following command:

git clone https://github.com/chrisnorman7/confmanager.git

Cheers all, and have a great day.

the URL in readme.md is broken, at least when you click it on the github page. Also the help doesn’t work for me, it always just says “There is no help for this configuration screen”. I’m also not sure what to do with ‘c’ from the example… I assume you would want to save it to a file or something, but it’s not clear (maybe this is because I am unfamiliar with ConfigParser).

Out of curiosity, ConfigParser looks really really complicated when I compare it to JSON… what was your motivation for using it?

···

On Friday, October 24, 2014 12:52:01 PM UTC-7, Chris Norman wrote:

Hi all,

I wrote in a few months back about my ConfManager, and received some
excellent help and advice with it.

Anyways, I’ve just written version 2 which I’m going to be using
(because it’s far more intuative than the first attempt).

Feel free to use it in your code, poke me with suggestions, hints, or
complaints!

You get get the code from my github page with the following command:

git clone https://github.com/chrisnorman7/confmanager.git

Cheers all, and have a great day.

ConfigParser is a Python module that is used for reading and writing config files that typically follow the basic INI format. The docs are here:

13.2. ConfigParser — Configuration file parser — Python 2.7.18 documentation

I personally prefer ConfigObj, although that is a 3rd party package.

  • Mike
···

On Friday, October 24, 2014 4:28:48 PM UTC-5, Nathan McCorkle wrote:

the URL in readme.md is broken, at least when you click it on the github page. Also the help doesn’t work for me, it always just says “There is no help for this configuration screen”. I’m also not sure what to do with ‘c’ from the example… I assume you would want to save it to a file or something, but it’s not clear (maybe this is because I am unfamiliar with ConfigParser).

Out of curiosity, ConfigParser looks really really complicated when I compare it to JSON… what was your motivation for using it?

If you read the end bit of __init__.py, below the if __name__ is '__main__' bit, then you'll see the get_gui function being used with a provided callback function, intended to let your controling program know that the GUI has finished, and a more useful help message (I just added these now).

If you'd used this in your projects, you could have done something like the following:

def callback():
  """Sync changes to disk."""
  c.save(open('options.ini', 'w'))

All my wrapper does is build a GUI which makes it more user friendly. The idea being that you can simply build your options object, the same way you might in any program, then have your configuration screen built for you by my object. Obviously, if you didn't like how it looked or whatever, before doing .Show() on the window, you could alter pretty much any aspect of it you wanted.

Suggestions welcome.

Cheers,

···

On 24/10/2014 22:28, Nathan McCorkle wrote:

the URL in readme.md is broken, at least when you click it on the github page. Also the help doesn't work for me, it always just says "There is no help for this configuration screen". I'm also not sure what to do with 'c' from the example... I assume you would want to save it to a file or something, but it's not clear (maybe this is because I am unfamiliar with ConfigParser).

the URL in readme.md is broken, at least when you click it
on the github page. Also the help doesn’t work for me, it
always just says “There is no help for this configuration
screen”. I’m also not sure what to do with ‘c’ from the
example… I assume you would want to save it to a file or
something, but it’s not clear (maybe this is because I am
unfamiliar with ConfigParser).

          Out of curiosity, ConfigParser looks really really

complicated when I compare it to JSON… what was your
motivation for using it?

It keeps it'e entries in order, which is something json does not

(although json is probably fundermentally better).

      ConfigParser is a Python module that is used for reading and

writing config files that typically follow the basic INI
format. The docs are here:

I personally prefer ConfigObj, although that is a 3rd party
package.

I have never tried it, but I'll go hit google now. I've really quite

new to Python and all that, and sometimes I find it easier to just
make my own systems rather than try and read non existing
documentation for external packages.

Cheers for the heads up though, I'll go check it out.
···

https://docs.python.org/2/library/configparser.html

      ConfigParser is a Python module that is used for reading and

writing config files that typically follow the basic INI
format. The docs are here:

       [https://docs.python.org/2/library/configparser.html](https://docs.python.org/2/library/configparser.html)



      I personally prefer ConfigObj, although that is a 3rd party

package.

I have never tried it, but I'll go hit google now. I've really quite

new to Python and all that, and sometimes I find it easier to just
make my own systems rather than try and read non existing
documentation for external packages.

Cheers for the heads up though, I'll go check it out.

ConfigObj is actually one of the better 3rd party packages when it comes to documentation. I hope you’ll find it useful.

Mike

              ConfigParser is a Python module that is used for

reading and writing config files that typically follow
the basic INI format. The docs are here:

               [https://docs.python.org/2/library/configparser.html](https://docs.python.org/2/library/configparser.html)



              I personally prefer ConfigObj, although that is a 3rd

party package.

        I have never tried it, but I'll go hit google now. I've

really quite new to Python and all that, and sometimes I
find it easier to just make my own systems rather than try
and read non existing documentation for external packages.

        Cheers for the heads up though, I'll go check it out.
      ConfigObj is actually one of the better 3rd party packages

when it comes to documentation. I hope you’ll find it useful.

      Mike
You're right, it really is!

I read over it, and it looks fantastic. I've put it on the shelf

until I can make a tree control which will work on both Windows and
OS X, since these are my primary two platforms, and that would seem
to be better than a notebook for the infinite depth possibilities of
ConfigObj.

If anyone knows something I don't, please let me know. I love the

simplicity of my confmanager, but making it use ConfigObj as it’s
backend would be highly beneficial, just like I say, if I use
wx.Tree it’ll not play nice with VoiceOver on OS X (a show stopper
for me! :P), and the wx DataView stuff won’t play nice on windows!
:slight_smile:

Anyways, ConfigParser is doing what I need it to do right now, but

great work on whoever it was that made ConfigObj, it looks
brilliant.

Cheers,
···

On 27/10/2014 13:55, Mike Driscoll wrote:

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to wxpython-users+unsubscribe@googlegroups.com.

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).