diff --git a/cista/__main__.py b/cista/__main__.py index b4b7fc9..04d143d 100644 --- a/cista/__main__.py +++ b/cista/__main__.py @@ -98,7 +98,6 @@ def _main(): return 0 - def _confdir(args): if args["-c"]: # Custom config directory diff --git a/cista/api.py b/cista/api.py index cb1e41a..38b16d1 100644 --- a/cista/api.py +++ b/cista/api.py @@ -82,7 +82,6 @@ async def control(req, ws): await asend(ws, StatusMsg(status="ack", req=cmd)) - @bp.websocket("watch") @websocket_wrapper async def watch(req, ws): diff --git a/cista/app.py b/cista/app.py index 1d5906b..2b8d80d 100644 --- a/cista/app.py +++ b/cista/app.py @@ -39,14 +39,12 @@ async def main_start(app, loop): app.ctx.threadexec = ThreadPoolExecutor(max_workers=8) - @app.after_server_stop async def main_stop(app, loop): await watching.stop(app, loop) app.ctx.threadexec.shutdown() - @app.on_request async def use_session(req): req.ctx.session = session.get(req) diff --git a/cista/auth.py b/cista/auth.py index e4647c7..b3d27d4 100644 --- a/cista/auth.py +++ b/cista/auth.py @@ -74,7 +74,6 @@ def verify(request, *, privileged=False): raise Unauthorized("Login required", "cookie") - bp = Blueprint("auth") diff --git a/cista/config.py b/cista/config.py index 7883e00..56aa708 100644 --- a/cista/config.py +++ b/cista/config.py @@ -24,7 +24,6 @@ class User(msgspec.Struct, omit_defaults=True): lastSeen: int = 0 # noqa: N815 - class Link(msgspec.Struct, omit_defaults=True): location: str creator: str = "" diff --git a/cista/protocol.py b/cista/protocol.py index 2e97176..a949d67 100644 --- a/cista/protocol.py +++ b/cista/protocol.py @@ -25,7 +25,6 @@ class MkDir(ControlBase): path.mkdir(parents=True, exist_ok=False) - class Rename(ControlBase): path: str to: str @@ -51,7 +50,6 @@ class Rm(ControlBase): p.unlink() - class Mv(ControlBase): sel: list[str] dst: str diff --git a/cista/serve.py b/cista/serve.py index 8ac2166..f9b5fa2 100644 --- a/cista/serve.py +++ b/cista/serve.py @@ -36,7 +36,6 @@ def run(*, dev=False): Sanic.serve_single() - def check_cert(certdir, domain): if (certdir / "privkey.pem").exist() and (certdir / "fullchain.pem").exists(): return diff --git a/cista/watching.py b/cista/watching.py index fd4861f..978a056 100644 --- a/cista/watching.py +++ b/cista/watching.py @@ -221,7 +221,6 @@ async def broadcast(msg): logging.exception("Broadcast error") - async def start(app, loop): config.load_config() app.ctx.watcher = threading.Thread( diff --git a/pyproject.toml b/pyproject.toml index f8e721b..30fb25c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ dependencies = [ "stream-zip", "tomli_w", ] -requires-python = ">=3.10" [project.urls] Homepage = "" diff --git a/tests/test_control.py b/tests/test_control.py index 02552f8..ebd77a8 100644 --- a/tests/test_control.py +++ b/tests/test_control.py @@ -2,6 +2,7 @@ import tempfile from pathlib import Path import pytest + from cista import config from cista.protocol import Cp, MkDir, Mv, Rename, Rm