gtk+ r21807 - in trunk: . gtk



Author: johan
Date: Tue Nov 25 13:09:43 2008
New Revision: 21807
URL: http://svn.gnome.org/viewvc/gtk+?rev=21807&view=rev

Log:
2008-11-25  Johan Dahlin  <jdahlin async com br>

    Bug 559947 â Unchecked dependency on python>=2.4

    * gtk/gtk-builder-convert:
    Avoid using sorted() which is only present in python 2.



Modified:
   trunk/ChangeLog
   trunk/gtk/gtk-builder-convert

Modified: trunk/gtk/gtk-builder-convert
==============================================================================
--- trunk/gtk/gtk-builder-convert	(original)
+++ trunk/gtk/gtk-builder-convert	Tue Nov 25 13:09:43 2008
@@ -269,9 +269,14 @@
 
         # Output the newly created root objects and sort them
         # by attribute id
-        for obj in sorted(self.root_objects,
-                          key=lambda n: n.getAttribute('id'),
-                          reverse=True):
+        # FIXME: Use sorted(self.root_objects,
+        #                   key=lambda n: n.getAttribute('id'),
+        #                   reverse=True):
+        # when we can depend on python 2.4 or higher
+        root_objects = self.root_objects[:]
+        root_objects.sort(lambda a, b: cmp(b.getAttribute('id'),
+                                           a.getAttribute('id')))
+        for obj in root_objects:
             self._interface.childNodes.insert(0, obj)
 
     def _convert(self, klass, node):



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