Skip to content

Commit 4820466

Browse files
committed
include path in CouldNotParsePathError
1 parent a0feb53 commit 4820466

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

graphviz2drawio/models/Errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def __init__(self, message: str) -> None:
1313
class CouldNotParsePathError(GdValueError):
1414
"""Could not parse path from SVG element."""
1515

16-
def __init__(self, g: Element) -> None:
16+
def __init__(self, path: str) -> None:
1717
super().__init__(
18-
f"Could not parse path from SVG element: {g.tag} ({g.attrib})",
18+
f"Could not parse path from SVG element: {path}",
1919
)
2020

2121

graphviz2drawio/mx/RectFactory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def rect_from_svg_path(coords: CoordsTranslate, path_d: str) -> Rect:
99
parsed_path: svg_path.Path = svg_path.parse_path(path_d)
1010
if len(parsed_path) == 0 or not isinstance(parsed_path[0], svg_path.Move):
11-
raise CouldNotParsePathError
11+
raise CouldNotParsePathError(path_d)
1212
start: svg_path.Move = parsed_path.pop(0)
1313
min_x = start.start.real
1414
min_y = start.start.imag

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ line-length = 88
1010
indent-width = 4
1111

1212
lint.select = ["ALL"]
13-
lint.ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "D203", "D213", "ERA001", "ICN001", "PLR0913", "PT009", "S314", "SIM102", "TD002", "TID252", "N999"]
13+
lint.ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "D203", "D213", "ERA001", "ICN001", "PLR0913", "PT009", "RSE102", "S314", "SIM102", "TD002", "TID252", "N999"]
1414
target-version = "py310"
1515

1616
[tool.ruff.format]

0 commit comments

Comments
 (0)