[caribou] Updated make_schema.py and data/Makefile.am



commit edc0c69c36ed773d13276889390faa3ce57bf5ff
Author: Eitan Isaacson <eitan monotonous org>
Date:   Tue May 3 16:30:34 2011 -0700

    Updated make_schema.py and data/Makefile.am
    
    Make settings python files dependancies for schemas

 .gitignore                           |    4 +---
 caribou/antler/__init__.py           |    1 +
 caribou/settings/settings_manager.py |    3 +--
 data/Makefile.am                     |   11 ++++++++---
 tools/make_schema.py                 |   13 +++++--------
 5 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2e70547..3878274 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,9 +24,7 @@ m4/intltool.m4
 *.tar.gz
 data/*.desktop
 po/.intltool-merge-cache
-data/caribou.schemas
-data/caribou.schemas.in
-data/org.gnome.caribou.gschema.*
+data/*.gschema.*
 depcomp
 libcaribou/.deps/
 caribou-enum-types.[ch]
diff --git a/caribou/antler/__init__.py b/caribou/antler/__init__.py
index e69de29..e5b9ab5 100644
--- a/caribou/antler/__init__.py
+++ b/caribou/antler/__init__.py
@@ -0,0 +1 @@
+from antler_settings import AntlerSettings
diff --git a/caribou/settings/settings_manager.py b/caribou/settings/settings_manager.py
index 1368f3a..4e9b43f 100644
--- a/caribou/settings/settings_manager.py
+++ b/caribou/settings/settings_manager.py
@@ -1,12 +1,11 @@
 import os
 from gi.repository import Gio
 from caribou.settings.setting_types import *
-from caribou.settings import GSETTINGS_SCHEMA
 
 class SettingsManager(object):
     def __init__(self, settings):
         self.groups = settings
-        self._gsettings = Gio.Settings(GSETTINGS_SCHEMA)
+        self._gsettings = Gio.Settings(settings.schema_id)
         self._gsettings.connect("changed", self._gsettings_changed_cb)
         self._settings_map = {}
         self._map_settings(self.groups)
diff --git a/data/Makefile.am b/data/Makefile.am
index 11e2611..4f9ac8b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,7 +2,9 @@ SUBDIRS = layouts
 
 @GSETTINGS_RULES@
 @INTLTOOL_XML_NOMERGE_RULE@
-gsettings_schemas_in_files = org.gnome.caribou.gschema.xml.in
+gsettings_schemas_in_files = \
+	org.gnome.caribou.gschema.xml.in \
+	org.gnome.antler.gschema.xml.in
 gsettings_SCHEMAS = $(gsettings_schemas_in_files:.gschema.xml.in=.gschema.xml)
 
 desktopdir = $(datadir)/applications
@@ -24,8 +26,11 @@ org.gnome.Caribou.Antler.service: org.gnome.Caribou.Antler.service.in
 
 EXTRA_DIST = $(desktop_in_files) $(autostart_in_files)
 
-org.gnome.caribou.gschema.xml.in: $(top_srcdir)/tools/make_schema.py
-	$< org.gnome.caribou
+org.gnome.caribou.gschema.xml.in: $(top_srcdir)/caribou/settings/caribou_settings.py
+	$(top_srcdir)/tools/make_schema.py caribou.settings.CaribouSettings
+
+org.gnome.antler.gschema.xml.in: $(top_srcdir)/caribou/antler/antler_settings.py
+	$(top_srcdir)/tools/make_schema.py caribou.antler.AntlerSettings
 
 CLEANFILES = $(desktop_DATA) \
 	$(autostart_DATA) \
diff --git a/tools/make_schema.py b/tools/make_schema.py
index c9ee361..a6d070f 100755
--- a/tools/make_schema.py
+++ b/tools/make_schema.py
@@ -72,13 +72,10 @@ if __name__ == "__main__":
         print "usage: %s <schema id>" % sys.argv[0]
         sys.exit(1)
 
-    avail_settings = dict([(s.schema_id, s) for s in AllSettings])
-    
-    try:
-        settings = avail_settings[sys.argv[-1]]
-    except KeyError:
-        print "Schema '%s' not available", sys.argv[-1]
-        sys.exit(1)
-    
+    modulename, settings_obj = sys.argv[-1].rsplit('.', 1)
+
+    module = __import__(modulename, locals(), globals(), [settings_obj])
+    settings = getattr(module, settings_obj)
+
     maker = SchemasMaker(settings)
     maker.create_schemas()



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