From e36d51a7c2b6485a6d6026f5bc35023eaaeb195c Mon Sep 17 00:00:00 2001 From: Raffson Date: Mon, 2 Jan 2023 01:22:22 +0100 Subject: [PATCH] Adjust string representation of Flight class --- game/ato/flight.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/game/ato/flight.py b/game/ato/flight.py index 5efaee7c..405a5fb1 100644 --- a/game/ato/flight.py +++ b/game/ato/flight.py @@ -207,14 +207,13 @@ class Flight(SidcDescribable): return None def __repr__(self) -> str: - if self.custom_name: - return f"{self.custom_name} {self.count} x {self.unit_type}" - return f"[{self.flight_type}] {self.count} x {self.unit_type}" + return self.__str__() def __str__(self) -> str: + string = f"[{self.flight_type}] {self.count} x {self.unit_type}" if self.custom_name: - return f"{self.custom_name} {self.count} x {self.unit_type}" - return f"[{self.flight_type}] {self.count} x {self.unit_type}" + return f"{self.custom_name} - {string}" + return string def abort(self) -> None: from .flightplans.rtb import RtbFlightPlan