diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2021-06-28 19:43:17 +0200 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2021-06-28 19:43:17 +0200 | 
| commit | 71e128041c83d9f26bcd7212088e6b50b0ec8319 (patch) | |
| tree | d187d41258a06a54a4db1525b733846c8bd45b7e | |
| parent | 00bcc7c2aa211aed0053dcc6a09aa6d2a476b9ab (diff) | |
support Python 3.7
| -rwxr-xr-x | bin/nvm | 7 | 
1 files changed, 5 insertions, 2 deletions
@@ -95,14 +95,17 @@ class Line:          if self.product.startswith("national"):              self.css_class = "longdistance"          elif self.product == "tram": -            self.name = self.name.removeprefix("STR ") +            # str.removeprefix requires Python ≥ 3.9 +            if self.name.startswith("STR "): +                self.name = self.name[4:]              self.css_class = "tram"          elif self.product == "suburban":              self.css_class = "suburban"          elif self.product == "subway":              self.css_class = "subway"          elif self.product == "bus": -            self.name = self.name.removeprefix("Bus ") +            if self.name.startswith("Bus "): +                self.name = self.name[4:]              self.css_class = "bus"  | 
