summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarien Zwart <marien.zwart@gmail.com>2012-09-03 12:39:09 +0200
committerAlejandro PiƱeiro <apinheiro@igalia.com>2012-09-05 11:17:26 +0200
commit55411a9a2bd933540e8ecda6c303e2325eb9865a (patch)
tree961c2dc5e5e6bd48c8dc24caa2b9a1acf8c0c5b4
parentde4b50c30b7383be7604f71db42c6db8409a5dcd (diff)
downloadcaribou-55411a9a2bd933540e8ecda6c303e2325eb9865a.tar.gz
Add a comment explaining the compatibility the getattr()ing provides.
-rwxr-xr-xtools/make_schema.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/make_schema.py b/tools/make_schema.py
index cd255d6..7237ac4 100755
--- a/tools/make_schema.py
+++ b/tools/make_schema.py
@@ -56,6 +56,14 @@ class SchemasMaker:
key.setAttribute('name', setting.gsettings_key)
key.setAttribute('type', setting.variant_type)
schemalist.appendChild(key)
+ # pygobject >= 3.3.3 and up expose g_variant_print as
+ # "print_". Older pygobjects expose it as "print", which
+ # we need to use through getattr as "print" is a keyword.
+ #
+ # Try the new name first, fall back to the old one if unavailable.
+ #
+ # Once we depend on pygobject >= 3.4 we can just call
+ # setting.gvariant.print_(False) directly.
printfunc = getattr(setting.gvariant, 'print_', None)
if printfunc is None:
printfunc = getattr(setting.gvariant, 'print')