From f1b8ab0dfc86f5abf0c67e9ebf98a5bb5fbf3f5a Mon Sep 17 00:00:00 2001 From: Bea <66849242+beawitcht@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:11:00 +0000 Subject: [PATCH] update dependencies, scripts, remove banner --- app/forms/GICs.json | 2 +- app/requirements.txt | 6 +++--- app/scripts/gics.py | 8 +++++--- app/templates/base.html | 3 --- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/forms/GICs.json b/app/forms/GICs.json index a53769c..0ebc70f 100644 --- a/app/forms/GICs.json +++ b/app/forms/GICs.json @@ -1 +1 @@ -{"GICs": [["Wales", "Welsh Gender Service - Cardiff - Wait time (months): 12-13"], ["Scotland", "Edinburgh Chalmers Centre - Wait time (months): 23"], ["England", "Nottingham Centre for Transgender Health - Wait time (months): 23"], ["Scotland", "Grampian - Wait time (months): 24"], ["Scotland", "Inverness Highland Sexual Health - Wait time (months): 29"], ["England", "Leeds and York Partnership Trust - Wait time (months): 53"], ["England", "Northants Northamptonshire Healthcare Trust - Wait time (months): 53"], ["Scotland", "Glasgow Sandyford - Wait time (months): 55"], ["Northern Ireland", "Belfast Brackenburn Clinic - Wait time (months): 59"], ["England", "London Tavistock and Portman Trust - Wait time (months): 60"], ["England", "Sheffield Porterbrook Clinic - Wait time (months): 62"], ["England", "Exeter Devon Partnership Trust - Wait time (months): 87"]]} \ No newline at end of file +{"GICs": [["Wales", "Welsh Gender Service - Cardiff - Wait time (months): 15"], ["Scotland", "Edinburgh Chalmers Centre - Wait time (months): 23"], ["England", "Nottingham Centre for Transgender Health - Wait time (months): 23"], ["Scotland", "Grampian - Wait time (months): 24"], ["Scotland", "Inverness Highland Sexual Health - Wait time (months): 29"], ["England", "Northants Northamptonshire Healthcare Trust - Wait time (months): 53"], ["Scotland", "Glasgow Sandyford - Wait time (months): 55"], ["England", "Leeds and York Partnership Trust - Wait time (months): 57"], ["Northern Ireland", "Belfast Brackenburn Clinic - Wait time (months): 59"], ["England", "London Tavistock and Portman Trust - Wait time (months): 60"], ["England", "Sheffield Porterbrook Clinic - Wait time (months): 62"], ["England", "Exeter Devon Partnership Trust - Wait time (months): 87"]]} \ No newline at end of file diff --git a/app/requirements.txt b/app/requirements.txt index 72f72d5..72fca4a 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,5 +1,5 @@ gunicorn==21.2.0 -flask==3.0.0 +flask==3.0.1 docxtpl==0.16.7 jinja2==3.1.3 convertapi==1.7.0 @@ -10,6 +10,6 @@ Flask-Limiter==3.5.0 Flask-Caching==2.1.0 deepdiff==6.7.1 discord.py==2.3.2 -pandas==2.1.4 -bs4==0.0.1 +pandas==2.2.0 +bs4==0.0.2 feedparser==6.0.11 \ No newline at end of file diff --git a/app/scripts/gics.py b/app/scripts/gics.py index bd3e09c..a36945f 100644 --- a/app/scripts/gics.py +++ b/app/scripts/gics.py @@ -70,8 +70,8 @@ async def on_ready(): else: country = "England" - if "Not accepting new patients" not in to_be_seen: - options.append((country, f"{service} - Wait time (months): {to_be_seen}" if pd.notna(to_be_seen) else "Unknown")) + if "Not accepting new patients" not in str(to_be_seen): + options.append((country, f"{service} - Wait time (months): {to_be_seen}" if pd.notna(to_be_seen) else f"{service} - Wait time (months): Unknown")) # Filter out under 18 services youth_services = ["GIDS", "KOI", "Youth", "Hub"] @@ -86,7 +86,9 @@ async def on_ready(): # Sort options by months remaining -options.sort(key=lambda x: int(re.search(r'\d+', str(x[1].split(': ')[1])).group()) if pd.notna(x[1].split(': ')[1]) and re.search(r'\d+', str(x[1].split(': ')[1])) else 9999) +print(options) +options = sorted(options, key=lambda x: int(re.search(r'\d+', str(x[1].split(': ')[1] if len(x) == 2 and 'Unknown' not in x[1] else '0')).group())) +print(options) new_options = {"GICs": options} new_options = json.dumps(new_options) diff --git a/app/templates/base.html b/app/templates/base.html index 260f2d9..1d11d0a 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -22,9 +22,6 @@ {% endblock %} - {% block body %} {% endblock %}