Changeset View
Changeset View
Standalone View
Standalone View
swh/fuse/fuse.py
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | ) -> pyfuse3.EntryAttributes: | ||||
async for entry in parent_entry: | async for entry in parent_entry: | ||||
if name == entry.name: | if name == entry.name: | ||||
attr = await self.get_attrs(entry) | attr = await self.get_attrs(entry) | ||||
return attr | return attr | ||||
logging.error(f"Unknown name during lookup: '{name}'") | logging.error(f"Unknown name during lookup: '{name}'") | ||||
raise pyfuse3.FUSEError(errno.ENOENT) | raise pyfuse3.FUSEError(errno.ENOENT) | ||||
async def readlink(self, inode: int, _ctx: pyfuse3.RequestContext) -> bytes: | |||||
entry = self.inode2entry(inode) | |||||
haltode: Not sure if we want to use directly the `target` field here or some getter/setter, because… | |||||
return os.fsencode(entry.target) | |||||
async def main(swhids: List[SWHID], root_path: Path, conf: Dict[str, Any]) -> None: | async def main(swhids: List[SWHID], root_path: Path, conf: Dict[str, Any]) -> None: | ||||
""" swh-fuse CLI entry-point """ | """ swh-fuse CLI entry-point """ | ||||
# Use pyfuse3 asyncio layer to match the rest of Software Heritage codebase | # Use pyfuse3 asyncio layer to match the rest of Software Heritage codebase | ||||
pyfuse3_asyncio.enable() | pyfuse3_asyncio.enable() | ||||
async with FuseCache(conf["cache"]) as cache: | async with FuseCache(conf["cache"]) as cache: | ||||
Show All 16 Lines |
Not sure if we want to use directly the target field here or some getter/setter, because FuseEntry does not have such field (so mypy complains).