From: Michael Orlitzky Date: Fri, 16 Sep 2022 00:22:46 +0000 (-0400) Subject: bin/djbdns-logparse.py: localize subprocess imports. X-Git-Tag: 0.0.1~35 X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;ds=sidebyside;h=f035bb9069431e0364a2dfd326e2787297a05cae;p=djbdns-logparse.git bin/djbdns-logparse.py: localize subprocess imports. --- diff --git a/bin/djbdns-logparse.py b/bin/djbdns-logparse.py index e6a6759..2a7f6ca 100755 --- a/bin/djbdns-logparse.py +++ b/bin/djbdns-logparse.py @@ -5,7 +5,6 @@ Convert tinydns and dnscache logs to human-readable form import re, typing from struct import pack -from subprocess import Popen, PIPE from time import strftime, gmtime @@ -393,9 +392,10 @@ def parse_logfile(file : typing.TextIO): >>> remove(f.name) """ - # Open pipe to tai64nlocal: we will write lines of our input (the - # raw log file) to it, and read log lines with readable timestamps - # from it. + # Open a pipe to tai64nlocal. We'll write lines of our input file + # (the log file) to it, and read back the same lines but with + # friendly timestamps in them. + from subprocess import Popen, PIPE tai = Popen(["tai64nlocal"], stdin=PIPE, stdout=PIPE, text=True, bufsize=0) for line in file: