mirror of
https://github.com/enzet/map-machine.git
synced 2025-04-28 09:47:17 +02:00
Fix documentation and code style.
This commit is contained in:
parent
0e62e4ac90
commit
836caf7138
6 changed files with 17 additions and 14 deletions
|
@ -47,6 +47,7 @@
|
|||
<w>temaki</w>
|
||||
<w>tileset</w>
|
||||
<w>vartanov</w>
|
||||
<w>wikitable</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue