Spell out character helper height text
This commit is contained in:
+11
-5
@@ -268,11 +268,17 @@ def _format_height_text(feet, inches):
|
|||||||
inches_value = str(inches or "").strip()
|
inches_value = str(inches or "").strip()
|
||||||
if not feet_value and not inches_value:
|
if not feet_value and not inches_value:
|
||||||
return ""
|
return ""
|
||||||
if not feet_value:
|
|
||||||
return f'{int(inches_value)}"'
|
parts = []
|
||||||
if not inches_value:
|
if feet_value:
|
||||||
return f"{int(feet_value)}'"
|
feet_number = int(feet_value)
|
||||||
return f'{int(feet_value)}\'{int(inches_value)}"'
|
parts.append(f"{feet_number} foot" if feet_number == 1 else f"{feet_number} feet")
|
||||||
|
if inches_value:
|
||||||
|
inches_number = int(inches_value)
|
||||||
|
parts.append(
|
||||||
|
f"{inches_number} inch" if inches_number == 1 else f"{inches_number} inches"
|
||||||
|
)
|
||||||
|
return " ".join(parts)
|
||||||
|
|
||||||
|
|
||||||
def _ensure_sentence(value):
|
def _ensure_sentence(value):
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ class DumasImageNodeTests(unittest.TestCase):
|
|||||||
"<Picture 2> is the primary full-body reference for Dave.\n"
|
"<Picture 2> is the primary full-body reference for Dave.\n"
|
||||||
"<Picture 3> is a frontal facial reference for Dave.\n"
|
"<Picture 3> is a frontal facial reference for Dave.\n"
|
||||||
'The character ID string is "char_dave".\n'
|
'The character ID string is "char_dave".\n'
|
||||||
"Dave is 6'2\" tall.\n"
|
"Dave is 6 feet 2 inches tall.\n"
|
||||||
"Dave has a northern English accent.\n"
|
"Dave has a northern English accent.\n"
|
||||||
"wears a long grey coat."
|
"wears a long grey coat."
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user