diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:47:40 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:47:43 +0900 |
commit | b5f931cb493581fd50c1dfd70b56b86bb06577be (patch) | |
tree | ee1c36c554a96ba2abe788efb99f535a6dcb3c55 /gi/overrides/Gio.py | |
parent | ea25e6fa3f481a660c99b7c547a9edf201ccc553 (diff) | |
download | pygobject2-b5f931cb493581fd50c1dfd70b56b86bb06577be.tar.gz pygobject2-b5f931cb493581fd50c1dfd70b56b86bb06577be.tar.bz2 pygobject2-b5f931cb493581fd50c1dfd70b56b86bb06577be.zip |
Imported Upstream version 3.4.1.1
Change-Id: I1a118b7fbc2f48d20fda2013e99dfef5d2460b0c
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/overrides/Gio.py')
-rw-r--r-- | gi/overrides/Gio.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gi/overrides/Gio.py b/gi/overrides/Gio.py index 7f6e5c7..9f96440 100644 --- a/gi/overrides/Gio.py +++ b/gi/overrides/Gio.py @@ -101,8 +101,15 @@ class Settings(Gio.Settings): type_str = v.get_child_value(0).get_type_string() assert type_str.startswith('a') type_str = type_str[1:] + elif type_ == 'enum': + # v is an array with the allowed values + assert v.get_child_value(0).get_type_string().startswith('a') + type_str = v.get_child_value(0).get_child_value(0).get_type_string() + allowed = v.unpack() + if value not in allowed: + raise ValueError('value %s is not an allowed enum (%s)' % (value, allowed)) else: - raise NotImplementedError('Cannot handle allowed type range class' + str(type_)) + raise NotImplementedError('Cannot handle allowed type range class ' + str(type_)) self.set_value(key, GLib.Variant(type_str, value)) |