mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
support cygpaths for mtag binaries
This commit is contained in:
parent
caba4e974c
commit
1881019ede
|
@ -10,7 +10,7 @@ import hashlib
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from .__init__ import WINDOWS
|
from .__init__ import WINDOWS
|
||||||
from .util import IMPLICATIONS, undot, Pebkac, fsdec, fsenc, statdir, nuprint
|
from .util import IMPLICATIONS, uncyg, undot, Pebkac, fsdec, fsenc, statdir, nuprint
|
||||||
|
|
||||||
|
|
||||||
class VFS(object):
|
class VFS(object):
|
||||||
|
@ -439,8 +439,8 @@ class AuthSrv(object):
|
||||||
raise Exception("invalid -v argument: [{}]".format(v_str))
|
raise Exception("invalid -v argument: [{}]".format(v_str))
|
||||||
|
|
||||||
src, dst, perms = m.groups()
|
src, dst, perms = m.groups()
|
||||||
if WINDOWS and src.startswith("/"):
|
if WINDOWS:
|
||||||
src = "{}:\\{}".format(src[1], src[3:])
|
src = uncyg(src)
|
||||||
|
|
||||||
# print("\n".join([src, dst, perms]))
|
# print("\n".join([src, dst, perms]))
|
||||||
src = fsdec(os.path.abspath(fsenc(src)))
|
src = fsdec(os.path.abspath(fsenc(src)))
|
||||||
|
@ -524,9 +524,7 @@ class AuthSrv(object):
|
||||||
if vflag == "-":
|
if vflag == "-":
|
||||||
pass
|
pass
|
||||||
elif vflag:
|
elif vflag:
|
||||||
if WINDOWS and vflag.startswith("/"):
|
vol.histpath = uncyg(vflag) if WINDOWS else vflag
|
||||||
vflag = "{}:\\{}".format(vflag[1], vflag[3:])
|
|
||||||
vol.histpath = vflag
|
|
||||||
elif self.args.hist:
|
elif self.args.hist:
|
||||||
for nch in range(len(hid)):
|
for nch in range(len(hid)):
|
||||||
hpath = os.path.join(self.args.hist, hid[: nch + 1])
|
hpath = os.path.join(self.args.hist, hid[: nch + 1])
|
||||||
|
|
|
@ -8,7 +8,7 @@ import shutil
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
|
|
||||||
from .__init__ import PY2, WINDOWS
|
from .__init__ import PY2, WINDOWS
|
||||||
from .util import fsenc, fsdec, REKOBO_LKEY
|
from .util import fsenc, fsdec, uncyg, REKOBO_LKEY
|
||||||
|
|
||||||
if not PY2:
|
if not PY2:
|
||||||
unicode = str
|
unicode = str
|
||||||
|
@ -44,6 +44,9 @@ class MParser(object):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
bp = os.path.expanduser(args)
|
bp = os.path.expanduser(args)
|
||||||
|
if WINDOWS:
|
||||||
|
bp = uncyg(bp)
|
||||||
|
|
||||||
if os.path.exists(bp):
|
if os.path.exists(bp):
|
||||||
self.bin = bp
|
self.bin = bp
|
||||||
return
|
return
|
||||||
|
|
|
@ -648,6 +648,16 @@ def s2hms(s, optional_h=False):
|
||||||
return "{}:{:02}:{:02}".format(h, m, s)
|
return "{}:{:02}:{:02}".format(h, m, s)
|
||||||
|
|
||||||
|
|
||||||
|
def uncyg(path):
|
||||||
|
if not path.startswith("/"):
|
||||||
|
return path
|
||||||
|
|
||||||
|
if len(path) < 3 and path[2] != "/":
|
||||||
|
return path
|
||||||
|
|
||||||
|
return "{}:\\{}".format(path[1], path[3:])
|
||||||
|
|
||||||
|
|
||||||
def undot(path):
|
def undot(path):
|
||||||
ret = []
|
ret = []
|
||||||
for node in path.split("/"):
|
for node in path.split("/"):
|
||||||
|
|
Loading…
Reference in a new issue