changeset 14:69d221c3e010

fixed sorting bug.
author casties
date Mon, 04 Mar 2013 19:22:27 +0100
parents 325e7c338815
children aca0fce3824b
files MPIWGRoot.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGRoot.py	Mon Mar 04 18:18:28 2013 +0100
+++ b/MPIWGRoot.py	Mon Mar 04 19:22:27 2013 +0100
@@ -259,7 +259,7 @@
     def getSections(self):
         """returns a list of all sections i.e. top-level MPIWGFolders"""
         items = self.objectValues(spec='MPIWGFolder')[:]
-        items.sort(key=lambda x:getattr(x, 'weight', '0'))
+        items.sort(key=lambda x:int(x.weight))
         return items
 
     def getSectionStyle(self, name, style=""):
@@ -276,7 +276,7 @@
             return []
 
         items = dir.objectValues(spec='MPIWGFeature')[:]
-        items.sort(key=lambda x:getattr(x, 'weight', '0'))
+        items.sort(key=lambda x:int(x.weight))
         if num is not None:
             # take only the last num elements
             items = items[-num:]
@@ -289,7 +289,7 @@
             return []
         
         items = dir.objectValues(spec='MPIWGDepartment')[:]
-        items.sort(key=lambda x:getattr(x, 'weight', '0'))
+        items.sort(key=lambda x:int(x.weight))
         return items
 
     def getMPIWGRoot(self):