From 50d8ff95ae5b911b254cb26f49d4ab77cc4ad8aa Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 10 Dec 2021 02:21:56 +0100 Subject: [PATCH] good stuff --- copyparty/httpcli.py | 10 ++++++++++ copyparty/tcpsrv.py | 7 +++++-- copyparty/web/up2k.js | 5 +++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 1020ab45..b9e4612b 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1367,6 +1367,9 @@ class HttpCli(object): try: fs_path = req_path + ext st = bos.stat(fs_path) + if stat.S_ISDIR(st.st_mode): + continue + file_ts = max(file_ts, st.st_mtime) editions[ext or "plain"] = [fs_path, st.st_size] except: @@ -1959,6 +1962,13 @@ class HttpCli(object): fmt = "{{}} {{:{},}} {{}}" nfmt = "{:,}" + for x in dirs: + n = x["name"] + "/" + if arg == "v": + n = "\033[94m" + n + + x["name"] = n + fmt = fmt.format(len(nfmt.format(biggest))) ret = [ "# {}: {}".format(x, ls[x]) diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index 36d3430a..3439f651 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -77,6 +77,9 @@ class TcpSrv(object): if "pub" in title_vars and "external" in unicode(desc): hits.append(("pub", ep)) + if "pub" in title_vars or "all" in title_vars: + hits.append(("all", ep)) + for var in title_vars: if var.startswith("ip-") and ep.startswith(var[3:]): hits.append((var, ep)) @@ -262,8 +265,8 @@ class TcpSrv(object): return eps def _set_wintitle(self, vars): - if "pub" not in vars: - vars["pub"] = {"Local-Only": 1} + vars["all"] = vars.get("all", {"Local-Only": 1}) + vars["pub"] = vars.get("pub", vars["all"]) vars2 = {} for k, eps in vars.items(): diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index b172f056..33bfe4ff 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1485,7 +1485,8 @@ function up2k_init(subtle) { err.indexOf('NotFoundError') !== -1 // macos-firefox permissions ) { pvis.seth(t.n, 1, 'OS-error'); - pvis.seth(t.n, 2, err); + pvis.seth(t.n, 2, err + ' @ ' + car); + console.log('OS-error', reader.error, '@', car); handled = true; } @@ -2113,7 +2114,7 @@ function up2k_init(subtle) { if (parallel_uploads < 1) bumpthread(1); - return { "init_deps": init_deps, "set_fsearch": set_fsearch, "ui": pvis } + return { "init_deps": init_deps, "set_fsearch": set_fsearch, "ui": pvis, "st": st, "uc": uc } }