python parser for dotconf file

Hemant Goyal goyal.hemant at gmail.com
Thu Jul 3 12:12:35 EDT 2008


Hi Lukas,

I am working on a project to integrate speech-dispatcher (which uses
dot.conf for its configuration files) into the olpc sugar environment. I
need to modify the configuration files directly from a python program,
and unfortunately python bindings of dotconf are not available.

I developed a simple parser to read the parameter values correctly.

I am, however, having trouble deciding how to write back (edit the value of
a particular parameter) to the file - There are times when multiple
instances of the same parameter exist.

For example:

AddModule "flite" "sd_flite" "flite.conf"
#AddModule "espeak-generic" "sd_generic" "espeak-generic.conf"

I have two questions:

   1. Would the dotconf project benefit from a generic python program that
   allows to read/edit parameters within a dotconf file?
   2. How to modify the parameter values when multiple instances of the same
   parameter exist as describred above.

For your reference I am attaching the pyDotconf project that I created.
Please run pyDotconf_test.py to see whats happening.

Thanks and looking forward to your feedback!
Hemant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20080703/6a87a642/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyDotconf.tar.gz
Type: application/x-gzip
Size: 5060 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20080703/6a87a642/attachment.bin>


More information about the Devel mailing list