From: Michael Orlitzky Date: Fri, 16 Sep 2022 18:45:24 +0000 (-0400) Subject: bin/djbdns-logparse.py: add a few more type hints where forgotten. X-Git-Tag: 0.0.1~31 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=02e712134a0145311d91a34a87b002322405e24c;p=djbdns-logparse.git bin/djbdns-logparse.py: add a few more type hints where forgotten. --- diff --git a/bin/djbdns-logparse.py b/bin/djbdns-logparse.py index f2a69b5..40a3012 100755 --- a/bin/djbdns-logparse.py +++ b/bin/djbdns-logparse.py @@ -166,7 +166,7 @@ def decode_client(words : list, i : int): id = int(chunks[2], 16) words[i] += f" (id {id})" -def decode_ip(words, i): +def decode_ip(words : list, i : int): r""" Helper function to decode the ip field in a dnscache log entry. @@ -206,18 +206,18 @@ def decode_ip(words, i): """ words[i] = convert_ip(words[i]) -def decode_ttl(words, i): +def decode_ttl(words : list, i : int): words[i] = f"TTL={words[i]}" -def decode_serial(words, i): +def decode_serial(words : list, i : int): serial = int(words[i]) words[i] = f"#{serial}" -def decode_type(words, i): +def decode_type(words : list, i : int): qt = words[i] words[i] = query_type.get(int(qt), qt) -def handle_dnscache_log(line) -> typing.Optional[str]: +def handle_dnscache_log(line : str) -> typing.Optional[str]: """ Handle a single log line if it matches the ``dnscache_log_re`` regex.