mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-14 08:41:53 +02:00
Reformat with Black.
This commit is contained in:
parent
0c95f608f8
commit
be20c91951
5 changed files with 25 additions and 23 deletions
|
@ -12,6 +12,7 @@ from roentgen import ui
|
||||||
from roentgen.color import get_gradient_color
|
from roentgen.color import get_gradient_color
|
||||||
from roentgen.figure import Building, Road, StyledFigure
|
from roentgen.figure import Building, Road, StyledFigure
|
||||||
from roentgen.flinger import Flinger
|
from roentgen.flinger import Flinger
|
||||||
|
|
||||||
# fmt: off
|
# fmt: off
|
||||||
from roentgen.icon import (
|
from roentgen.icon import (
|
||||||
DEFAULT_SMALL_SHAPE_ID, Icon, IconSet, ShapeExtractor, ShapeSpecification
|
DEFAULT_SMALL_SHAPE_ID, Icon, IconSet, ShapeExtractor, ShapeSpecification
|
||||||
|
@ -22,7 +23,6 @@ from roentgen.osm_reader import (
|
||||||
from roentgen.point import Point
|
from roentgen.point import Point
|
||||||
from roentgen.scheme import DEFAULT_COLOR, LineStyle, Scheme
|
from roentgen.scheme import DEFAULT_COLOR, LineStyle, Scheme
|
||||||
from roentgen.util import MinMax
|
from roentgen.util import MinMax
|
||||||
|
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
||||||
__author__ = "Sergey Vartanov"
|
__author__ = "Sergey Vartanov"
|
||||||
|
@ -373,7 +373,6 @@ class Constructor:
|
||||||
)
|
)
|
||||||
labels = self.scheme.construct_text(tags, "all", processed)
|
labels = self.scheme.construct_text(tags, "all", processed)
|
||||||
self.scheme.process_ignored(tags, processed)
|
self.scheme.process_ignored(tags, processed)
|
||||||
|
|
||||||
point: Point = Point(
|
point: Point = Point(
|
||||||
icon_set, labels, tags, processed, flung, node.coordinates,
|
icon_set, labels, tags, processed, flung, node.coordinates,
|
||||||
priority=priority, draw_outline=draw_outline
|
priority=priority, draw_outline=draw_outline
|
||||||
|
|
|
@ -39,7 +39,8 @@ class MapCSSWriter:
|
||||||
if clean_shapes:
|
if clean_shapes:
|
||||||
elements["icon-image"] = (
|
elements["icon-image"] = (
|
||||||
f'"{self.icon_directory_name}/'
|
f'"{self.icon_directory_name}/'
|
||||||
+ "___".join(clean_shapes) + '.svg"'
|
+ "___".join(clean_shapes)
|
||||||
|
+ '.svg"'
|
||||||
)
|
)
|
||||||
|
|
||||||
if opacity is not None:
|
if opacity is not None:
|
||||||
|
|
|
@ -57,7 +57,8 @@ class ArgumentParser(argparse.ArgumentParser):
|
||||||
and option["default"] != "==SUPPRESS=="
|
and option["default"] != "==SUPPRESS=="
|
||||||
):
|
):
|
||||||
help_value += [
|
help_value += [
|
||||||
", default value: ", Tag("tt", [str(option['default'])])
|
", default value: ",
|
||||||
|
Tag("tt", [str(option["default"])]),
|
||||||
]
|
]
|
||||||
row.append(help_value)
|
row.append(help_value)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -127,10 +127,8 @@ class Point(Tagged):
|
||||||
if is_place_for_extra:
|
if is_place_for_extra:
|
||||||
left: float = -(len(self.icon_set.extra_icons) - 1) * 8
|
left: float = -(len(self.icon_set.extra_icons) - 1) * 8
|
||||||
for icon in self.icon_set.extra_icons:
|
for icon in self.icon_set.extra_icons:
|
||||||
self.draw_point_shape(
|
point: np.array = self.point + np.array((left, self.y))
|
||||||
svg, icon, self.point + np.array((left, self.y)),
|
self.draw_point_shape(svg, icon, point, occupied=occupied)
|
||||||
occupied=occupied
|
|
||||||
)
|
|
||||||
left += 16
|
left += 16
|
||||||
if self.icon_set.extra_icons:
|
if self.icon_set.extra_icons:
|
||||||
self.y += 16
|
self.y += 16
|
||||||
|
@ -239,23 +237,26 @@ class Point(Tagged):
|
||||||
svg.add(svg.rect((point[0] + i, point[1] + j), (1, 1)))
|
svg.add(svg.rect((point[0] + i, point[1] + j), (1, 1)))
|
||||||
|
|
||||||
if out_fill_2:
|
if out_fill_2:
|
||||||
svg.add(svg.text(
|
text_element = svg.text(
|
||||||
text, point, font_size=size, text_anchor="middle",
|
text, point, font_size=size, text_anchor="middle",
|
||||||
font_family=DEFAULT_FONT, fill=out_fill_2.hex,
|
font_family=DEFAULT_FONT, fill=out_fill_2.hex,
|
||||||
stroke_linejoin="round", stroke_width=5,
|
stroke_linejoin="round", stroke_width=5, stroke=out_fill_2.hex,
|
||||||
stroke=out_fill_2.hex, opacity=out_opacity_2
|
opacity=out_opacity_2
|
||||||
))
|
) # fmt: skip
|
||||||
|
svg.add(text_element)
|
||||||
if out_fill:
|
if out_fill:
|
||||||
svg.add(svg.text(
|
text_element = svg.text(
|
||||||
text, point, font_size=size, text_anchor="middle",
|
text, point, font_size=size, text_anchor="middle",
|
||||||
font_family=DEFAULT_FONT, fill=out_fill.hex,
|
font_family=DEFAULT_FONT, fill=out_fill.hex,
|
||||||
stroke_linejoin="round", stroke_width=3,
|
stroke_linejoin="round", stroke_width=3, stroke=out_fill.hex,
|
||||||
stroke=out_fill.hex, opacity=out_opacity
|
opacity=out_opacity,
|
||||||
))
|
) # fmt: skip
|
||||||
svg.add(svg.text(
|
svg.add(text_element)
|
||||||
|
text_element = svg.text(
|
||||||
text, point, font_size=size, text_anchor="middle",
|
text, point, font_size=size, text_anchor="middle",
|
||||||
font_family=DEFAULT_FONT, fill=fill.hex
|
font_family=DEFAULT_FONT, fill=fill.hex,
|
||||||
))
|
) # fmt: skip
|
||||||
|
svg.add(text_element)
|
||||||
|
|
||||||
self.y += 11
|
self.y += 11
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ class RoadPart:
|
||||||
fill="none",
|
fill="none",
|
||||||
stroke="#FF0000",
|
stroke="#FF0000",
|
||||||
stroke_width=0.5,
|
stroke_width=0.5,
|
||||||
)
|
) # fmt: skip
|
||||||
drawing.add(line)
|
drawing.add(line)
|
||||||
line = drawing.path(
|
line = drawing.path(
|
||||||
(
|
(
|
||||||
|
@ -184,7 +184,7 @@ class RoadPart:
|
||||||
fill="none",
|
fill="none",
|
||||||
stroke="#0000FF",
|
stroke="#0000FF",
|
||||||
stroke_width=0.5,
|
stroke_width=0.5,
|
||||||
)
|
) # fmt: skip
|
||||||
drawing.add(line)
|
drawing.add(line)
|
||||||
|
|
||||||
opacity: float = 0.4
|
opacity: float = 0.4
|
||||||
|
@ -250,7 +250,7 @@ class RoadPart:
|
||||||
"L", self.left_connection,
|
"L", self.left_connection,
|
||||||
"L", self.right_connection,
|
"L", self.right_connection,
|
||||||
"Z",
|
"Z",
|
||||||
]
|
] # fmt: skip
|
||||||
drawing.add(drawing.path(path_commands, fill="#CCCCCC"))
|
drawing.add(drawing.path(path_commands, fill="#CCCCCC"))
|
||||||
|
|
||||||
def draw_entrance(self, drawing: svgwrite.Drawing, is_debug: bool = False):
|
def draw_entrance(self, drawing: svgwrite.Drawing, is_debug: bool = False):
|
||||||
|
@ -267,7 +267,7 @@ class RoadPart:
|
||||||
"L", self.left_projection,
|
"L", self.left_projection,
|
||||||
"L", self.left_connection,
|
"L", self.left_connection,
|
||||||
"Z",
|
"Z",
|
||||||
]
|
] # fmt: skip
|
||||||
if is_debug:
|
if is_debug:
|
||||||
path = drawing.path(
|
path = drawing.path(
|
||||||
path_commands,
|
path_commands,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue