From 90712980617e58d9e962513004b6087e9c5ed179 Mon Sep 17 00:00:00 2001 From: souliane Date: Wed, 25 Mar 2015 15:21:17 +0100 Subject: [PATCH] quick_frontend: better PEP-8 compliance --- frontends/src/quick_frontend/quick_app.py | 1 - .../src/quick_frontend/quick_contact_list.py | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontends/src/quick_frontend/quick_app.py b/frontends/src/quick_frontend/quick_app.py index bedda505..2a3d2614 100644 --- a/frontends/src/quick_frontend/quick_app.py +++ b/frontends/src/quick_frontend/quick_app.py @@ -458,7 +458,6 @@ class QuickApp(object): 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 --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index ff5670af..c7d9c30a 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -27,10 +27,11 @@ from sat_frontends.tools import jid 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 @@ class QuickContactList(QuickWidget): 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 @@ class QuickContactList(QuickWidget): 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 @@ class QuickContactList(QuickWidget): 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 @@ class QuickContactList(QuickWidget): 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 @@ class QuickContactList(QuickWidget): @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"""