From d22b72591b2c075a5ae6db5126a00d8d92748be6 Mon Sep 17 00:00:00 2001 From: juk0de <5322305+juk0de@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:21:19 +0100 Subject: [PATCH] equipment: ruff format and comment --- mtf2json/equipment.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mtf2json/equipment.py b/mtf2json/equipment.py index 6316eca..f4a9dc5 100644 --- a/mtf2json/equipment.py +++ b/mtf2json/equipment.py @@ -63,7 +63,11 @@ def get_name_and_size(value: str) -> tuple[str, str]: # now split the string res = re.split(":size:", value, flags=re.IGNORECASE) # convert to float and then to int if it's a whole number, otherwise keep as float - size = str(int(float(res[1]))) if float(res[1]).is_integer() else str(float(res[1])) + size = ( + str(int(float(res[1]))) + if float(res[1]).is_integer() + else str(float(res[1])) + ) return (res[0].strip(), f"{size}t") def add_sized_equipment( @@ -97,6 +101,7 @@ def add_sized_equipment( if slot_value and ":size:" in slot_value.lower(): slot_name, size = get_name_and_size(slot_value) # overwrite the old slot name + # FIXME: add tags like 'omnipod' and 'armored' if available mech_data["critical_slots"][location][key] = slot_name # add the equipment to the list (if not yet done) add_sized_equipment(mech_data, location, slot_name, size)