Chad Robinson wrote: > Dale Cooper wrote: >> Eric Bus wrote: >> >>> Richard van Paasen wrote: >>> >>>> Instead, all modules should be extended with a 'reconfigure' >>>> method that is >>>> called after a (set of) config setting(s) has been changed. >>>> >>> And I guess the config file should be written in a 'plain-text' >>> format, like XML, so Freevo can reload it while running. >>> >>> Eric >>> >> XML would be fine if ALL configuration could be done via interface, >> some setup. It is better format for our Freevo machines ;) >> However, if _some_ parts of config should be done still in vi (nano, >> ..your fav editor) it would be IMHO better to keep the config file >> the way it is now -> more readable for humans. Also, if someone >> omits/accidentally deletes XML closing tag for example...all XML >> parsing goes to hell. > > Why not do a hybrid, exactly the way local_conf.py overrides the > globals? Have an XML file that is loaded after the local_conf.py and > can override it. This is where run-time configuration changes would be > kept.
Yes, that what's I would prefer. We would load a basic setting (like
freevo_config.py), after that the local_conf.py and than the xml
runtime changes (or the other way around).
About the coding of this: feel free to do it / send patches. I have no
time for this right now but it is a big step we need at some point. To
make it work very easily: the xml file just adds the config variables
(see src/freevo/system/cache.py in current cvs).
Example:
freevo_config.py:
AUDIO_PREFERED_PLAYER = 'mplayer'
xmlfile:
<audio>
<var name="prefered player" type="string">xine</var>
</audio>
The parser will set config.<tag name>_<var name with s/ /_/>, in this
case the config reader will set config.AUDIO_PREFERED_PLAYER = 'xine'
Someone willing to do this? It's a very good place for someone to
start coding because you don't have to understand much of the freevo
code to do it.
Dischi
--
errors in argv often lead to output of argh
-- suffered wisdom
pgpGGZs6TFBbj.pgp
Description: PGP signature
