Adjust string representation of Flight class

This commit is contained in:
Raffson 2023-01-02 01:22:22 +01:00
parent 7267b70066
commit e36d51a7c2
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -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