preferences service, a first implementation
charlie at openmoko.org
Tue Jun 10 11:49:45 CEST 2008
Hello all !
Today I worked on the first draft of the configurations (or preferences)
I didn't use an existing system, because I want something small, and
that is aware of the profiles (because many applications have parameters
that depend of the profile)
The main points are :
- All the configuration and schema are stored into YAML files.
- Every service that uses the service should create a schema file,
giving information about the parameters. A typical schema file looks
vibration: # The name of the parameter
type: bool # The type
default: yes # default value
profilable: yes # set to yes if the parameter depends of the profile
the name of the file is the name of the service providing those
parameters (for example, "schema/phone.yaml" )
The configurations values for a given service AND for a given profile
are stored in the file :
So for example I could have the following file structure:
A typical conf file looks like this :
- the server provides this simple dbus api :
== interface "org.freesmartphone.conf" ==
- method set_profile(s)
- method get_service(s) -> o // return a proxy to a service conf
// implemeting org.freesmartphone.conf.service
== interface "org.freesmartphone.conf.service" ==
- method set(s,v) // set a key value (in the current profile)
- method get(s) -> o // get a key value (in the current profile)
- signal notify(s,v) // emitted when a parameter value changes
OK That's it for the moment. I implemented this with python.
Comment are welcome :)
Mickey, can I put the code in the git repository ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the smartphones-standards