aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-05-01 14:22:57 +0200
committerGuido Günther <agx@sigxcpu.org>2011-05-01 14:31:07 +0200
commita2a2aac10c248cc3a7467ca4bbe51bcc5478fdd0 (patch)
tree18c6264c682d1ed47f48e495dce698b4409ebf76 /src
parentdeda673382bddb0e56429c9e4c9cc645ae37b93b (diff)
Set GSETTINGS_SCHEMA_DIR if running from source tree
Diffstat (limited to 'src')
-rwxr-xr-xsrc/prepaid-manager-applet.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/prepaid-manager-applet.py b/src/prepaid-manager-applet.py
index 32f0cb3..66f3609 100755
--- a/src/prepaid-manager-applet.py
+++ b/src/prepaid-manager-applet.py
@@ -622,10 +622,24 @@ def setup_dbus():
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+def setup_schemas():
+ """If we're running from the source tree add our gsettings schema to the
+ list of schema dirs"""
+
+ schema_dir = 'data'
+ schema = os.path.join(schema_dir,
+ "%s.gschema.xml" % AccountDB.PPM_GSETTINGS_ID)
+ if os.path.exists(schema):
+ logging.debug("Running from source tree, adding local schema dir '%s'"
+ % schema_dir)
+ os.environ["GSETTINGS_SCHEMA_DIR"] = "data"
+
+
def main():
logging.basicConfig(level=logging.DEBUG,
format='ppm: %(levelname)s: %(message)s')
+ setup_schemas()
setup_dbus()
setup_i18n()