ls列出链接

This commit is contained in:
limil 2024-11-03 11:45:20 +08:00
parent 9e8d5921ac
commit a2e0d2cd8a
2 changed files with 9 additions and 0 deletions

View File

@ -269,6 +269,13 @@ class PikPakFileSystem:
father, son_name = await self._path_to_father_node_and_son_name(path)
return await self._node_to_path(father), son_name
async def GetFileUrl(self, path : str) -> str:
node = await self._path_to_node(path)
if not isinstance(node, FileNode):
return None
await self._refresh(node)
return node.url
async def GetChildrenNames(self, path : str, ignore_files : bool) -> list[str]:
node = await self._path_to_node(path)
if not isinstance(node, DirNode):

View File

@ -199,6 +199,8 @@ class App(cmd2.Cmd):
if await Client.IsDir(args.path):
for child_name in await Client.GetChildrenNames(args.path, False):
await self.print(child_name)
else:
await self.print(await Client.GetFileUrl(args.path))
@RunSync
async def complete_cd(self, text, line, begidx, endidx):