haldis/app/hlds/definitions.py
Midgard d5bb14d3a5
Update views with HLDS models
Not expected to work yet, but if I don't do this generating migrations
gives errors.
2020-01-26 16:14:23 +01:00

16 lines
505 B
Python

# Import this class to load the standard HLDS definitions
from os import path
from typing import List
from .parser import parse_all_directory
from .models import Location
__all__ = ["location_definitions"]
# TODO Use proper way to get resources, see https://stackoverflow.com/a/10935674
DATA_DIR = path.join(path.dirname(__file__), "..", "..", "data")
# pylint: disable=invalid-name
location_definitions: List[Location] = parse_all_directory(DATA_DIR)
location_definitions.sort(key=lambda l: l.name)