Skip to content

Commit

Permalink
v1.3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Aug 10, 2022
1 parent 92ed4ba commit c00b80c
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions copyparty/__version__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding: utf-8

VERSION = (1, 3, 10)
VERSION = (1, 3, 11)
CODENAME = "god dag"
BUILD_DT = (2022, 8, 4)
BUILD_DT = (2022, 8, 10)

S_VERSION = ".".join(map(str, VERSION))
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
Expand Down
2 changes: 1 addition & 1 deletion copyparty/ftpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def __init__(self, hub: "SvcHub") -> None:
for h, lp in hs:
FTPServer((ip, int(lp)), h, ioloop)

thr = threading.Thread(target=ioloop.loop)
thr = threading.Thread(target=ioloop.loop, name="ftp")
thr.daemon = True
thr.start()

Expand Down
4 changes: 2 additions & 2 deletions copyparty/httpsrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, broker: "BrokerCli", nid: Optional[int]) -> None:
start_log_thrs(self.log, self.args.log_thrs, nid)

self.th_cfg: dict[str, Any] = {}
t = threading.Thread(target=self.post_init)
t = threading.Thread(target=self.post_init, name="hsrv-init2")
t.daemon = True
t.start()

Expand Down Expand Up @@ -171,7 +171,7 @@ def thr_listen(self, srv_sck: socket.socket) -> None:
def fun() -> None:
self.broker.say("cb_httpsrv_up")

threading.Thread(target=fun).start()
threading.Thread(target=fun, name="sig-hsrv-up1").start()

while not self.stopping:
if self.args.log_conn:
Expand Down
4 changes: 2 additions & 2 deletions copyparty/svchub.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _setup_logfile(self, printed: str) -> None:
def run(self) -> None:
self.tcpsrv.run()

thr = threading.Thread(target=self.thr_httpsrv_up)
thr = threading.Thread(target=self.thr_httpsrv_up, name="sig-hsrv-up2")
thr.daemon = True
thr.start()

Expand Down Expand Up @@ -308,7 +308,7 @@ def reload(self) -> str:
return "cannot reload; already in progress"

self.reloading = True
t = threading.Thread(target=self._reload)
t = threading.Thread(target=self._reload, name="reloading")
t.daemon = True
t.start()
return "reload initiated"
Expand Down
6 changes: 3 additions & 3 deletions copyparty/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ def __init__(self, cores: int):
self.work_q: Queue[int] = Queue()
self.done_q: Queue[tuple[int, str, int, int]] = Queue()
self.thrs = []
for _ in range(cores):
t = threading.Thread(target=self.worker)
for n in range(cores):
t = threading.Thread(target=self.worker, name="mth-" + str(n))
t.daemon = True
t.start()
self.thrs.append(t)
Expand Down Expand Up @@ -1390,7 +1390,7 @@ def db_ex_chk(log: "NamedLogger", ex: Exception, db_path: str) -> bool:
if str(ex) != "database is locked":
return False

thr = threading.Thread(target=lsof, args=(log, db_path))
thr = threading.Thread(target=lsof, args=(log, db_path), name="dbex")
thr.daemon = True
thr.start()

Expand Down
2 changes: 1 addition & 1 deletion copyparty/web/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ html.dy {
--a: #000;
--a-b: #000;
--a-hil: #000;
--a-gray: #000;
--a-gray: #bbb;
--a-dark: #000;

--btn-fg: #000;
Expand Down
15 changes: 11 additions & 4 deletions copyparty/web/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4652,9 +4652,9 @@ var treectl = (function () {
return ta[a];
};

r.goto = function (url, push) {
r.goto = function (url, push, back) {
get_tree("", url, true);
r.reqls(url, push, true);
r.reqls(url, push, true, back);
};

function get_tree(top, dst, rst) {
Expand Down Expand Up @@ -4823,9 +4823,10 @@ var treectl = (function () {
thegrid.setvis(true);
}

r.reqls = function (url, hpush, no_tree) {
r.reqls = function (url, hpush, no_tree, back) {
var xhr = new XHR();
xhr.top = url;
xhr.back = back
xhr.hpush = hpush;
xhr.ts = Date.now();
xhr.open('GET', xhr.top + '?ls' + (r.dots ? '&dots' : ''), true);
Expand Down Expand Up @@ -4893,6 +4894,12 @@ var treectl = (function () {
if (res.readme)
show_readme(res.readme);

if (this.hpush && !this.back) {
var ofs = ebi('wrap').offsetTop;
if (document.documentElement.scrollTop > ofs)
document.documentElement.scrollTop = ofs;
}

wintitle();
var fun = r.ls_cb;
if (fun) {
Expand Down Expand Up @@ -5068,7 +5075,7 @@ var treectl = (function () {
if (url.search.indexOf('doc=') + 1 && hbase == cbase)
return showfile.show(hbase + showfile.sname(url.search), true);

r.goto(url.pathname);
r.goto(url.pathname, false, true);
};

hist_replace(get_evpath() + window.location.hash);
Expand Down
1 change: 1 addition & 0 deletions scripts/sfx.ls
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ copyparty/web/splash.js,
copyparty/web/ui.css,
copyparty/web/up2k.js,
copyparty/web/util.js,
copyparty/web/w.hash.js,

0 comments on commit c00b80c

Please sign in to comment.