Format code with black, remove unused import.
This commit is contained in:
parent
29d5145b87
commit
46091779f0
42
web_view.py
42
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
|
||||
|
|
Loading…
Reference in a new issue