diff options
Diffstat (limited to 'gi/overrides')
-rw-r--r-- | gi/overrides/Gtk.py | 15 | ||||
-rw-r--r-- | gi/overrides/Makefile.in | 2 |
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@ |