Reformat with Black.

This commit is contained in:
Sergey Vartanov 2021-07-30 03:25:41 +03:00
parent 0c95f608f8
commit be20c91951
5 changed files with 25 additions and 23 deletions

View file

@ -12,6 +12,7 @@ from roentgen import ui
from roentgen.color import get_gradient_color
from roentgen.figure import Building, Road, StyledFigure
from roentgen.flinger import Flinger
# fmt: off
from roentgen.icon import (
DEFAULT_SMALL_SHAPE_ID, Icon, IconSet, ShapeExtractor, ShapeSpecification
@ -22,7 +23,6 @@ from roentgen.osm_reader import (
from roentgen.point import Point
from roentgen.scheme import DEFAULT_COLOR, LineStyle, Scheme
from roentgen.util import MinMax
# fmt: on
__author__ = "Sergey Vartanov"
@ -373,7 +373,6 @@ class Constructor:
)
labels = self.scheme.construct_text(tags, "all", processed)
self.scheme.process_ignored(tags, processed)
point: Point = Point(
icon_set, labels, tags, processed, flung, node.coordinates,
priority=priority, draw_outline=draw_outline

View file

@ -39,7 +39,8 @@ class MapCSSWriter:
if clean_shapes:
elements["icon-image"] = (
f'"{self.icon_directory_name}/'
+ "___".join(clean_shapes) + '.svg"'
+ "___".join(clean_shapes)
+ '.svg"'
)
if opacity is not None:

View file

@ -57,7 +57,8 @@ class ArgumentParser(argparse.ArgumentParser):
and option["default"] != "==SUPPRESS=="
):
help_value += [
", default value: ", Tag("tt", [str(option['default'])])
", default value: ",
Tag("tt", [str(option["default"])]),
]
row.append(help_value)
else:

View file

@ -127,10 +127,8 @@ class Point(Tagged):
if is_place_for_extra:
left: float = -(len(self.icon_set.extra_icons) - 1) * 8
for icon in self.icon_set.extra_icons:
self.draw_point_shape(
svg, icon, self.point + np.array((left, self.y)),
occupied=occupied
)
point: np.array = self.point + np.array((left, self.y))
self.draw_point_shape(svg, icon, point, occupied=occupied)
left += 16
if self.icon_set.extra_icons:
self.y += 16
@ -239,23 +237,26 @@ class Point(Tagged):
svg.add(svg.rect((point[0] + i, point[1] + j), (1, 1)))
if out_fill_2:
svg.add(svg.text(
text_element = svg.text(
text, point, font_size=size, text_anchor="middle",
font_family=DEFAULT_FONT, fill=out_fill_2.hex,
stroke_linejoin="round", stroke_width=5,
stroke=out_fill_2.hex, opacity=out_opacity_2
))
stroke_linejoin="round", stroke_width=5, stroke=out_fill_2.hex,
opacity=out_opacity_2
) # fmt: skip
svg.add(text_element)
if out_fill:
svg.add(svg.text(
text_element = svg.text(
text, point, font_size=size, text_anchor="middle",
font_family=DEFAULT_FONT, fill=out_fill.hex,
stroke_linejoin="round", stroke_width=3,
stroke=out_fill.hex, opacity=out_opacity
))
svg.add(svg.text(
stroke_linejoin="round", stroke_width=3, stroke=out_fill.hex,
opacity=out_opacity,
) # fmt: skip
svg.add(text_element)
text_element = svg.text(
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

View file

@ -174,7 +174,7 @@ class RoadPart:
fill="none",
stroke="#FF0000",
stroke_width=0.5,
)
) # fmt: skip
drawing.add(line)
line = drawing.path(
(
@ -184,7 +184,7 @@ class RoadPart:
fill="none",
stroke="#0000FF",
stroke_width=0.5,
)
) # fmt: skip
drawing.add(line)
opacity: float = 0.4
@ -250,7 +250,7 @@ class RoadPart:
"L", self.left_connection,
"L", self.right_connection,
"Z",
]
] # fmt: skip
drawing.add(drawing.path(path_commands, fill="#CCCCCC"))
def draw_entrance(self, drawing: svgwrite.Drawing, is_debug: bool = False):
@ -267,7 +267,7 @@ class RoadPart:
"L", self.left_projection,
"L", self.left_connection,
"Z",
]
] # fmt: skip
if is_debug:
path = drawing.path(
path_commands,