|
From: Stefan P. <pa...@ik...> - 2010-12-15 22:07:00
|
Hi all, I made a graphical interface for editing configobj-based configs in my own graphical applications and I thought it might be useful for others as well. It's made using PyQt so probably your application also needs to use this toolkit, although I guess it's theoretically possible to mix Qt and GTK+ code nowadays. The code should work on all platforms where PyQt works (Linux, Windows, MacOS X, ...) The project can be found at https://github.com/pafcu/ConfigObj-GUI. Currently the editor looks like this: https://github.com/pafcu/ConfigObj-GUI/wiki/Screenshots An example program: import sys from PyQt4.QtGui import QApplication import configobj import configobj_gui app = QApplication(sys.argv) spec = configobj.ConfigObj('yourspecfile', list_values=False) conf = configobj.ConfigObj('yourconffile', configspec=spec) wnd = configobj_gui.ConfigWindow(conf, spec) wnd.show() app.exec_() print conf There are still some limitations, like not being able to add new sections (coming at some point). There are also a few small, mostly graphics related, bugs. The grey text is supposed to symbolize default values, but it looks a bit like the controls are disabled. There probably are a lot of bigger bugs as well since the code has not been tested very much. -- Stefan Parviainen |