From 8e5c436bef2083334e32f1b07f759c789c536c8d Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 21 Mar 2024 18:51:23 +0000 Subject: [PATCH] black + isort --- copyparty/httpcli.py | 2 +- copyparty/svchub.py | 2 +- copyparty/th_srv.py | 2 +- tests/test_dots.py | 8 ++------ tests/test_idp.py | 2 +- tests/util.py | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 5d2b101d..3bd98e8c 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -36,6 +36,7 @@ from .star import StreamTar from .sutil import StreamArc, gfilter from .szip import StreamZip +from .util import unquote # type: ignore from .util import ( APPLESAN_RE, BITNESS, @@ -84,7 +85,6 @@ sendfile_py, undot, unescape_cookie, - unquote, # type: ignore unquotep, vjoin, vol_san, diff --git a/copyparty/svchub.py b/copyparty/svchub.py index e8c14a72..2b7be552 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -28,7 +28,7 @@ import typing 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 .cert import ensure_cert from .mtag import HAVE_FFMPEG, HAVE_FFPROBE diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index 3a45aaf3..d40a92d7 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -16,9 +16,9 @@ from .authsrv import VFS from .bos import bos from .mtag import HAVE_FFMPEG, HAVE_FFPROBE, ffprobe +from .util import BytesIO # type: ignore from .util import ( FFMPEG_URL, - BytesIO, # type: ignore Cooldown, Daemon, Pebkac, diff --git a/tests/test_dots.py b/tests/test_dots.py index 3e8e60a0..df1d4ab3 100644 --- a/tests/test_dots.py +++ b/tests/test_dots.py @@ -49,11 +49,7 @@ def test(self): with open(filepath, "wb") as f: f.write(filepath.encode("utf-8")) - vcfg = [ - ".::r,u1:r.,u2", - "a:a:r,u1:r,u2", - ".b:.b:r.,u1:r,u2" - ] + vcfg = [".::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.asrv = AuthSrv(self.args, self.log) @@ -96,7 +92,7 @@ def tardir(self, url, uname): tar = tarfile.open(fileobj=io.BytesIO(b), mode="r|").getnames() top = ("top" if not url else url.lstrip(".").split("/")[0]) + "/" 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): conn = tu.VHttpConn(self.args, self.asrv, self.log, hdr(url, uname)) diff --git a/tests/test_idp.py b/tests/test_idp.py index 79f2669d..0354f89d 100644 --- a/tests/test_idp.py +++ b/tests/test_idp.py @@ -44,7 +44,7 @@ def prep(self): cfgdir = os.path.join(here, "res", "idp") # 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 diff --git a/tests/util.py b/tests/util.py index e989e4f2..505452d4 100644 --- a/tests/util.py +++ b/tests/util.py @@ -254,4 +254,4 @@ def __init__(self, args, asrv, log, buf): self.thumbcli = None self.u2fh = FHC() - self.get_u2idx = self.hsrv.get_u2idx \ No newline at end of file + self.get_u2idx = self.hsrv.get_u2idx