From e2e2db91d4b1302dbdc239ffe8870e447593516f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Apr 2020 16:47:12 +0000 Subject: [PATCH] flake8 format --- matrix.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/matrix.py b/matrix.py index 2e4ab2f66..c09814ed5 100644 --- a/matrix.py +++ b/matrix.py @@ -1,12 +1,11 @@ -__filename__="matrix.py" -__author__="Bob Mottram" -__license__="AGPL3+" -__version__="1.1.0" -__maintainer__="Bob Mottram" -__email__="bob@freedombone.net" -__status__="Production" +__filename__ = "matrix.py" +__author__ = "Bob Mottram" +__license__ = "AGPL3+" +__version__ = "1.1.0" +__maintainer__ = "Bob Mottram" +__email__ = "bob@freedombone.net" +__status__ = "Production" -import json def getMatrixAddress(actorJson: {}) -> str: """Returns matrix address for the given actor @@ -22,7 +21,7 @@ def getMatrixAddress(actorJson: {}) -> str: continue if not propertyValue.get('value'): continue - if propertyValue['type']!='PropertyValue': + if propertyValue['type'] != 'PropertyValue': continue if '@' not in propertyValue['value']: continue @@ -35,14 +34,15 @@ def getMatrixAddress(actorJson: {}) -> str: return propertyValue['value'] return '' -def setMatrixAddress(actorJson: {},matrixAddress: str) -> None: + +def setMatrixAddress(actorJson: {}, matrixAddress: str) -> None: """Sets an matrix address for the given actor """ if not actorJson.get('attachment'): - actorJson['attachment']=[] + actorJson['attachment'] = [] # remove any existing value - propertyFound=None + propertyFound = None for propertyValue in actorJson['attachment']: if not propertyValue.get('name'): continue @@ -50,7 +50,7 @@ def setMatrixAddress(actorJson: {},matrixAddress: str) -> None: continue if not propertyValue['name'].lower().startswith('matrix'): continue - propertyFound=propertyValue + propertyFound = propertyValue break if propertyFound: actorJson['attachment'].remove(propertyFound) @@ -73,12 +73,12 @@ def setMatrixAddress(actorJson: {},matrixAddress: str) -> None: continue if not propertyValue['name'].lower().startswith('matrix'): continue - if propertyValue['type']!='PropertyValue': + if propertyValue['type'] != 'PropertyValue': continue - propertyValue['value']=matrixAddress + propertyValue['value'] = matrixAddress return - newMatrixAddress={ + newMatrixAddress = { "name": "Matrix", "type": "PropertyValue", "value": matrixAddress