add filetype column

This commit is contained in:
ed
2020-11-17 23:43:55 +01:00
parent 1aa1b34c80
commit 9c309b1498
3 changed files with 12 additions and 5 deletions

View File

@@ -1077,7 +1077,12 @@ class HttpCli(object):
dt = datetime.utcfromtimestamp(inf.st_mtime)
dt = dt.strftime("%Y-%m-%d %H:%M:%S")
item = [margin, quotep(href), html_escape(fn), sz, dt]
try:
ext = "---" if is_dir else fn.rsplit(".", 1)[1]
except:
ext = "%"
item = [margin, quotep(href), html_escape(fn), sz, ext, dt]
if is_dir:
dirs.append(item)
else: