From 9b67cdacf1de8bed521d460d58e713164ae21328 Mon Sep 17 00:00:00 2001 From: mcinj <98779161+mcinj@users.noreply.github.com> Date: Mon, 16 May 2022 23:56:47 -0400 Subject: [PATCH] changes --- requirements.txt | 3 ++- src/enter_giveaways.py | 2 +- src/templates/configuration.html | 4 +--- src/templates/log.html | 14 +------------- src/webserver_thread.py | 16 ++++------------ 5 files changed, 9 insertions(+), 30 deletions(-) diff --git a/requirements.txt b/requirements.txt index ec416c3..47e10c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ sqlalchemy_utils==0.38.2 python-dateutil==2.8.2 Flask==2.1.2 Flask-BasicAuth==0.2.0 -pyopenssl==22.0.0 \ No newline at end of file +pyopenssl==22.0.0 +alembic==1.7.7 \ No newline at end of file diff --git a/src/enter_giveaways.py b/src/enter_giveaways.py index fabb27d..42e1004 100644 --- a/src/enter_giveaways.py +++ b/src/enter_giveaways.py @@ -176,7 +176,7 @@ class EnterGiveaways: # game_list = soup.find_all('div', {'class': 'giveaway__row-inner-wrap'}) if not len(unentered_game_list) or (all_games_list_count == pinned_giveaway_count): - txt = f"〰️ We have run out of gifts to consider." + txt = f"🟡 We have run out of gifts to consider." logger.info(txt) break diff --git a/src/templates/configuration.html b/src/templates/configuration.html index 320839d..db2c119 100644 --- a/src/templates/configuration.html +++ b/src/templates/configuration.html @@ -17,9 +17,7 @@
-
{{config}}
- {% block content %} - {% endblock %} +
{{content}}
\ No newline at end of file diff --git a/src/templates/log.html b/src/templates/log.html index 155c1f4..80b7b71 100644 --- a/src/templates/log.html +++ b/src/templates/log.html @@ -17,19 +17,7 @@
-

-
+      
{{content}}
\ No newline at end of file diff --git a/src/webserver_thread.py b/src/webserver_thread.py index 06e25cd..348f0bf 100644 --- a/src/webserver_thread.py +++ b/src/webserver_thread.py @@ -41,21 +41,13 @@ class WebServerThread(threading.Thread): def config(): with open('../config/config.ini', 'r') as f: content = f.read() - return render_template('configuration.html', config=content) + return render_template('configuration.html', content=content) @app.route(f"{self.app_root}log") def logs(): - return render_template('log.html') - - @app.route(f"{self.app_root}stream") - def stream(): - def generate(): - with open('../config/info.log') as f: - while True: - yield f.read() - sleep(10) - - return app.response_class(generate(), mimetype='text/plain') + with open('../config/info.log', 'r') as f: + content = f.read() + return render_template('log.html', content=content) @app.route(f"{self.app_root}alive") def alive():