From 46091779f01e8177bcd6d966e778bb9a3d84780a Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 16 Jul 2025 12:12:27 +0200 Subject: [PATCH] Format code with black, remove unused import. --- web_view.py | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/web_view.py b/web_view.py index 3a23807..c670732 100755 --- a/web_view.py +++ b/web_view.py @@ -7,7 +7,6 @@ import inspect import json import operator import os.path -import pprint import sys import time import traceback @@ -260,7 +259,9 @@ async def weekends() -> str: trip_list = agenda.trip.build_trip_list() busy_events = agenda.busy.get_busy_events(start, app.config, trip_list) - weekends = agenda.busy.weekends(start, busy_events, trip_list, app.config["PERSONAL_DATA"]) + weekends = agenda.busy.weekends( + start, busy_events, trip_list, app.config["PERSONAL_DATA"] + ) return flask.render_template( "weekends.html", items=weekends, @@ -614,23 +615,36 @@ def trip_debug_page(start: str) -> str: "computed_properties": { "title": trip.title, "end": trip.end.isoformat() if trip.end else None, - "countries": [{"name": c.name, "alpha_2": c.alpha_2, "flag": c.flag} for c in trip.countries], - "locations": [{"location": loc, "country": {"name": country.name, "alpha_2": country.alpha_2}} for loc, country in trip.locations()], + "countries": [ + {"name": c.name, "alpha_2": c.alpha_2, "flag": c.flag} + for c in trip.countries + ], + "locations": [ + { + "location": loc, + "country": {"name": country.name, "alpha_2": country.alpha_2}, + } + for loc, country in trip.locations() + ], "total_distance": trip.total_distance(), "total_co2_kg": trip.total_co2_kg(), "distances_by_transport_type": trip.distances_by_transport_type(), "co2_by_transport_type": trip.co2_by_transport_type(), }, - "schengen_compliance": { - "total_days_used": trip.schengen_compliance.total_days_used, - "days_remaining": trip.schengen_compliance.days_remaining, - "is_compliant": trip.schengen_compliance.is_compliant, - "current_180_day_period": [ - trip.schengen_compliance.current_180_day_period[0].isoformat(), - trip.schengen_compliance.current_180_day_period[1].isoformat() - ], - "days_over_limit": trip.schengen_compliance.days_over_limit, - } if trip.schengen_compliance else None, + "schengen_compliance": ( + { + "total_days_used": trip.schengen_compliance.total_days_used, + "days_remaining": trip.schengen_compliance.days_remaining, + "is_compliant": trip.schengen_compliance.is_compliant, + "current_180_day_period": [ + trip.schengen_compliance.current_180_day_period[0].isoformat(), + trip.schengen_compliance.current_180_day_period[1].isoformat(), + ], + "days_over_limit": trip.schengen_compliance.days_over_limit, + } + if trip.schengen_compliance + else None + ), } # Convert to JSON for pretty printing