forked from indymedia/epicyon
flake8 format
parent
dc2386c583
commit
bb12ce191e
8
xmpp.py
8
xmpp.py
|
|
@ -6,7 +6,6 @@ __maintainer__="Bob Mottram"
|
|||
__email__ = "bob@freedombone.net"
|
||||
__status__ = "Production"
|
||||
|
||||
import json
|
||||
|
||||
def getXmppAddress(actorJson: {}) -> str:
|
||||
"""Returns xmpp address for the given actor
|
||||
|
|
@ -17,7 +16,7 @@ def getXmppAddress(actorJson: {}) -> str:
|
|||
if not propertyValue.get('name'):
|
||||
continue
|
||||
nameLower = propertyValue['name'].lower()
|
||||
if not (nameLower.startswith('xmpp') or \
|
||||
if not (nameLower.startswith('xmpp') or
|
||||
nameLower.startswith('jabber')):
|
||||
continue
|
||||
if not propertyValue.get('type'):
|
||||
|
|
@ -33,6 +32,7 @@ def getXmppAddress(actorJson: {}) -> str:
|
|||
return propertyValue['value']
|
||||
return ''
|
||||
|
||||
|
||||
def setXmppAddress(actorJson: {}, xmppAddress: str) -> None:
|
||||
"""Sets an xmpp address for the given actor
|
||||
"""
|
||||
|
|
@ -46,7 +46,7 @@ def setXmppAddress(actorJson: {},xmppAddress: str) -> None:
|
|||
continue
|
||||
if not propertyValue.get('type'):
|
||||
continue
|
||||
if not (propertyValue['name'].lower().startswith('xmpp') or \
|
||||
if not (propertyValue['name'].lower().startswith('xmpp') or
|
||||
propertyValue['name'].lower().startswith('jabber')):
|
||||
continue
|
||||
propertyFound = propertyValue
|
||||
|
|
@ -67,7 +67,7 @@ def setXmppAddress(actorJson: {},xmppAddress: str) -> None:
|
|||
if not propertyValue.get('type'):
|
||||
continue
|
||||
nameLower = propertyValue['name'].lower()
|
||||
if not (nameLower.startswith('xmpp') or \
|
||||
if not (nameLower.startswith('xmpp') or
|
||||
nameLower.startswith('jabber')):
|
||||
continue
|
||||
if propertyValue['type'] != 'PropertyValue':
|
||||
|
|
|
|||
Loading…
Reference in New Issue