Add configuration to shape extractor.

This commit is contained in:
Sergey Vartanov 2021-05-21 01:28:22 +03:00
parent a8da4fce0a
commit d73e2b6a53
5 changed files with 24 additions and 10 deletions

View file

@ -4,6 +4,7 @@ Test icon generation for nodes.
Author: Sergey Vartanov (me@enzet.ru).
"""
from os import makedirs
from pathlib import Path
from typing import Dict
from roentgen.grid import draw_all_icons
@ -19,7 +20,9 @@ def test_icons() -> None:
def get_icon(tags: Dict[str, str]):
scheme = Scheme("scheme/default.yml")
icon_extractor = ShapeExtractor("icons/icons.svg")
icon_extractor = ShapeExtractor(
"icons/icons.svg", Path("icons/config.json")
)
icon, _ = scheme.get_icon(icon_extractor, tags)
return icon