flake8 format

main
Bob Mottram 2020-04-03 08:54:53 +00:00
parent dfb1263f1a
commit 9b713efb86
1 changed files with 30 additions and 26 deletions

View File

@ -6,13 +6,13 @@ __maintainer__="Bob Mottram"
__email__ = "bob@freedombone.net" __email__ = "bob@freedombone.net"
__status__ = "Production" __status__ = "Production"
import json
def getDonationTypes() -> str: def getDonationTypes() -> str:
return ('patreon','paypal','gofundme','liberapay', \ return ('patreon', 'paypal', 'gofundme', 'liberapay',
'kickstarter','indiegogo','crowdsupply', \ 'kickstarter', 'indiegogo', 'crowdsupply',
'subscribestar') 'subscribestar')
def getDonationUrl(actorJson: {}) -> str: def getDonationUrl(actorJson: {}) -> str:
"""Returns a link used for donations """Returns a link used for donations
""" """
@ -37,6 +37,7 @@ def getDonationUrl(actorJson: {}) -> str:
return donateUrl.split('"')[0] return donateUrl.split('"')[0]
return '' return ''
def setDonationUrl(actorJson: {}, donateUrl: str) -> None: def setDonationUrl(actorJson: {}, donateUrl: str) -> None:
"""Sets a link used for donations """Sets a link used for donations
""" """
@ -65,7 +66,10 @@ def setDonationUrl(actorJson: {},donateUrl: str) -> None:
if propertyFound: if propertyFound:
actorJson['attachment'].remove(propertyFound) actorJson['attachment'].remove(propertyFound)
donateValue='<a href="'+donateUrl+'" rel="me nofollow noopener noreferrer" target="_blank">'+donateUrl+'</a>' donateValue = \
'<a href="' + donateUrl + \
'" rel="me nofollow noopener noreferrer" target="_blank">' + \
donateUrl + '</a>'
for propertyValue in actorJson['attachment']: for propertyValue in actorJson['attachment']:
if not propertyValue.get('name'): if not propertyValue.get('name'):