Skip to content
Snippets Groups Projects
Commit b81d0c98 authored by vlorentz's avatar vlorentz
Browse files

Fix Sphinx warning cause by duplicate attribute definitions

parent 845b5d8c
No related branches found
No related tags found
No related merge requests found
......@@ -30,10 +30,6 @@ SWHID_REGEXP = r"swh:1:(cnt|dir|rel|rev|snp):[0-9a-f]{40}"
class Content(FuseFileEntry):
""" Software Heritage content artifact.
Attributes:
swhid: Software Heritage persistent identifier
prefetch: optional prefetched metadata used to set entry attributes
Content leaves (AKA blobs) are represented on disks as regular files,
containing the corresponding bytes, as archived.
......@@ -44,6 +40,7 @@ class Content(FuseFileEntry):
swhid: CoreSWHID
prefetch: Any = None
"""optional prefetched metadata used to set entry attributes"""
async def get_content(self) -> bytes:
data = await self.fuse.get_blob(self.swhid)
......@@ -62,9 +59,6 @@ class Content(FuseFileEntry):
class Directory(FuseDirEntry):
""" Software Heritage directory artifact.
Attributes:
swhid: Software Heritage persistent identifier
Directory nodes are represented as directories on the file-system,
containing one entry for each entry of the archived directory. Entry names
and other metadata, including permissions, will correspond to the archived
......@@ -139,9 +133,6 @@ class Directory(FuseDirEntry):
class Revision(FuseDirEntry):
""" Software Heritage revision artifact.
Attributes:
swhid: Software Heritage persistent identifier
Revision (AKA commit) nodes are represented on the file-system as
directories with the following entries:
......@@ -432,9 +423,6 @@ class RevisionHistoryShardByPage(FuseDirEntry):
class Release(FuseDirEntry):
""" Software Heritage release artifact.
Attributes:
swhid: Software Heritage persistent identifier
Release nodes are represented on the file-system as directories with the
following entries:
......@@ -504,9 +492,6 @@ class ReleaseType(FuseFileEntry):
class Snapshot(FuseDirEntry):
""" Software Heritage snapshot artifact.
Attributes:
swhid: Software Heritage persistent identifier
Snapshot nodes are represented on the file-system as recursive directories
following the branch names structure. For example, a branch named
``refs/tags/v1.0`` will be represented as a ``refs`` directory containing a
......
......@@ -36,19 +36,17 @@ class EntryMode(IntEnum):
@dataclass
class FuseEntry:
""" Main wrapper class to manipulate virtual FUSE entries
Attributes:
name: entry filename
mode: entry permission mode
fuse: internal reference to the main FUSE class
inode: unique integer identifying the entry
"""
name: str
"""entry filename"""
mode: int
"""entry permission mode"""
depth: int
fuse: Fuse
"""internal reference to the main FUSE class"""
inode: int = field(init=False)
"""unique integer identifying the entry"""
file_info_attrs: Dict[str, Any] = field(init=False, default_factory=dict)
def __post_init__(self):
......@@ -134,13 +132,11 @@ class FuseDirEntry(FuseEntry):
@dataclass
class FuseSymlinkEntry(FuseEntry):
""" FUSE virtual symlink entry
Attributes:
target: path to symlink target
"""
mode: int = field(init=False, default=int(EntryMode.RDONLY_LNK))
target: Union[str, bytes, Path]
"""path to symlink target"""
async def size(self) -> int:
return len(str(self.target))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment