diff --git a/data/dictionary.xml b/data/dictionary.xml index f5b4b0b..37ec1a1 100644 --- a/data/dictionary.xml +++ b/data/dictionary.xml @@ -47,6 +47,7 @@ temaki tileset vartanov + wikitable diff --git a/map_machine/doc/moire_manager.py b/map_machine/doc/moire_manager.py index 3363828..3728b54 100644 --- a/map_machine/doc/moire_manager.py +++ b/map_machine/doc/moire_manager.py @@ -58,10 +58,7 @@ class ArgumentParser(argparse.ArgumentParser): self.arguments.append(argument) def get_moire_help(self) -> Tag: - """ - Return Moire table with "Option" and "Description" columns filled with - arguments. - """ + """Return Moire table with "Option" and "Description" columns.""" table: Code = [[["Option"], ["Description"]]] for option in self.arguments: diff --git a/map_machine/doc/wiki.py b/map_machine/doc/wiki.py index 210c373..b15cf39 100644 --- a/map_machine/doc/wiki.py +++ b/map_machine/doc/wiki.py @@ -29,7 +29,11 @@ ROENTGEN_HEADER_PATTERN: re.Pattern = re.compile("===.*Röntgen.*===") class WikiTable: - """SVG table with icon combinations.""" + """ + Trivial wiki table constructor. + + Creates table with icon combinations. + """ def __init__(self, collection: Collection, page_name: str): self.collection: Collection = collection diff --git a/map_machine/element/grid.py b/map_machine/element/grid.py index e0a71b4..f78f723 100644 --- a/map_machine/element/grid.py +++ b/map_machine/element/grid.py @@ -109,14 +109,13 @@ class Grid: map_.draw(constructor) for text, i, j in self.texts: - svg.add( - Text( - text, - flinger.fling((i, j)) + (0, 3), - font_family="JetBrains Mono", - font_size=12, - ) + text_element: Text = Text( + text, + flinger.fling((i, j)) + np.array((0, 3)), + font_family="JetBrains Mono", + font_size=12, ) + svg.add(text_element) with output_path.open("w") as output_file: svg.write(output_file) diff --git a/map_machine/map_configuration.py b/map_machine/map_configuration.py index e49f08b..54b61ce 100644 --- a/map_machine/map_configuration.py +++ b/map_machine/map_configuration.py @@ -12,6 +12,8 @@ from map_machine.scheme import Scheme __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" +DARK_BACKGROUND: Color = Color("#111111") + class DrawingMode(Enum): """Map drawing mode.""" @@ -91,7 +93,7 @@ class MapConfiguration: def background_color(self) -> Optional[Color]: """Get background map color based on drawing mode.""" if self.drawing_mode not in (DrawingMode.NORMAL, DrawingMode.BLACK): - return Color("#111111") + return DARK_BACKGROUND return None def get_icon( diff --git a/map_machine/mapper.py b/map_machine/mapper.py index 34bb86c..a16f45b 100644 --- a/map_machine/mapper.py +++ b/map_machine/mapper.py @@ -34,7 +34,7 @@ __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" ROAD_PRIORITY: float = 40.0 -DEFAULT_SIZE = (800.0, 600.0) +DEFAULT_SIZE: tuple[float, float] = (800.0, 600.0) class Map: