# HG changeset patch # User Goffi # Date 1470697809 -7200 # Node ID d941fa9954f453a8d98aba608c82ce6c22827cb8 # Parent 48a61879f9ef84a33fcbb42181c6a37ed6dd8714 quick frontend (contact): fixed roster and roster_connected in handler + add a next function for pyjamas compatibility diff -r 48a61879f9ef -r d941fa9954f4 frontends/src/quick_frontend/quick_contact_list.py --- a/frontends/src/quick_frontend/quick_contact_list.py Tue Aug 09 01:08:59 2016 +0200 +++ b/frontends/src/quick_frontend/quick_contact_list.py Tue Aug 09 01:10:09 2016 +0200 @@ -41,6 +41,16 @@ iter_cpy.sort(key=key) return pyjamas_max(iter_cpy) + # next doesn't exist in pyjamas + def next(iterable, *args): + try: + return iterable.next() + except StopIteration as e: + if args: + return args[0] + raise e + + handler = None @@ -596,25 +606,25 @@ return False @property - def roster_entities(self): + def roster(self): """Return all the bare JIDs of the roster entities. @return (set[jid.JID]) """ entities = set() for contact_list in self._clist.itervalues(): - entities.update(contact_list.roster_entities) + entities.update(contact_list.roster) return entities @property - def roster_entities_connected(self): + def roster_connected(self): """Return all the bare JIDs of the roster entities that are connected. @return (set[jid.JID]) """ entities = set() for contact_list in self._clist.itervalues(): - entities.update(contact_list.roster_entities_connected) + entities.update(contact_list.roster_connected) return entities @property