From eb65f720bfbedb20996f7346b9798d498cf2644e Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 16 Jul 2025 07:42:20 +0200 Subject: [PATCH] Run black to format code --- agenda/busy.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/agenda/busy.py b/agenda/busy.py index eb60793..2c8f323 100644 --- a/agenda/busy.py +++ b/agenda/busy.py @@ -282,12 +282,9 @@ def get_location_for_date( if locations: final_city, final_country = locations[-1] days_since_trip = (target_date - trip.end).days - + # If trip ended in UK, you should be home now - if ( - hasattr(final_country, "alpha_2") - and final_country.alpha_2 == "GB" - ): + if hasattr(final_country, "alpha_2") and final_country.alpha_2 == "GB": return ("Bristol", get_country("gb")) # For short trips to nearby countries or international trips @@ -297,11 +294,26 @@ def get_location_for_date( and hasattr(final_country, "alpha_2") and ( # European countries (close by rail/ferry) - final_country.alpha_2 in {"BE", "NL", "FR", "DE", "CH", "AT", "IT", "ES"} + final_country.alpha_2 + in {"BE", "NL", "FR", "DE", "CH", "AT", "IT", "ES"} # Nearby Balkan countries - or final_country.alpha_2 in {"GR", "AL", "XK", "HR", "SI", "MK", "BA", "ME", "RS", "BG", "RO"} + or final_country.alpha_2 + in { + "GR", + "AL", + "XK", + "HR", + "SI", + "MK", + "BA", + "ME", + "RS", + "BG", + "RO", + } # International trips (assume return home after trip ends) - or final_country.alpha_2 in {"US", "CA", "IN", "JP", "CN", "AU", "NZ", "BR", "AR", "ZA"} + or final_country.alpha_2 + in {"US", "CA", "IN", "JP", "CN", "AU", "NZ", "BR", "AR", "ZA"} ) ): return ("Bristol", get_country("gb"))