forked from indymedia/epicyon
flake8 format
parent
dfb1263f1a
commit
9b713efb86
12
donate.py
12
donate.py
|
@ -6,13 +6,13 @@ __maintainer__="Bob Mottram"
|
|||
__email__ = "bob@freedombone.net"
|
||||
__status__ = "Production"
|
||||
|
||||
import json
|
||||
|
||||
def getDonationTypes() -> str:
|
||||
return ('patreon','paypal','gofundme','liberapay', \
|
||||
'kickstarter','indiegogo','crowdsupply', \
|
||||
return ('patreon', 'paypal', 'gofundme', 'liberapay',
|
||||
'kickstarter', 'indiegogo', 'crowdsupply',
|
||||
'subscribestar')
|
||||
|
||||
|
||||
def getDonationUrl(actorJson: {}) -> str:
|
||||
"""Returns a link used for donations
|
||||
"""
|
||||
|
@ -37,6 +37,7 @@ def getDonationUrl(actorJson: {}) -> str:
|
|||
return donateUrl.split('"')[0]
|
||||
return ''
|
||||
|
||||
|
||||
def setDonationUrl(actorJson: {}, donateUrl: str) -> None:
|
||||
"""Sets a link used for donations
|
||||
"""
|
||||
|
@ -65,7 +66,10 @@ def setDonationUrl(actorJson: {},donateUrl: str) -> None:
|
|||
if 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']:
|
||||
if not propertyValue.get('name'):
|
||||
|
|
Loading…
Reference in New Issue