[caribou] Revert "setting_types: avoid using GVariant"
- From: Eitan Isaacson <eitani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [caribou] Revert "setting_types: avoid using GVariant"
- Date: Mon, 5 Sep 2011 22:14:41 +0000 (UTC)
commit 8dbf0056a6bcfbc1164afbd4e2f5a8483b9f21c0
Author: Eitan Isaacson <eitan monotonous org>
Date: Mon Sep 5 10:46:26 2011 -0700
Revert "setting_types: avoid using GVariant"
This reverts commit 4ee4055a9a77e7cf0ebba636f569e3181e8d7697.
We are now on pygobject-3.0, so this issue went away.
caribou/settings/setting_types.py | 11 ++---------
tools/make_schema.py | 3 ++-
2 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/caribou/settings/setting_types.py b/caribou/settings/setting_types.py
index c4af2a6..f6a0503 100644
--- a/caribou/settings/setting_types.py
+++ b/caribou/settings/setting_types.py
@@ -107,8 +107,8 @@ class ValueSetting(Setting):
return bool(self.value)
@property
- def default_value(self):
- return "%r" % self.value
+ def gvariant(self):
+ return GLib.Variant(self.variant_type, self.value)
class BooleanSetting(ValueSetting):
variant_type = 'b'
@@ -117,13 +117,6 @@ class BooleanSetting(ValueSetting):
# Almost anything could be a boolean.
return bool(val)
- @property
- def default_value(self):
- if self.value:
- return "true"
- else:
- return "false"
-
class IntegerSetting(ValueSetting):
variant_type = 'i'
entry_type = ENTRY_SPIN
diff --git a/tools/make_schema.py b/tools/make_schema.py
index 8a6303e..a6d070f 100755
--- a/tools/make_schema.py
+++ b/tools/make_schema.py
@@ -57,7 +57,8 @@ class SchemasMaker:
key.setAttribute('type', setting.variant_type)
schemalist.appendChild(key)
self._append_children_element_value_pairs(
- doc, key, [('default', setting.default_value),
+ doc, key, [('default',
+ getattr(setting.gvariant, "print")(False)),
('_summary', setting.short_desc),
('_description', setting.long_desc)])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]