Skip to content

Commit

Permalink
(rv) add trolleybus template
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Dec 22, 2023
1 parent 51643dc commit 4d06a8e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions road_vehicle/docgen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def gen_docs(string_manager, rosters, everything):
("Buses", ["bus", "articulated_bus", "2decker", "coach"]),
("Lorries", ["l_truck", "m_truck", "h_truck"]),
("Urban Rail Transit", ["monorail"]),
("Trolleybuses", ["trolleybus"]),
]:
if not any(entry.techclass in techclassset for entry in roster.entries):
continue
Expand Down
1 change: 1 addition & 0 deletions road_vehicle/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"m_truck",
"h_truck",
"monorail",
"trolleybus",
"unknown",
]
supported_tags = ["sanctioned", "air conditioner"]
Expand Down
2 changes: 2 additions & 0 deletions road_vehicle/rosters/norbury.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from ..vehicles.buses import northwing, northwing_articulated, joyfield, joyfield_articulated
from ..vehicles.lorries import freedom, freedom_mkii, shield, leeway as leeway_truck, yellowriver
from ..vehicles.trolleybuses import burger
from road_vehicle.lib.roster import Roster

the_roster = Roster(
Expand All @@ -13,4 +14,5 @@
freedom_mkii,
shield,
yellowriver,
burger,
)
17 changes: 17 additions & 0 deletions road_vehicle/vehicles/trolleybuses/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys
import glob
import importlib

module = sys.modules[__name__]

__all__ = []
for p in glob.glob("road_vehicle/vehicles/trolleybuses/*.py"):
p = p.split("/")[-1][:-3]
if p == "__init__":
continue
__all__.append(p)

for p in __all__:
_imported_vehicle = importlib.import_module(f"road_vehicle.vehicles.trolleybuses.{p}")
setattr(module, p, _imported_vehicle.the_variant)
del _imported_vehicle
File renamed without changes.

0 comments on commit 4d06a8e

Please sign in to comment.