From 02e712134a0145311d91a34a87b002322405e24c Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 16 Sep 2022 14:45:24 -0400 Subject: [PATCH] bin/djbdns-logparse.py: add a few more type hints where forgotten. --- bin/djbdns-logparse.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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. -- 2.43.2