From c091e0c16fb1dbcf5c2a3789c8960e5384a480c0 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Wed, 27 Oct 2010 22:49:52 +0000 Subject: Command mode in roster tab, toggle offline contacts with 'o' and sort contacts by show --- src/contact.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/contact.py') diff --git a/src/contact.py b/src/contact.py index 5fa0a17d..35a4a4a8 100644 --- a/src/contact.py +++ b/src/contact.py @@ -14,6 +14,11 @@ # You should have received a copy of the GNU General Public License # along with Poezio. If not, see . + +""" +Defines the Resource and Contact classes +""" + from sleekxmpp.xmlstream.stanzabase import JID class Resource(object): @@ -55,7 +60,7 @@ class Resource(object): class Contact(object): """ This a way to gather multiple resources from the same bare JID. - This class contains zero or more esource class and useful methods + This class contains zero or more Resource object and useful methods to get the resource with the highest priority, etc """ def __init__(self, bare_jid): @@ -116,6 +121,7 @@ class Contact(object): if resource.get_jid().full == fulljid: return resource return None + def toggle_folded(self): """ Fold if it's unfolded, and vice versa @@ -148,7 +154,7 @@ class Contact(object): def get_resources(self): """ - Return all resources + Return all resources, sorted by priority """ compare_resources = lambda x: x.get_priority() return sorted(self._resources, key=compare_resources) -- cgit v1.2.3