mirror of
https://github.com/9001/copyparty.git
synced 2025-08-19 01:42:20 -06:00
option to hide incomplete uploads
This commit is contained in:
parent
d03e34d55d
commit
58ba71a76f
|
@ -244,6 +244,7 @@ def run_argparse(argv, formatter):
|
||||||
ap.add_argument("-nw", action="store_true", help="disable writes (benchmark)")
|
ap.add_argument("-nw", action="store_true", help="disable writes (benchmark)")
|
||||||
ap.add_argument("-nih", action="store_true", help="no info hostname")
|
ap.add_argument("-nih", action="store_true", help="no info hostname")
|
||||||
ap.add_argument("-nid", action="store_true", help="no info disk-usage")
|
ap.add_argument("-nid", action="store_true", help="no info disk-usage")
|
||||||
|
ap.add_argument("--dotpart", action="store_true", help="dotfile incomplete uploads")
|
||||||
ap.add_argument("--no-zip", action="store_true", help="disable download as zip/tar")
|
ap.add_argument("--no-zip", action="store_true", help="disable download as zip/tar")
|
||||||
ap.add_argument("--no-sendfile", action="store_true", help="disable sendfile (for debugging)")
|
ap.add_argument("--no-sendfile", action="store_true", help="disable sendfile (for debugging)")
|
||||||
ap.add_argument("--no-scandir", action="store_true", help="disable scandir (for debugging)")
|
ap.add_argument("--no-scandir", action="store_true", help="disable scandir (for debugging)")
|
||||||
|
|
|
@ -789,12 +789,16 @@ class HttpCli(object):
|
||||||
except Pebkac:
|
except Pebkac:
|
||||||
if fname != os.devnull:
|
if fname != os.devnull:
|
||||||
fp = os.path.join(fdir, fname)
|
fp = os.path.join(fdir, fname)
|
||||||
|
fp2 = fp
|
||||||
|
if self.args.dotpart:
|
||||||
|
fp2 = os.path.join(fdir, "." + fname)
|
||||||
|
|
||||||
suffix = ".PARTIAL"
|
suffix = ".PARTIAL"
|
||||||
try:
|
try:
|
||||||
os.rename(fsenc(fp), fsenc(fp + suffix))
|
os.rename(fsenc(fp), fsenc(fp2 + suffix))
|
||||||
except:
|
except:
|
||||||
fp = fp[: -len(suffix)]
|
fp2 = fp2[: -len(suffix) - 1]
|
||||||
os.rename(fsenc(fp), fsenc(fp + suffix))
|
os.rename(fsenc(fp), fsenc(fp2 + suffix))
|
||||||
|
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
|
@ -1198,6 +1198,9 @@ class Up2k(object):
|
||||||
# raise Exception("aaa")
|
# raise Exception("aaa")
|
||||||
|
|
||||||
tnam = job["name"] + ".PARTIAL"
|
tnam = job["name"] + ".PARTIAL"
|
||||||
|
if self.args.dotpart:
|
||||||
|
tnam = "." + tnam
|
||||||
|
|
||||||
suffix = ".{:.6f}-{}".format(job["t0"], job["addr"])
|
suffix = ".{:.6f}-{}".format(job["t0"], job["addr"])
|
||||||
with ren_open(tnam, "wb", fdir=pdir, suffix=suffix) as f:
|
with ren_open(tnam, "wb", fdir=pdir, suffix=suffix) as f:
|
||||||
f, job["tnam"] = f["orz"]
|
f, job["tnam"] = f["orz"]
|
||||||
|
|
Loading…
Reference in a new issue