aboutsummaryrefslogtreecommitdiff
path: root/mu4web/util.py
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-05-02 03:00:59 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-05-02 03:00:59 +0200
commitd17967eea2e42466103347257002451f17b5d5e8 (patch)
treed299b451ade590ab3cbf90c703c5914cad2fef4e /mu4web/util.py
parentHopefully fix installation issues. (diff)
downloadmu4web-d17967eea2e42466103347257002451f17b5d5e8.tar.gz
mu4web-d17967eea2e42466103347257002451f17b5d5e8.tar.xz
Configure linters.
Introduce flake8 and mypy for better error checking. Fix all errors and warnings emitted by those. Also fix type error with `url_for`.
Diffstat (limited to 'mu4web/util.py')
-rw-r--r--mu4web/util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mu4web/util.py b/mu4web/util.py
index c8ccc7d..41601c5 100644
--- a/mu4web/util.py
+++ b/mu4web/util.py
@@ -1,8 +1,13 @@
import subprocess
+from os import PathLike
+from typing import (
+ Union,
+)
-def find(basedir, **flags) -> list[bytes]:
- cmdline = ['find', basedir]
+def find(basedir: PathLike,
+ **flags: str | bytes) -> list[bytes]:
+ cmdline: list[Union[str, bytes, PathLike]] = ['find', basedir]
for key, value in flags.items():
cmdline += [f'-{key}', value]
cmdline.append('-print0')