Eric Bus wrote:
> Hi,
>
> I've been experimenting with a runtime configuration file, following
> the ideas that were put on the list in October.
>
> These are the files needed, diffed to the current CVS head
>
> http://www.fambus.nl/~ebus/freevo/runtime_config.xml
> http://www.fambus.nl/~ebus/freevo/config.init.diff
> http://www.fambus.nl/~ebus/freevo/runtimexml.py
>
> I put the runtimexml.py in src/config/ and the xml file goes in your
> default config path.

I didn't look at them, but the idea looks good. I like the idea of
having a config file the program con write and it will override
local_conf.py. For the future local_conf.py would only be for
developers and users get a nice gui to set stuff.

> At the moment, the class is very simple. It can only load an XML,
> parse the data in it and set the appropriate config.XXXX values. The
> format of those valuenames is config.PATH_TO_THE_ELEMENT_VALUE_NAME.
>
> So, if we make a file like this:
>
> <freevo>
>     <tv>
>        <record>
>           <var name="padding">600</var>
>        <record>
>     </td>
> </freevo>

I guess we need more fxd files. One with the possible variables and
the type:


<freevo>
    <tv>
       <record>
          <var name="padding">int</var>
       <record>
    </td>
</freevo>

and one for each language with a description

<freevo>
    <tv>
       <record>
          <var name="padding">Padding for a tv recording</var>
       <record>
    </td>
</freevo>

How do we handle complex structures like TV_CHANNELS and VIDEO_ITEMS? 
What if changing the variable need some recalculations? Maybe add a
function to call in the type fxd

<var name="padding" call="foo">int</var>

will call function foo() in config when the padding changes. 

> Freevo polls the file every 5 seconds. When the file is changed on
> disk, Freevo sees the change and reloads the config. Before it does
> this, it puts back a backup of the settings before the previous
> load. This way, when you remove a setting from the file, the default
> setting from local_config.py takes over.

I don't like the polling, maybe a mbus command to reload the config
file. By that a gui would rewrite the file and then send the reload
command. BTW, what about a fxd file with the default values? But that
isn't easy because there are 'if' statements in freevo_config.py

> Well, that's about it. It this something we can use? It's something I
> put toghether in one morning, so expect some bugs and strange
> behaviour ;)

It's a great idea, it would be cool if you could spend more time in
it. Maybe a page in the webserver for configuration?


Dischi

-- 
printk("VFS: Busy inodes after unmount. "
        "Self-destruct in 5 seconds.  Have a nice day...\n");
        2.3.99-pre8 /usr/src/linux/fs/super.c

Attachment: pgpej3uLKjSxI.pgp
Description: PGP signature

Reply via email to