mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
black + isort
This commit is contained in:
parent
f500e55e68
commit
8e5c436bef
|
@ -36,6 +36,7 @@ from .bos import bos
|
||||||
from .star import StreamTar
|
from .star import StreamTar
|
||||||
from .sutil import StreamArc, gfilter
|
from .sutil import StreamArc, gfilter
|
||||||
from .szip import StreamZip
|
from .szip import StreamZip
|
||||||
|
from .util import unquote # type: ignore
|
||||||
from .util import (
|
from .util import (
|
||||||
APPLESAN_RE,
|
APPLESAN_RE,
|
||||||
BITNESS,
|
BITNESS,
|
||||||
|
@ -84,7 +85,6 @@ from .util import (
|
||||||
sendfile_py,
|
sendfile_py,
|
||||||
undot,
|
undot,
|
||||||
unescape_cookie,
|
unescape_cookie,
|
||||||
unquote, # type: ignore
|
|
||||||
unquotep,
|
unquotep,
|
||||||
vjoin,
|
vjoin,
|
||||||
vol_san,
|
vol_san,
|
||||||
|
|
|
@ -28,7 +28,7 @@ if True: # pylint: disable=using-constant-test
|
||||||
import typing
|
import typing
|
||||||
from typing import Any, Optional, Union
|
from typing import Any, Optional, Union
|
||||||
|
|
||||||
from .__init__ import ANYWIN, E, EXE, MACOS, TYPE_CHECKING, EnvParams, unicode
|
from .__init__ import ANYWIN, EXE, MACOS, TYPE_CHECKING, E, EnvParams, unicode
|
||||||
from .authsrv import BAD_CFG, AuthSrv
|
from .authsrv import BAD_CFG, AuthSrv
|
||||||
from .cert import ensure_cert
|
from .cert import ensure_cert
|
||||||
from .mtag import HAVE_FFMPEG, HAVE_FFPROBE
|
from .mtag import HAVE_FFMPEG, HAVE_FFPROBE
|
||||||
|
|
|
@ -16,9 +16,9 @@ from .__init__ import ANYWIN, TYPE_CHECKING
|
||||||
from .authsrv import VFS
|
from .authsrv import VFS
|
||||||
from .bos import bos
|
from .bos import bos
|
||||||
from .mtag import HAVE_FFMPEG, HAVE_FFPROBE, ffprobe
|
from .mtag import HAVE_FFMPEG, HAVE_FFPROBE, ffprobe
|
||||||
|
from .util import BytesIO # type: ignore
|
||||||
from .util import (
|
from .util import (
|
||||||
FFMPEG_URL,
|
FFMPEG_URL,
|
||||||
BytesIO, # type: ignore
|
|
||||||
Cooldown,
|
Cooldown,
|
||||||
Daemon,
|
Daemon,
|
||||||
Pebkac,
|
Pebkac,
|
||||||
|
|
|
@ -49,11 +49,7 @@ class TestHttpCli(unittest.TestCase):
|
||||||
with open(filepath, "wb") as f:
|
with open(filepath, "wb") as f:
|
||||||
f.write(filepath.encode("utf-8"))
|
f.write(filepath.encode("utf-8"))
|
||||||
|
|
||||||
vcfg = [
|
vcfg = [".::r,u1:r.,u2", "a:a:r,u1:r,u2", ".b:.b:r.,u1:r,u2"]
|
||||||
".::r,u1:r.,u2",
|
|
||||||
"a:a:r,u1:r,u2",
|
|
||||||
".b:.b:r.,u1:r,u2"
|
|
||||||
]
|
|
||||||
self.args = Cfg(v=vcfg, a=["u1:u1", "u2:u2"], e2dsa=True)
|
self.args = Cfg(v=vcfg, a=["u1:u1", "u2:u2"], e2dsa=True)
|
||||||
self.asrv = AuthSrv(self.args, self.log)
|
self.asrv = AuthSrv(self.args, self.log)
|
||||||
|
|
||||||
|
@ -96,7 +92,7 @@ class TestHttpCli(unittest.TestCase):
|
||||||
tar = tarfile.open(fileobj=io.BytesIO(b), mode="r|").getnames()
|
tar = tarfile.open(fileobj=io.BytesIO(b), mode="r|").getnames()
|
||||||
top = ("top" if not url else url.lstrip(".").split("/")[0]) + "/"
|
top = ("top" if not url else url.lstrip(".").split("/")[0]) + "/"
|
||||||
assert len(tar) == len([x for x in tar if x.startswith(top)])
|
assert len(tar) == len([x for x in tar if x.startswith(top)])
|
||||||
return " ".join([x[len(top):] for x in tar])
|
return " ".join([x[len(top) :] for x in tar])
|
||||||
|
|
||||||
def curl(self, url, uname, binary=False):
|
def curl(self, url, uname, binary=False):
|
||||||
conn = tu.VHttpConn(self.args, self.asrv, self.log, hdr(url, uname))
|
conn = tu.VHttpConn(self.args, self.asrv, self.log, hdr(url, uname))
|
||||||
|
|
|
@ -44,7 +44,7 @@ class TestVFS(unittest.TestCase):
|
||||||
cfgdir = os.path.join(here, "res", "idp")
|
cfgdir = os.path.join(here, "res", "idp")
|
||||||
|
|
||||||
# globals are applied by main so need to cheat a little
|
# globals are applied by main so need to cheat a little
|
||||||
xcfg = { "idp_h_usr": "x-idp-user", "idp_h_grp": "x-idp-group" }
|
xcfg = {"idp_h_usr": "x-idp-user", "idp_h_grp": "x-idp-group"}
|
||||||
|
|
||||||
return here, cfgdir, xcfg
|
return here, cfgdir, xcfg
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue