From b526cc68929250a7f71ff21ed8410ffd8db87a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Thu, 29 Jul 2021 10:48:55 +0200 Subject: Format using black --- webapp.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'webapp.py') diff --git a/webapp.py b/webapp.py index 62a1bdf..0e65573 100755 --- a/webapp.py +++ b/webapp.py @@ -12,11 +12,10 @@ import os import re import sys import time, datetime -# import traceback import logging from twitter import twitter -from telegram import telegram +# from telegram import telegram from netto import netto from rss import buildRSS from zdf import zdf @@ -27,25 +26,26 @@ app.secret_key = "NMcgoB.0wd+$.KVKj!F{3>U{%BBUVhL=7=5$:46rQH$Q{enCuU" def rssResponse(data): rss = buildRSS(data) - response = Response(rss, mimetype='text/xml') - response.headers['Access-Control-Allow-Origin'] = '*' + response = Response(rss, mimetype="text/xml") + response.headers["Access-Control-Allow-Origin"] = "*" return response @app.route("/") def main(): - return 'this is sparta' + return "this is sparta" @app.errorhandler(404) def not_found(e): - return 'Die angeforderte Seite konnte nicht gefunden werden.' + return "Die angeforderte Seite konnte nicht gefunden werden." @app.route("/twitter/") def feedTwitter(account): return rssResponse(twitter(account)) + # @app.route("/telegram/") # def feedTelegram(account): # content = [{'title': t, 'url': u, 'content': c, 'date': d} @@ -59,6 +59,7 @@ def feedTwitter(account): # response.headers['Access-Control-Allow-Origin'] = '*' # return response + @app.route("/netto/") def feedNetto(market): return rssResponse(netto(market)) @@ -69,9 +70,8 @@ def filterZDFFeed(feed): return rssResponse(zdf(feed)) -if __name__ == '__main__': - logging.basicConfig(filename='./main.log', level=logging.INFO) +if __name__ == "__main__": + logging.basicConfig(filename="./main.log", level=logging.INFO) - app.config['TEMPLATES_AUTO_RELOAD'] = True + app.config["TEMPLATES_AUTO_RELOAD"] = True app.run(threaded=True) - -- cgit v1.2.3