refactor: make writable an instance method

This commit is contained in:
Abdessamad Derraz committed 2026-11-17 09:48:13 +01:00
1 parent bc50106587
commit 81a94fc267
7 files changed
+31 -15

No files matched your search

+2 -3
View File
@@ -167,8 +167,7 @@ class BaseExporter(ABC, Generic[Content]):
list carries."""
return False
@classmethod
def writable(cls, fe: NativeFile, require: str = "") -> bool:
def writable(self, fe: NativeFile, require: str = "") -> bool:
"""Whether this format can carry the entry.
An entry the platform already declares is always carried, hash or
@@ -176,7 +175,7 @@ class BaseExporter(ABC, Generic[Content]):
hands back a file poorer than the one it corrects. The requirement
only gates what we would be adding.
"""
return cls._carried(fe, require, cls.SINGLE_HASH_FIELD)
return self._carried(fe, require, self.SINGLE_HASH_FIELD)
@classmethod
def _carried(cls, fe: NativeFile, require: str, single: str | None) -> bool: