Awn

How do I use AWN's config/preferences framework from python?

Asked by Erigami

I'm trying to write an applet for AWN. I'd like to use the config framework provided by AWN/desktopagnostic, but whenever I try to initialize the configuration framework (with awn.config_get_default_for_applet()), I get the following exception:

** (more_mon.py:20580): CRITICAL **: config-schema.vala:171: The file '/usr/share/avant-window-navigator/schemas/awn-applet-more-mon.schema-ini' could not be found.
Traceback (most recent call last):
  File "/home/erigami/.config/awn/applets/more_mon/more_mon.py", line 302, in <module>
    applet = MoreMonApplet(awn.uid, awn.panel_id)
  File "/home/erigami/.config/awn/applets/more_mon/more_mon.py", line 225, in __init__
    self.config = awn.config_get_default_for_applet(self)
glib.GError: A (valid) schema file was not given.

My questions:
1. I'm bundling my applet as a tarball. Where should I put the .schema-ini?
2. How do I tie widgets created in Glade with the config keys?

Question information

Language:
English Edit question
Status:
Answered
For:
Awn Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Erigami (erigami) said :
#1

Bump!

Revision history for this message
Michal Hruby (mhr3) said :
#2

Taken from our IRC channel:

<moonbeam> I forget what the behaviour is if the schema-ini is shipped in a local installed applet.
<mhr3> it wont work
 the awn_config funcs don't search home dir
 and there might be some lda gconf backend issue
 preventing it to work properly
<moonbeam> ah. and gconf schema wouldn't be installed either.
<mhr3> for one you're surely not able to install the schema
 so basically we don't support that, right?!
 ie. if you want config, get into official extras :)
<moonbeam> mhr3, or make a proper installation.

Revision history for this message
Erigami (erigami) said :
#3

Boo! I ended up installing lda-schema-to-gconf, then manually installing the .schema file as root. But that's a PITA and prevents folks from distributing the .tar.gz for testing. =(

Revision history for this message
Erigami (erigami) said :
#4

Oh, wait, there's still part (2) of the question: How do I tie widgets created in Glade with the config keys?

Revision history for this message
Michal Hruby (mhr3) said :
#5

Take a look at awn-settings/awnSettingsHelper.py, or there's a similar functionality in the python wrapper of libawn.

Can you help with this problem?

Provide an answer of your own, or ask Erigami for more information if necessary.

To post a message you must log in.