views:

66

answers:

1

I have a Gnome applet written in Python. In order to save configuration data/settings, it creates a file ~/.appname.

However, this prevents multiple instances of the applet from being added to the panel because each cannot have its own settings.

How can I store the settings in a way that allows each instance to have its own unique settings?

Update: I specifically want to know how to store settings per instance.

+5  A: 

The recommend way for an applet would be to use GConf to store preferences and to use one key per instance so that you can store individual settings. From Panel Applet GConf Utilities:

Applets typically define a set of preferences using a schemas file and panel_applet_add_preferences(). Such preferences apply only to an individual applet instance. For example, you may add two clock applets to the panel and configure them differently.

In order for the preferences to only apply to a single applet, each applet must have a seperate GConf key for each of these preferences. The methods described below provide convient wrappers around the usual GConfClient functions and operate on these per-applet keys.

Pascal Thivent
**Perfect!** Just what I was looking for.
George Edison