Changeset View
Changeset View
Standalone View
Standalone View
swh/fuse/fs/entry.py
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | async def size(self) -> int: | ||||
return 0 | return 0 | ||||
async def __aiter__(self) -> AsyncIterator[FuseEntry]: | async def __aiter__(self) -> AsyncIterator[FuseEntry]: | ||||
""" Return the child entries of a directory entry """ | """ Return the child entries of a directory entry """ | ||||
yield None | yield None | ||||
async def lookup(self, name: str) -> FuseEntry: | |||||
""" Look up a FUSE entry by name """ | |||||
async for entry in self: | |||||
if entry.name == name: | |||||
return entry | |||||
return None | |||||
def get_target(self) -> Union[str, bytes, Path]: | def get_target(self) -> Union[str, bytes, Path]: | ||||
""" Return the path target of a symlink entry """ | """ Return the path target of a symlink entry """ | ||||
return None | return None | ||||
def get_relative_root_path(self) -> str: | def get_relative_root_path(self) -> str: | ||||
return "../" * (self.depth - 1) | return "../" * (self.depth - 1) | ||||
def create_child(self, constructor: Any, **kwargs) -> FuseEntry: | def create_child(self, constructor: Any, **kwargs) -> FuseEntry: | ||||
return constructor(depth=self.depth + 1, fuse=self.fuse, **kwargs) | return constructor(depth=self.depth + 1, fuse=self.fuse, **kwargs) |