Skip to content

Commit

Permalink
fix name beint None when stripped
Browse files Browse the repository at this point in the history
  • Loading branch information
iiiii7d committed Jul 1, 2024
1 parent d0aa66e commit c711bad
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def __init__(self, cache_dir: Path = DEFAULT_CACHE_DIR, timeout: int = DEFAULT_T
code = k.upper()
coordinates = (vv["x"], vv["z"])
name = None if (result := re.search(r"(.*) \((.*?)\)", vv["label"])) is None else result.group(1)
name = name.strip().removesuffix("Station")
if name is not None:
name = name.strip().removesuffix("Station")
self.rail_station(codes={code}, company=company, coordinates=coordinates, name=name, world="New")
rich.print(RESULT + f"MRT {line_code} has {len(v['markers'])} stations")

Expand Down

0 comments on commit c711bad

Please sign in to comment.