diff --git a/src/penai/models.py b/src/penai/models.py index e42c47d..6b6c197 100644 --- a/src/penai/models.py +++ b/src/penai/models.py @@ -1,6 +1,6 @@ from copy import deepcopy from dataclasses import dataclass, field -from functools import cache, cached_property +from functools import cached_property from pathlib import Path from typing import Generic, Self, TypeVar from uuid import UUID @@ -100,7 +100,6 @@ class PenpotComponentDict(dict[str, PenpotComponent]): def get_component_names(self) -> list[str]: return [component.name for component in self.values()] - @cache def get_by_name(self, name: str) -> PenpotComponent: # This can definitely be implemented more efficiently but since the number # of components per file is typically very small, this shouldn't become diff --git a/src/penai/svg.py b/src/penai/svg.py index 0af75c8..51209e1 100644 --- a/src/penai/svg.py +++ b/src/penai/svg.py @@ -579,11 +579,9 @@ def _get_shapes_by_attr( ) return matched_shapes[0] - # @cache def get_shape_by_name(self, name: str) -> PenpotShapeElement: return self._get_shapes_by_attr("name", name, should_be_unique=True) - # @cache def get_shape_by_id(self, shape_id: str) -> PenpotShapeElement: return self._get_shapes_by_attr("shape_id", shape_id, should_be_unique=True) diff --git a/src/penai/utils/svg.py b/src/penai/utils/svg.py index 30a7b39..a1bd924 100644 --- a/src/penai/utils/svg.py +++ b/src/penai/utils/svg.py @@ -55,7 +55,9 @@ def validate_uri(x: Any) -> bool: @contextmanager def temp_file_for_content( - content: str | bytes, extension: str, delete: bool = False + content: str | bytes, + extension: str, + delete: bool = False, ) -> Generator[Path, Any, Any]: """Create a temporary file for a given file content.""" if extension and not extension.startswith("."):