# HG changeset patch # User Kim Alvefur # Date 1577876905 -3600 # Node ID a70f5a6c7f0149407bc16e3827554ac29a5ad656 # Parent 02164f8aebac9efea5827b358191b0923e772cfb mod_rest: Apply Python source formatting on example diff -r 02164f8aebac -r a70f5a6c7f01 mod_rest/README.markdown --- a/mod_rest/README.markdown Wed Jan 01 12:06:46 2020 +0100 +++ b/mod_rest/README.markdown Wed Jan 01 12:08:25 2020 +0100 @@ -123,20 +123,26 @@ from flask import Flask, Response, request import xml.etree.ElementTree as ET -app = Flask('echobot') +app = Flask("echobot") + @app.before_request def parse(): request.stanza = ET.fromstring(request.data) -@app.route('/', methods = ['POST']) + +@app.route("/", methods=["POST"]) def hello(): - if request.stanza.tag == 'message': - return Response('Yes this is bot', content_type='application/xmpp+xml') + if request.stanza.tag == "message": + return Response( + "Yes this is bot", + content_type="application/xmpp+xml", + ) - return Response(status = 501) + return Response(status=501) -if __name__ == '__main__': + +if __name__ == "__main__": app.run() ```