ls列出链接
This commit is contained in:
parent
9e8d5921ac
commit
a2e0d2cd8a
@ -269,6 +269,13 @@ class PikPakFileSystem:
|
|||||||
father, son_name = await self._path_to_father_node_and_son_name(path)
|
father, son_name = await self._path_to_father_node_and_son_name(path)
|
||||||
return await self._node_to_path(father), son_name
|
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]:
|
async def GetChildrenNames(self, path : str, ignore_files : bool) -> list[str]:
|
||||||
node = await self._path_to_node(path)
|
node = await self._path_to_node(path)
|
||||||
if not isinstance(node, DirNode):
|
if not isinstance(node, DirNode):
|
||||||
|
2
main.py
2
main.py
@ -199,6 +199,8 @@ class App(cmd2.Cmd):
|
|||||||
if await Client.IsDir(args.path):
|
if await Client.IsDir(args.path):
|
||||||
for child_name in await Client.GetChildrenNames(args.path, False):
|
for child_name in await Client.GetChildrenNames(args.path, False):
|
||||||
await self.print(child_name)
|
await self.print(child_name)
|
||||||
|
else:
|
||||||
|
await self.print(await Client.GetFileUrl(args.path))
|
||||||
|
|
||||||
@RunSync
|
@RunSync
|
||||||
async def complete_cd(self, text, line, begidx, endidx):
|
async def complete_cd(self, text, line, begidx, endidx):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user