quick_frontend: better PEP-8 compliance

This commit is contained in:
souliane 2015-03-25 15:21:17 +01:00
commit 9071298061
2 changed files with 8 additions and 9 deletions

View file

@ -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

View file

@ -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"""