Mercurial > libervia-backend
diff frontends/src/primitivus/contact_list.py @ 587:952322b1d490
Remove trailing whitespaces.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:34 +0100 |
parents | ca13633d3b6b |
children | 84a6e83157c2 |
line wrap: on
line diff
--- a/frontends/src/primitivus/contact_list.py Fri Jan 18 17:55:27 2013 +0100 +++ b/frontends/src/primitivus/contact_list.py Fri Jan 18 17:55:34 2013 +0100 @@ -37,7 +37,7 @@ self.alert_jid=set() self.show_status = False self.show_disconnected = False - + #we now build the widget self.frame = urwid.Frame(self.__buildList()) self.main_widget = sat_widgets.LabelLine(self.frame, sat_widgets.SurroundedText(_("Contacts"))) @@ -65,8 +65,8 @@ elif key == "meta d": #user wants to (un)hide disconnected contacts self.show_disconnected = not self.show_disconnected self.update() - return super(ContactList, self).keypress(size, key) - + return super(ContactList, self).keypress(size, key) + def __contains__(self, jid): for group in self.groups: if jid.short in self.groups[group][1]: @@ -116,9 +116,9 @@ @param content: widget list, e.g. SimpleListWalker @param contacts: list of JID""" contacts = list(param_contacts) - + widgets = [] #list of built widgets - + for contact in contacts: if contact.startswith(const_PRIVATE_PREFIX): contact_disp = ('alert' if contact in self.alert_jid else "show_normal", unescapePrivate(contact)) @@ -148,7 +148,7 @@ widget.data = contact widget.comp = contact_disp[1].lower() #value to use for sorting widgets.append(widget) - + widgets.sort(key=lambda widget: widget.comp) for widget in widgets: @@ -160,7 +160,7 @@ specials = self.specials.keys() specials.sort() for special in specials: - jid=JID(special) + jid=JID(special) name = self.getCache(jid, 'name') nick = self.getCache(jid, 'nick') special_disp = ('alert' if special in self.alert_jid else 'default', nick or name or jid.node or jid.short) @@ -176,7 +176,7 @@ def __buildList(self): """Build the main contact list widget""" content = urwid.SimpleListWalker([]) - + self.__buildSpecials(content) if self.specials: content.append(urwid.Divider('=')) @@ -205,7 +205,7 @@ def getContact(self): """Return contact currently selected""" return self.selected - + def clearContacts(self): """clear all the contact list""" QuickContactList.clearContacts(self) @@ -238,7 +238,7 @@ contacts.sort() self.list_wid.changeValues(contacts) self._emit('change')""" - + def remove(self, jid): """remove a contact from the list""" QuickContactList.remove(self, jid) @@ -252,7 +252,7 @@ for group in groups_to_remove: del self.groups[group] self.update() - + def add(self, jid, param_groups=[None]): """add a contact to the list""" self.replace(jid,param_groups)