Skip to content

Commit

Permalink
Don't reinvent wheels unless the new one is particularly awesome
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Apr 29, 2022
1 parent 3743e3f commit 9dff1e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nanoemoji/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def fromstring(cls, string) -> "ReuseableParts":
parts = cls()
if first == "<":
svg = SVG.fromstring(string).topicosvg()
for path in svg.xpath("//svg:path"):
parts.add(SVGPath(d=path.attrib["d"]))
for shape in svg.shapes():
parts.add(SVGPath(d=shape.as_path().d))
elif first == "{":
json_dict = json.loads(string)
parts.version = tuple(int(v) for v in json_dict.pop("version").split("."))
Expand Down

0 comments on commit 9dff1e9

Please sign in to comment.