Merge main.

This commit is contained in:
Sergey Vartanov 2022-05-15 20:13:58 +03:00
commit 518e8f9590
14 changed files with 192 additions and 102 deletions

View file

@ -351,14 +351,14 @@ class Constructor:
)
self.figures.append(figure)
processed: set[str] = set()
processed: Set[str] = set()
priority: int
icon_set: IconSet
icon_set, priority = self.scheme.get_icon(
self.extractor, line.tags, processed, self.configuration
)
if icon_set is not None:
labels: list[Label] = self.text_constructor.construct_text(
labels: List[Label] = self.text_constructor.construct_text(
line.tags, processed, self.configuration.label_mode
)
point: Point = Point(
@ -529,6 +529,10 @@ class Constructor:
)
self.points.append(point)
def get_sorted_figures(self) -> List[StyledFigure]:
"""Get all figures sorted by priority."""
return sorted(self.figures, key=lambda x: x.line_style.priority)
def check_level_number(tags: Tags, level: float) -> bool:
"""Check if element described by tags is no the specified level."""