tech-envision commited on
Commit
b781523
·
1 Parent(s): 065999f

Fix file listing in Gradio frontend

Browse files
Files changed (1) hide show
  1. gradio_app.py +2 -2
gradio_app.py CHANGED
@@ -68,14 +68,14 @@ async def list_dir(path: str, session: str, token: OAuthToken):
68
  output = await _vm_execute(user, session, cmd)
69
  if output.startswith("ls:"):
70
  return []
71
- entries = []
72
  for line in output.splitlines():
73
  line = line.strip()
74
  if not line or line in (".", ".."):
75
  continue
76
  is_dir = line.endswith("/")
77
  name = line[:-1] if is_dir else line
78
- entries.append({"name": name, "is_dir": is_dir})
79
  return entries
80
 
81
 
 
68
  output = await _vm_execute(user, session, cmd)
69
  if output.startswith("ls:"):
70
  return []
71
+ entries: list[list[str | bool]] = []
72
  for line in output.splitlines():
73
  line = line.strip()
74
  if not line or line in (".", ".."):
75
  continue
76
  is_dir = line.endswith("/")
77
  name = line[:-1] if is_dir else line
78
+ entries.append([name, is_dir])
79
  return entries
80
 
81