Browse Source

removed the use of f'' strings

master
manetta 4 years ago
parent
commit
a959f2f954
  1. 14
      run.py

14
run.py

@ -16,7 +16,7 @@ A...P...
# Config # Config
DOMAIN = 'https://ap.virtualprivateserver.space' DOMAIN = 'https://ap.virtualprivateserver.space'
# domain = 'http://localhost:5000' # for local testing only, ActivityPub doesn't allow the usage of http:// (it only accepts https://) # domain = 'http://localhost:5010' # for local testing only, ActivityPub doesn't allow the usage of http:// (it only accepts https://)
def publicKey(): def publicKey():
if not os.path.exists('./public.pem'): if not os.path.exists('./public.pem'):
@ -36,8 +36,8 @@ APP = flask.Flask(__name__)
@APP.route('/', methods=['GET']) @APP.route('/', methods=['GET'])
def index(): def index():
""" Displays the index page accessible at '/' """ """ Displays the index page accessible at '/' """
content = f'This ActivityPub Server is running !!! (exciting): ({ DOMAIN })' content = 'This ActivityPub Server is running !!! (exciting): ({ domain })'.format(domain=DOMAIN)
return content return content
@APP.route('/.well-known/webfinger', methods=['GET']) @APP.route('/.well-known/webfinger', methods=['GET'])
@ -87,10 +87,10 @@ def inbox(actor):
""" """
if flask.request.method == 'GET': if flask.request.method == 'GET':
return f'''This has been a <em>{ flask.request.method }</em> request. <br> return '''This has been a <em>{ mode }</em> request. <br>
It came with the following header: <br><br><em>{ flask.request.headers }</em><br><br> It came with the following header: <br><br><em>{ headers }</em><br><br>
You have searched for the actor <em>{ actor }</em>. <br> You have searched for the actor <em>{ actor }</em>. <br>
This is <em>{ DOMAIN }</em>'s shared inbox: <br><br><em>{ str(INBOX) }</em>''' This is <em>{ domain }</em>'s shared inbox: <br><br><em>{ inbox }</em>'''.format(mode=flask.request.method, headers=flask.request.headers, actor=actor, somain=DOMAIN, inbox=str(INBOX))
if flask.request.method == 'POST': if flask.request.method == 'POST':
INBOX.append(flask.request.data) INBOX.append(flask.request.data)
@ -98,4 +98,4 @@ def inbox(actor):
if __name__ == '__main__': if __name__ == '__main__':
APP.debug=True APP.debug=True
APP.run(port=5001) APP.run(port=5010)
Loading…
Cancel
Save