aboutsummaryrefslogtreecommitdiff
path: root/mu4web/xapian.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/xapian.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/xapian.py')
-rw-r--r--mu4web/xapian.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mu4web/xapian.py b/mu4web/xapian.py
index 8aebf72..d23b2d1 100644
--- a/mu4web/xapian.py
+++ b/mu4web/xapian.py
@@ -1,7 +1,8 @@
import subprocess
from typing import Optional
-def metadata_list(db, prefix: Optional[str] = None) -> list[str]:
+
+def metadata_list(db: str, prefix: Optional[str] = None) -> list[str]:
cmdline = ['xapian-metadata', 'list', db]
if prefix:
cmdline.append(prefix)
@@ -9,8 +10,7 @@ def metadata_list(db, prefix: Optional[str] = None) -> list[str]:
return cmd.stdout.split('\n')
-def metadata_get(db, key: str) -> str:
+def metadata_get(db: str, key: str) -> str:
cmd = subprocess.run(['xapian-metadata', 'get', db, key],
capture_output=True, text=True)
return cmd.stdout.strip()
-