summaryrefslogtreecommitdiff
path: root/gi/overrides
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:45:45 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:45:49 +0900
commit21d2cf757d6646ab430406c5406b15d753474e98 (patch)
tree146a899be01caa3a903c2a9949840b3293b81d38 /gi/overrides
parent4e74666c3f696a306557bf302a5e05d649e03365 (diff)
downloadpygobject2-21d2cf757d6646ab430406c5406b15d753474e98.tar.gz
pygobject2-21d2cf757d6646ab430406c5406b15d753474e98.tar.bz2
pygobject2-21d2cf757d6646ab430406c5406b15d753474e98.zip
Imported Upstream version 3.21.91
Change-Id: I89d5b175d455604c3510d61eb14e4f048d5ba446 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/overrides')
-rw-r--r--gi/overrides/Gtk.py15
-rw-r--r--gi/overrides/Makefile.in2
2 files changed, 15 insertions, 2 deletions
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 05ef403..831401c 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -1079,8 +1079,11 @@ class TreeModelRow(object):
for i in range(start, stop, step):
alist.append(self.model.get_value(self.iter, i))
return alist
+ elif isinstance(key, tuple):
+ return [self[k] for k in key]
else:
- raise TypeError("indices must be integers, not %s" % type(key).__name__)
+ raise TypeError("indices must be integers, slice or tuple, not %s"
+ % type(key).__name__)
def __setitem__(self, key, value):
if isinstance(key, int):
@@ -1099,8 +1102,16 @@ class TreeModelRow(object):
for i, v in enumerate(indexList):
self.model.set_value(self.iter, v, value[i])
+ elif isinstance(key, tuple):
+ if len(key) != len(value):
+ raise ValueError(
+ "attempt to assign sequence of size %d to sequence of size %d"
+ % (len(value), len(key)))
+ for k, v in zip(key, value):
+ self[k] = v
else:
- raise TypeError("index must be an integer or slice, not %s" % type(key).__name__)
+ raise TypeError("indices must be an integer, slice or tuple, not %s"
+ % type(key).__name__)
def _convert_negative_index(self, index):
new_index = self.model.get_n_columns() + index
diff --git a/gi/overrides/Makefile.in b/gi/overrides/Makefile.in
index d44e71b..da8e432 100644
--- a/gi/overrides/Makefile.in
+++ b/gi/overrides/Makefile.in
@@ -191,6 +191,7 @@ EXEEXT = @EXEEXT@
FFI_CFLAGS = @FFI_CFLAGS@
FFI_LIBS = @FFI_LIBS@
FGREP = @FGREP@
+GCOV = @GCOV@
GENHTML = @GENHTML@
GIO_CFLAGS = @GIO_CFLAGS@
GIO_LIBS = @GIO_LIBS@
@@ -315,6 +316,7 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@