mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
cleanup
This commit is contained in:
parent
8fef9e363e
commit
40ce4e2275
|
@ -10,8 +10,7 @@ turn your phone or raspi into a portable file server with resumable uploads/down
|
||||||
|
|
||||||
* server only needs `py2.7` or `py3.3+`, all dependencies optional
|
* server only needs `py2.7` or `py3.3+`, all dependencies optional
|
||||||
* browse/upload with [IE4](#browser-support) / netscape4.0 on win3.11 (heh)
|
* browse/upload with [IE4](#browser-support) / netscape4.0 on win3.11 (heh)
|
||||||
* *resumable* uploads need `firefox 34+` / `chrome 41+` / `safari 7+` for full speed
|
* *resumable* uploads need `firefox 34+` / `chrome 41+` / `safari 7+`
|
||||||
* code standard: `black`
|
|
||||||
|
|
||||||
try the **[read-only demo server](https://a.ocv.me/pub/demo/)** 👀 running from a basement in finland
|
try the **[read-only demo server](https://a.ocv.me/pub/demo/)** 👀 running from a basement in finland
|
||||||
|
|
||||||
|
|
|
@ -1498,20 +1498,17 @@ def guess_mime(url: str, fallback: str = "application/octet-stream") -> str:
|
||||||
def getalive(pids: list[int], pgid: int) -> list[int]:
|
def getalive(pids: list[int], pgid: int) -> list[int]:
|
||||||
alive = []
|
alive = []
|
||||||
for pid in pids:
|
for pid in pids:
|
||||||
if pgid:
|
try:
|
||||||
try:
|
if pgid:
|
||||||
# check if still one of ours
|
# check if still one of ours
|
||||||
if os.getpgid(pid) == pgid:
|
if os.getpgid(pid) == pgid:
|
||||||
alive.append(pid)
|
alive.append(pid)
|
||||||
except:
|
else:
|
||||||
pass
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
# windows doesn't have pgroups; assume
|
# windows doesn't have pgroups; assume
|
||||||
psutil.Process(pid)
|
psutil.Process(pid)
|
||||||
alive.append(pid)
|
alive.append(pid)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return alive
|
return alive
|
||||||
|
|
||||||
|
@ -1551,9 +1548,6 @@ def killtree(root: int) -> None:
|
||||||
os.kill(pid, signal.SIGTERM)
|
os.kill(pid, signal.SIGTERM)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not pids:
|
|
||||||
return # yay
|
|
||||||
|
|
||||||
for n in range(10):
|
for n in range(10):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
pids = getalive(pids, pgid)
|
pids = getalive(pids, pgid)
|
||||||
|
|
Loading…
Reference in a new issue