From f76e80c5fae108d29ba87a495cd92a1f185c1da2 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 1 Aug 2012 15:45:10 +0200 Subject: Sort resources from highest priority to lowest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Previously it was from lowest to highest - Add the “Priority:” info to the “i” key in the roster --- src/contact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/contact.py') diff --git a/src/contact.py b/src/contact.py index 3de2f496..3a8e38ab 100644 --- a/src/contact.py +++ b/src/contact.py @@ -148,7 +148,7 @@ class Contact(object): def get_resources(self): """Return all resources, sorted by priority """ compare_resources = lambda x: x.priority - return sorted(self.resources, key=compare_resources) + return sorted(self.resources, key=compare_resources, reverse=True) def get_highest_priority_resource(self): """Return the resource with the highest priority""" -- cgit v1.2.3