Skip to content

Commit

Permalink
Reduce flexibility of ReusableParts::load
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Apr 29, 2022
1 parent 0d6d5ed commit 3743e3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/nanoemoji/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from typing import Iterable, List, MutableMapping, NewType, Set, Tuple, Union


PathSource = Union[SVGShape, Iterable[SVGShape], "ReuseableParts", Path]
PathSource = Union[SVGShape, Iterable[SVGShape], "ReuseableParts"]


@lru_cache(maxsize=1)
Expand Down Expand Up @@ -76,9 +76,6 @@ def _add(self, shape: Shape):
self._add_norm_path(norm, shape)

def add(self, source: PathSource):
if isinstance(source, Path):
source = ReuseableParts.load(source)

if isinstance(source, ReuseableParts):
for normalized, shape_set in source.shape_sets.items():
for shape in shape_set:
Expand Down
2 changes: 1 addition & 1 deletion tests/parts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_merge():

def test_file_io():
parts = ReuseableParts()
parts.add(locate_test_file("rect.svg"))
parts.add(ReuseableParts.load(locate_test_file("rect.svg")))
check_num_shapes(parts, 1)

tmp_dir = mkdtemp()
Expand Down

0 comments on commit 3743e3f

Please sign in to comment.