misc cleanup:

* u2c: remove superfluous pathsep (harmless)
* tl: new strings
This commit is contained in:
ed 2024-12-02 22:52:39 +00:00
parent c5a000d2ae
commit 1a1d731043
4 changed files with 16 additions and 7 deletions

View file

@ -1132,7 +1132,9 @@ class Ctl(object):
isdir = stat.S_ISDIR(inf.st_mode) isdir = stat.S_ISDIR(inf.st_mode)
if self.ar.z or self.ar.drd: if self.ar.z or self.ar.drd:
rd = rel if isdir else os.path.dirname(rel) rd = rel if isdir else os.path.dirname(rel)
srd = rd.decode("utf-8", "replace").replace("\\", "/") srd = rd.decode("utf-8", "replace").replace("\\", "/").rstrip("/")
if srd:
srd += "/"
if prd != rd: if prd != rd:
prd = rd prd = rd
ls = {} ls = {}
@ -1167,11 +1169,11 @@ class Ctl(object):
bnames = [x for x in ls if x not in lnodes and x != b".hist"] bnames = [x for x in ls if x not in lnodes and x != b".hist"]
vpath = self.ar.url.split("://")[-1].split("/", 1)[-1] vpath = self.ar.url.split("://")[-1].split("/", 1)[-1]
names = [x.decode("utf-8", WTF8) for x in bnames] names = [x.decode("utf-8", WTF8) for x in bnames]
locs = [vpath + srd + "/" + x for x in names] locs = [vpath + srd + x for x in names]
while locs: while locs:
req = locs req = locs
while req: while req:
print("DELETING ~%s/#%s" % (srd, len(req))) print("DELETING ~%s#%s" % (srd, len(req)))
body = json.dumps(req).encode("utf-8") body = json.dumps(req).encode("utf-8")
sc, txt = web.req( sc, txt = web.req(
"POST", self.ar.url + "?delete", {}, body, MJ "POST", self.ar.url + "?delete", {}, body, MJ

View file

@ -97,6 +97,9 @@ SBUSY = "cannot receive uploads right now;\nserver busy with %s.\nPlease wait; t
HINT_HISTPATH = "you could try moving the database to another location (preferably an SSD or NVME drive) using either the --hist argument (global option for all volumes), or the hist volflag (just for this volume)" HINT_HISTPATH = "you could try moving the database to another location (preferably an SSD or NVME drive) using either the --hist argument (global option for all volumes), or the hist volflag (just for this volume)"
NULLSTAT = os.stat_result((0, -1, -1, 0, 0, 0, 0, 0, 0, 0))
class Dbw(object): class Dbw(object):
def __init__(self, c: "sqlite3.Cursor", n: int, nf: int, t: float) -> None: def __init__(self, c: "sqlite3.Cursor", n: int, nf: int, t: float) -> None:
self.c = c self.c = c
@ -2942,7 +2945,7 @@ class Up2k(object):
raise Exception() raise Exception()
except Exception as ex: except Exception as ex:
if n4g: if n4g:
st = os.stat_result((0, -1, -1, 0, 0, 0, 0, 0, 0, 0)) st = NULLSTAT
else: else:
lost.append((cur, dp_dir, dp_fn)) lost.append((cur, dp_dir, dp_fn))
continue continue

View file

@ -414,7 +414,7 @@ var tl_browser = {
"fr_emore": "select at least one item to rename", "fr_emore": "select at least one item to rename",
"fd_emore": "select at least one item to delete", "fd_emore": "select at least one item to delete",
"fc_emore": "select at least one item to cut", "fc_emore": "select at least one item to cut",
"fcp_emore": "select at least one item to copy", "fcp_emore": "select at least one item to copy to clipboard",
"fs_sc": "share the folder you're in", "fs_sc": "share the folder you're in",
"fs_ss": "share the selected files", "fs_ss": "share the selected files",
@ -470,9 +470,11 @@ var tl_browser = {
"fcc_ok": "copied {0} items to clipboard", "fcc_ok": "copied {0} items to clipboard",
"fcc_warn": 'copied {0} items to clipboard\n\nbut: only <b>this</b> browser-tab can paste them\n(since the selection is so absolutely massive)', "fcc_warn": 'copied {0} items to clipboard\n\nbut: only <b>this</b> browser-tab can paste them\n(since the selection is so absolutely massive)',
"fp_apply": "use these names",
"fp_ecut": "first cut or copy some files / folders to paste / move\n\nnote: you can cut / paste across different browser tabs", "fp_ecut": "first cut or copy some files / folders to paste / move\n\nnote: you can cut / paste across different browser tabs",
"fp_ename": "these {0} items cannot be moved here (names already exist):", "fp_ename": "{0} items cannot be moved here because the names are already taken. Give them new names below to continue, or blank the name to skip them:",
"fcp_ename": "these {0} items cannot be copied here (names already exist):", "fcp_ename": "{0} items cannot be copied here because the names are already taken. Give them new names below to continue, or blank the name to skip them:",
"fp_emore": "there are still some filename collisions left to fix",
"fp_ok": "move OK", "fp_ok": "move OK",
"fcp_ok": "copy OK", "fcp_ok": "copy OK",
"fp_busy": "moving {0} items...\n\n{1}", "fp_busy": "moving {0} items...\n\n{1}",
@ -604,6 +606,7 @@ var tl_browser = {
"u_pott": "<p>files: &nbsp; <b>{0}</b> finished, &nbsp; <b>{1}</b> failed, &nbsp; <b>{2}</b> busy, &nbsp; <b>{3}</b> queued</p>", "u_pott": "<p>files: &nbsp; <b>{0}</b> finished, &nbsp; <b>{1}</b> failed, &nbsp; <b>{2}</b> busy, &nbsp; <b>{3}</b> queued</p>",
"u_ever": "this is the basic uploader; up2k needs at least<br>chrome 21 // firefox 13 // edge 12 // opera 12 // safari 5.1", "u_ever": "this is the basic uploader; up2k needs at least<br>chrome 21 // firefox 13 // edge 12 // opera 12 // safari 5.1",
"u_su2k": 'this is the basic uploader; <a href="#" id="u2yea">up2k</a> is better', "u_su2k": 'this is the basic uploader; <a href="#" id="u2yea">up2k</a> is better',
"u_uput": 'optimize for speed (skip checksum)',
"u_ewrite": 'you do not have write-access to this folder', "u_ewrite": 'you do not have write-access to this folder',
"u_eread": 'you do not have read-access to this folder', "u_eread": 'you do not have read-access to this folder',
"u_enoi": 'file-search is not enabled in server config', "u_enoi": 'file-search is not enabled in server config',

View file

@ -114,6 +114,7 @@ var tl_cpanel = {{
"ab1": "disable no304", "ab1": "disable no304",
"ac1": "enable no304", "ac1": "enable no304",
"ad1": "enabling no304 will disable all caching; try this if k304 wasn't enough. This will waste a huge amount of network traffic!", "ad1": "enabling no304 will disable all caching; try this if k304 wasn't enough. This will waste a huge amount of network traffic!",
"ae1": "active downloads:",
}}, }},
}}; }};