[Server-devel] xs-activation and OS update info

Daniel Drake dsd at laptop.org
Thu Oct 29 12:09:28 EDT 2009


2009/10/27 Martin Langhoff <martin.langhoff at gmail.com>:
> Right... makes sense. I am a bit intrigued with the custom config file
> parser / writer (that is 3x the sloc of the whole xs-activation ;-) ).

It's not really a custom config file parser. It's a trivial change to
Python's own ConfigParser class. The only change is in the constructor
IIRC, which now lets you use a custom dictionary type.

> I am guessing the key motivator is that YAML, JSON and other config
> formats won't preserve ordering correctly, right?

I didn't feel that JSON is appropriate for a config file, especially
so in oatslite (which allows more per-OS configuration). I don't know
anything about YAML.

>  - is MyConfigParser used anywhere else?

I don't understand this question. My patch only adds it for
xs-activation purposes.

>  - odict is only needed on F9, correct?

It is needed up until Python 3.0, unless you know of a python ordered
dictionary class which is shipped with your distro-of-choice. (I don't
know of any, meaning that it will still be needed even with F12)

It's a bit ugly with these 2 classes but at least their importance is
trivial to explain and they can sit independently, and we have a path
for getting rid of them (Python 3.0).

> What is needed in terms of config parsing is pretty simple -- I
> suspect there are a couple of simple ways we could avoid depending on
> the ordering of the config file, with less code.

Alternative implementations/suggestions welcome :)
In my opinion the ordering is the main purpose of having to use a
config file here.

Daniel


More information about the Server-devel mailing list