[sabayon] Tools for working with Evolution's GConf information

(cross-posted to the evolution hackers list and to the sabayon list)

I've written some Python scripts to make it easier to work with
Evolution's configuration information, in the hope of automating mass
deployments of Evolution.

A source RPM is available here:

Does anyone have anyone have any objection to me importing the source of
this into GNOME-CVS as module "evolution-gconf-tools"? (and creating an
evolution-gconf-tools bugzilla component)

There's perhaps some overlap here with Sabayon [1]; however these take a
simpler approach and don't involve a nested X session.

Here's a HOWTO-style guide:

How to get this working:
You should set up a prototype/test user on one machine, and get
Evolution working well for that user with whatever server(s) are needed.

You then grab the configuration information for Evolution from GConf as
an XML file thus:
gconftool-2 --dump /apps/evolution > some-file.xml

If you look at one of these XML files in a regular file viewer it will
be almost unreadable (it contains further XML data in an "escaped form"

I wrote evolution-gconf-log to present this data in a more readable way:
cat some-file.xml | evolution-gconf-log | less

This should show you the various accounts and data sources in a somewhat
more human-readable form (it shows you some of this inner XML).  You
can't do anything more with the output except read it; this is a
debugging tool.

This takes one of these XML GConf dump files and filters out everything
apart from the accounts on an Exchange server.
cat some-file.xml | evolution-gconf-filter-exchange > some-other-file.xml

You can use the evolution-gconf-log tool on the result as desired.

This takes one of the XML GConf dump files and remaps all user
information based on the values of environment variables set when the
script is run.  For example: 

cat some-file.xml | evolution-gconf-personalize > result.xml

As before, you can use the evolution-gconf-log tool on the result to
check that things have been mapped correctly for the new user.

Putting the data back in GConf
Once you've manipulated the data as needed (and verified results using
the log tool as needed), you can put it back in GConf for another thus:

gconftool-2 --load my-finished-file.xml

The above command assumes you're logged in as the user; it will start
the GConf daemon for that user if needed.

If this is to run from a script where the user's session isn't running,
you can bypass the daemon thus: 

gconftool-2 --shutdown gconftool-2 --direct --config-source=xml:readwrite:$HOME/.gconf --load result.xml

I've tested this, and had it working for an Evolution 2.0 deployment.  I
suspect the approach will break under some circumstances, and with
different versions of Evolution.  Comments and patches welcome.

[1]: http://www.gnome.org/projects/sabayon/

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]