diff --git a/roentgen/raster.py b/roentgen/raster.py index 54e08cb..b37f010 100644 --- a/roentgen/raster.py +++ b/roentgen/raster.py @@ -10,16 +10,22 @@ from typing import List __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" +INKSCAPE_BIN: str = "INKSCAPE_BIN" + def rasterize(from_: Path, to_: Path, area: str = "", dpi: float = 90) -> None: """ Make PNG image out of SVG using Inkscape. - """ - inkscape: str = "inkscape" - if "INKSCAPE_BIN" in os.environ: - inkscape: str = os.environ["INKSCAPE_BIN"] - commands: List[str] = [inkscape] + See https://inkscape.org/ + """ + if "INKSCAPE_BIN" not in os.environ: + logging.fatal( + f"Environment variable {INKSCAPE_BIN} not set. Please, install " + f"Inkscape and set the variable to be able to rasterize SVG files." + ) + + commands: List[str] = [os.environ[INKSCAPE_BIN]] commands += ["--export-png", to_.absolute()] commands += ["--export-dpi", str(dpi)] if area: diff --git a/roentgen/road.py b/roentgen/road.py index 5d4999f..d97db04 100644 --- a/roentgen/road.py +++ b/roentgen/road.py @@ -83,12 +83,7 @@ class RoadPart: @classmethod def from_nodes( - cls, - node_1: OSMNode, - node_2: OSMNode, - flinger: Flinger, - road, - scale, + cls, node_1: OSMNode, node_2: OSMNode, flinger: Flinger, road, scale ) -> "RoadPart": """ Construct road part from OSM nodes.