- lyr
- origin.lyr
- colormap.py
- Dockerfile
$ docker build . -t colormap
$ docker run --rm -v `realpath lyr`:/lyr -it colormap python3 colormap.py
| # type: ignore | |
| from slyr_community.parser import objects | |
| from slyr_community.parser.object import Object | |
| from slyr_community.parser.object_registry import REGISTRY | |
| from slyr_community.parser.stream import Stream | |
| LAYER_FILE = "/lyr/origin.lyr" | |
| for i in dir(objects): | |
| obj = getattr(objects, i) | |
| if type(obj) is type and issubclass(obj, Object): | |
| REGISTRY.register(obj) | |
| with open(LAYER_FILE, "rb") as f: | |
| stream = Stream(f, False, force_layer=True, offset=0) | |
| print(stream.read_object()) |
| FROM debian:12-slim | |
| RUN apt update && apt install -y mdbtools python3-pip git | |
| WORKDIR /work | |
| RUN mkdir /work/lib | |
| RUN git clone https://github.com/north-road/slyr.git /tmp/slyr | |
| RUN mv /tmp/slyr/slyr_community /work/lib/slyr_community | |
| ENV PYTHONPATH /work/lib | |
| COPY colormap.py /work/colormap.py |