# HG changeset patch # User souliane # Date 1427293277 -3600 # Node ID 1276e6a0716b4bbcccba3b0fdf0b45109f78bccf # Parent 337be531817759fd8b9e895e5d45439c1248a54c quick_frontend: better PEP-8 compliance diff -r 337be5318177 -r 1276e6a0716b frontends/src/quick_frontend/quick_app.py --- a/frontends/src/quick_frontend/quick_app.py Wed Mar 25 10:09:59 2015 +0100 +++ b/frontends/src/quick_frontend/quick_app.py Wed Mar 25 15:21:17 2015 +0100 @@ -458,7 +458,6 @@ def newMessageHandler(self, from_jid_s, msg, type_, to_jid_s, extra, profile): from_jid = jid.JID(from_jid_s) to_jid = jid.JID(to_jid_s) - if not self.trigger.point("newMessageTrigger", from_jid, msg, type_, to_jid, extra, profile=profile): return diff -r 337be5318177 -r 1276e6a0716b frontends/src/quick_frontend/quick_contact_list.py --- a/frontends/src/quick_frontend/quick_contact_list.py Wed Mar 25 10:09:59 2015 +0100 +++ b/frontends/src/quick_frontend/quick_contact_list.py Wed Mar 25 15:21:17 2015 +0100 @@ -27,10 +27,11 @@ try: # FIXME: to be removed when an acceptable solution is here - unicode('') # XXX: unicode doesn't exist in pyjamas -except (TypeError, AttributeError): # Error raised is not the same depending on pyjsbuild options + unicode('') # XXX: unicode doesn't exist in pyjamas +except (TypeError, AttributeError): # Error raised is not the same depending on pyjsbuild options # XXX: pyjamas' max doesn't support key argument, so we implement it ourself pyjamas_max = max + def max(iterable, key): iter_cpy = list(iterable) iter_cpy.sort(key=key) @@ -52,7 +53,7 @@ self._special_extras = set() # group data contain jids in groups and misc frontend data - self._groups = {} # groups to group data map + self._groups = {} # groups to group data map # contacts in roster (bare jids) self._roster = set() @@ -172,9 +173,9 @@ else: cache = cache[C.CONTACT_RESOURCES][entity.resource] - if name == 'status': #XXX: we get the first status for 'status' key + if name == 'status': # XXX: we get the first status for 'status' key # TODO: manage main language for statuses - return cache[C.PRESENCE_STATUSES].get('default','') + return cache[C.PRESENCE_STATUSES].get('default', '') return cache[name] except KeyError: @@ -200,7 +201,6 @@ main_resource = self.getCache(entity, C.CONTACT_MAIN_RESOURCE) return jid.JID(u"{}/{}".format(entity, main_resource)) - def setGroupData(self, group, name, value): """Register a data for a group @@ -385,7 +385,7 @@ if show == C.PRESENCE_UNAVAILABLE: if not entity.resource: cache[C.CONTACT_RESOURCES].clear() - cache[C.CONTACT_MAIN_RESOURCE]= None + cache[C.CONTACT_MAIN_RESOURCE] = None else: try: del cache[C.CONTACT_RESOURCES][entity.resource] @@ -412,7 +412,7 @@ @param new_nick(unicode): new nick of the entity @param profile: %(doc_profile)s """ - raise NotImplementedError # Must be implemented by frontends + raise NotImplementedError # Must be implemented by frontends def unselectAll(self): """Unselect all contacts"""