Mercurial > libervia-backend
changeset 1391:1276e6a0716b
quick_frontend: better PEP-8 compliance
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 25 Mar 2015 15:21:17 +0100 |
parents | 337be5318177 |
children | c7082457d03f |
files | frontends/src/quick_frontend/quick_app.py frontends/src/quick_frontend/quick_contact_list.py |
diffstat | 2 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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"""