[tahoe-dev] tahoemenu.py - ConfigParser write method removes comments?
Zooko O'Whielacronx
zookog at gmail.com
Mon Oct 21 15:40:59 UTC 2013
On Mon, Oct 7, 2013 at 6:12 AM, Garonda Rodian <deepside at hotmail.com> wrote:
> I've been attempting to start a basic menu system to build grids
Cool!
> when I try the ConfigParser write method, all of the commented out entries in the tahoe.cfg are removed...
I would suggest *not* having the menu system edit an existing
tahoe.cfg file, but instead use it to create a new tahoe.cfg file from
scratch and after it is created, the user would have to edit it by
hand to change it. That's what we currently do:
https://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/src/allmydata/node.py?annotate=blame&rev=ff64a0fef5879d3651bc3db6ca0522d96b217d45
I think it is useful to know that the Tahoe-LAFS process is never
going to edit the contents of your tahoe.cfg file.
On the other hand, I can see that for some things — especially when
the user does not know how to edit the cfg files by hand — we really
need the process to change some config. The menu system probably falls
into this category. One way that we've been handling this so far is to
put things that only the human changes into tahoe.cfg, and put things
that the node changes into separate files, like is done with the
"client.port" file.
Regards,
Zooko
More information about the tahoe-dev
mailing list