Fix documentation and code style.

This commit is contained in:
Sergey Vartanov 2022-10-05 17:09:39 +04:00
parent 0e62e4ac90
commit 836caf7138
6 changed files with 17 additions and 14 deletions

View file

@ -47,6 +47,7 @@
<w>temaki</w>
<w>tileset</w>
<w>vartanov</w>
<w>wikitable</w>
</words>
</dictionary>
</component>

View file

@ -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:

View file

@ -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

View file

@ -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)

View file

@ -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(

View file

@ -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: