[pygobject/pygobject-2-28] [gi-overrides] handle unichar gvalues when setting treemodels



commit aae4ce5d9e9b7747bf5847071a72a6cdd1371a3e
Author: John (J5) Palmieri <johnp redhat com>
Date:   Fri Mar 4 12:24:35 2011 -0500

    [gi-overrides] handle unichar gvalues when setting treemodels

 gi/overrides/Gtk.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 110b4d1..55d139e 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -779,6 +779,16 @@ class TreeModel(Gtk.TreeModel):
                 elif type_ == GObject.TYPE_UCHAR:
                     value_container.set_uchar(value)
                     value = value_container
+                elif type_ == GObject.TYPE_UNICHAR:
+                    cmp_classes = [str]
+                    if sys.version_info < (3, 0):
+                        cmp_classes.append(unicode)
+
+                    if isinstance(value, tuple(cmp_classes)):
+                        value = ord(value[0])
+
+                    value_container.set_uint(value)
+                    value = value_container
                 elif type_ == GObject.TYPE_UINT:
                     value_container.set_uint(value)
                     value = value_container



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]