Remove trailing whitespaces.

This commit is contained in:
Emmanuel Gil Peyrot 2013-01-18 17:55:34 +01:00
commit 27b3592e16

View file

@ -71,7 +71,7 @@ class ByteIdentity(object):
def __str__(self):
return "%s/%s/%s/%s" % (self.category, self.idType, self.lang, self.name)
class XEP_0115():
cap_hash = None #capabilities hash is class variable as it is common to all profiles
@ -83,7 +83,7 @@ class XEP_0115():
host.trigger.add("Disco Handled", self.checkHash)
self.hash_cache = PersistentBinaryDict(NS_ENTITY_CAPABILITY) #key = hash or jid, value = features
self.hash_cache.load()
self.jid_hash = {} #jid to hash mapping, map to a discoInfo features if the hash method is unknown
self.jid_hash = {} #jid to hash mapping, map to a discoInfo features if the hash method is unknown
def checkHash(self, profile):
if not XEP_0115.cap_hash:
@ -91,7 +91,7 @@ class XEP_0115():
else:
self.presenceHack(profile)
return True
def getHandler(self, profile):
return XEP_0115_handler(self, profile)
@ -127,7 +127,7 @@ class XEP_0115():
if not client:
error ('Requesting hash for an inexistant client')
raise HashGenerationError
def generateHash_2(services, profile):
_s=[]
byte_identities = [ByteIdentity(identity) for identity in filter(lambda x:isinstance(x,disco.DiscoIdentity),services)] #FIXME: lang must be managed here
@ -146,12 +146,12 @@ class XEP_0115():
XEP_0115.cap_hash = b64encode(sha1(''.join(_s)).digest())
debug(_('Capability hash generated: [%s]') % XEP_0115.cap_hash)
self.presenceHack(profile)
services = client.discoHandler.info(client.jid, client.jid, '').addCallback(generateHash_2, profile)
class XEP_0115_handler(XMPPHandler):
implements(iwokkel.IDisco)
def __init__(self, plugin_parent, profile):
self.plugin_parent = plugin_parent
self.host = plugin_parent.host
@ -159,7 +159,7 @@ class XEP_0115_handler(XMPPHandler):
def connectionInitialized(self):
self.xmlstream.addObserver(CAPABILITY_UPDATE, self.update)
def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
return [disco.DiscoFeature(NS_ENTITY_CAPABILITY)]