# HG changeset patch # User casties # Date 1362421347 -3600 # Node ID 69d221c3e010f8f0cc897e8970f3822f57eca4d6 # Parent 325e7c33881535918cb3467526f73e429ebc3e8f fixed sorting bug. diff -r 325e7c338815 -r 69d221c3e010 MPIWGRoot.py --- 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):