swh.fuse.fs.mountpoint module

class swh.fuse.fs.mountpoint.Root(fuse: Fuse)[source]

Bases: swh.fuse.fs.entry.FuseDirEntry

The FUSE mountpoint, consisting of the archive/ and meta/ directories

name: str = None
mode: int = 16749
depth: int = 1
class swh.fuse.fs.mountpoint.ArchiveDir(depth: int, fuse: Fuse)[source]

Bases: swh.fuse.fs.entry.FuseDirEntry

The archive/ directory is lazily populated with one entry per accessed SWHID, having actual SWHIDs as names

name: str = 'archive'
mode: int = 16749
create_child(swhid: swh.model.identifiers.SWHID)swh.fuse.fs.entry.FuseEntry[source]
async lookup(name: str)swh.fuse.fs.entry.FuseEntry[source]

Look up a FUSE entry by name

class swh.fuse.fs.mountpoint.MetaDir(depth: int, fuse: Fuse)[source]

Bases: swh.fuse.fs.entry.FuseDirEntry

The meta/ directory contains one SWHID.json file for each SWHID entry under archive/. The JSON file contain all available meta information about the given SWHID, as returned by the Software Heritage Web API for that object. Note that, in case of pagination (e.g., snapshot objects with many branches) the JSON file will contain a complete version with all pages merged together.

name: str = 'meta'
mode: int = 16749
class swh.fuse.fs.mountpoint.MetaEntry(name: str, mode: int, depth: int, fuse: Fuse, swhid: swh.model.identifiers.SWHID)[source]

Bases: swh.fuse.fs.entry.FuseFileEntry

An entry from the meta/ directory, containing for each accessed SWHID a corresponding SWHID.json file with all the metadata from the Software Heritage archive.

swhid: swh.model.identifiers.SWHID
async get_content() → bytes[source]

Return the content of a file entry

async size() → int[source]

Return the size (in bytes) of an entry