From 87398980c438de55ff17098790a59e123624493b Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 27 Mar 2024 04:54:34 +0100 Subject: [PATCH] Minor code documentation changes. --- plomtask/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plomtask/http.py b/plomtask/http.py index 86db94d..3dde6e2 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -24,7 +24,7 @@ class TaskServer(HTTPServer): self.jinja = JinjaEnv(loader=JinjaFSLoader(TEMPLATES_DIR)) -class ParamsParser: # pylint: disable=too-few-public-methods +class ParamsParser: """Wrapper for validating and retrieving GET params.""" def __init__(self, params: dict[str, list[str]]) -> None: @@ -37,7 +37,7 @@ class ParamsParser: # pylint: disable=too-few-public-methods return self.params[key][0] def get_int_or_none(self, key: str) -> int | None: - """Retrieve int value of key yfrom self.params, on fail return None.""" + """Retrieve int value of key from self.params, on empty return None.""" if key not in self.params or not self.params[key]: return None val = self.params[key][0] @@ -144,7 +144,7 @@ class TaskHandler(BaseHTTPRequestHandler): def do_POST_process(self, conn: DatabaseConnection, params: ParamsParser, form_data: PostvarsParser) -> None: - """Update or insert Process of id_ and fields defined in postvars.""" + """Update or insert Process of ?id= and fields defined in postvars.""" id_ = params.get_int_or_none('id') process = Process.by_id(conn, id_, create=True) process.title.set(form_data.get_str('title')) -- 2.30.2