changeset 180:a6739bb6a575

add reverse sorting of Features
author casties
date Wed, 12 Jun 2013 14:52:29 +0200
parents 136b2d5b3e3d
children a743e22a155a
files MPIWGRoot.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGRoot.py	Wed Jun 12 10:37:10 2013 +0200
+++ b/MPIWGRoot.py	Wed Jun 12 14:52:29 2013 +0200
@@ -155,14 +155,14 @@
     getPathStyle = MPIWGHelper.getPathStyle
     
     
-    def getFeatures(self, num=None):
+    def getFeatures(self, num=None, reverse=False):
         """returns a list of the last num Features"""
         dir = getattr(self, 'features', None)
         if dir is None:
             return []
 
         items = dir.objectValues(spec='MPIWGFeature')
-        items.sort(key=lambda x:int(x.weight))
+        items.sort(key=lambda x:int(x.weight), reverse=reverse)
         if num is not None:
             # take only the last num elements
             items = items[-num:]