From 86403fe07a7c642b1a7f3d4ac25b86faea3a8f39 Mon Sep 17 00:00:00 2001 From: Vansh Comar Date: Tue, 2 Nov 2021 18:40:40 +0530 Subject: [PATCH] PEP8 changes --- app/__init__.py | 3 ++- app/routes.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 1977c7b..4d2adb0 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -59,7 +59,8 @@ app.config['BANG_PATH'] = os.getenv( app.config['BANG_FILE'] = os.path.join( app.config['BANG_PATH'], 'bangs.json') -app.config['RELEASES_URL'] = 'https://github.com/benbusby/whoogle-search/releases' +app.config['RELEASES_URL'] = 'https://github.com/' \ + 'benbusby/whoogle-search/releases' # The alternative to Google Translate is treated a bit differently than other # social media site alternatives, in that it is used for any translation diff --git a/app/routes.py b/app/routes.py index 4b8a777..19150f5 100644 --- a/app/routes.py +++ b/app/routes.py @@ -30,10 +30,11 @@ bang_json = json.load(open(app.config['BANG_FILE'])) # Check the newest version of WHOOGLE update = bsoup(get(app.config['RELEASES_URL']).text, 'html.parser') newest_version = update.select_one('[class="Link--primary"]').string[1:] -current_version = int(''.join(filter(str.isdigit, app.config['VERSION_NUMBER']))) +current_version = int(''.join(filter(str.isdigit, + app.config['VERSION_NUMBER']))) newest_version = int(''.join(filter(str.isdigit, newest_version))) -newest_version = newest_version if (current_version - < newest_version) else '' +newest_version = '' if current_version >= newest_version \ + else newest_version def auth_required(f):