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"
|
__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'):
|
||||||
|
|
Loading…
Reference in New Issue