Error accessing Gio.Gsettings on application made in quickly

Posted by Zane Swafford on Ask Ubuntu See other posts from Ask Ubuntu or by Zane Swafford
Published on 2012-08-09T21:13:45Z Indexed on 2012/11/11 11:28 UTC
Read the original article Hit count: 253

I am trying to develop an application using the quickly/pygtk stack. I got my Gsettings schemas all set up in ~/app-name-here/data/glib-2.0/schemas/net.launchpad.app-name-here.gschema.xml correctly and I am able to access it just fine in my preferences dialog window that is located in ~/app-name-here/app-name-here/PreferencesDialog.py via

from gi.repository import Gtk, Gio
settings = Gio.Settings("net.launchpad.app-name-here")
settings.get_boolean('notify')
settings.set_boolean('notify', True)

but when I try to check the value of one of my settings in a file located in ~/app-name-here/bin/Daemon.py that I use as a script to run in the background and send notifications by a similar method of

from gi.repository import Gio
settings = Gio.Settings("net.launchpad.app-name-here")
settings.get_boolean('notify')

it fails at the line that says

settings = Gio.Settings("net.launchpad.app-name-here")

and spits out a nasty error

(Daemon.py:26100): GLib-GIO-ERROR **: Settings schema 'net.launchpad.app-name-here' is not installed

Despite the fact that I can open up dconf-editor and find the settings under net/launchpad/app-name-here. Any thoughts?

© Ask Ubuntu or respective owner

Related posts about application-development

Related posts about python