black 3f05b665 (add upload abort feat.)

This commit is contained in:
ed 2024-03-11 20:18:42 +00:00
parent 3f05b6655c
commit b6554a7f8c
2 changed files with 15 additions and 4 deletions

View file

@ -3629,7 +3629,7 @@ class HttpCli(object):
v["vp"] = self.args.SR + v["vp"] v["vp"] = self.args.SR + v["vp"]
if not have_unpost: if not have_unpost:
ret = [{"kinshi":1}] ret = [{"kinshi": 1}]
jtxt = '{"u":%s,"c":%s}' % (uret, json.dumps(ret, indent=0)) jtxt = '{"u":%s,"c":%s}' % (uret, json.dumps(ret, indent=0))
zi = len(uret.split('\n"pd":')) - 1 zi = len(uret.split('\n"pd":')) - 1

View file

@ -296,7 +296,11 @@ class Up2k(object):
user = (uname or "\n") if cfg in (1, 3) else "" user = (uname or "\n") if cfg in (1, 3) else ""
drp = self.droppable.get(ptop, {}) drp = self.droppable.get(ptop, {})
for wark, job in tab2.items(): for wark, job in tab2.items():
if wark in drp or (user and user != job["user"]) or (addr and addr != job["addr"]): if (
wark in drp
or (user and user != job["user"])
or (addr and addr != job["addr"])
):
continue continue
zt5 = ( zt5 = (
@ -3264,7 +3268,13 @@ class Up2k(object):
pass pass
def handle_rm( def handle_rm(
self, uname: str, ip: str, vpaths: list[str], lim: list[int], rm_up: bool, unpost: bool self,
uname: str,
ip: str,
vpaths: list[str],
lim: list[int],
rm_up: bool,
unpost: bool,
) -> str: ) -> str:
n_files = 0 n_files = 0
ok = {} ok = {}
@ -3321,7 +3331,8 @@ class Up2k(object):
dat = time.time() dat = time.time()
else: else:
if not self.args.unpost: if not self.args.unpost:
raise Pebkac(400, "the unpost feature is disabled in server config") t = "the unpost feature is disabled in server config"
raise Pebkac(400, t)
_, _, _, _, dip, dat = self._find_from_vpath(ptop, rem) _, _, _, _, dip, dat = self._find_from_vpath(ptop, rem)