mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-20 14:20:13 +00:00
with
open logfile for Python autohandling of closure.
This commit is contained in:
parent
14424939a9
commit
64b91c8b97
1 changed files with 9 additions and 8 deletions
|
@ -154,15 +154,16 @@ with conn:
|
||||||
create_tables()
|
create_tables()
|
||||||
|
|
||||||
# Parse the log file.
|
# Parse the log file.
|
||||||
for line in open(logfile):
|
with open(logfile) as f:
|
||||||
line = line.rstrip()
|
for line in f:
|
||||||
|
line = line.rstrip()
|
||||||
|
|
||||||
if ': query[' in line:
|
if ': query[' in line:
|
||||||
parse_query(line)
|
parse_query(line)
|
||||||
|
|
||||||
elif ': forwarded ' in line:
|
elif ': forwarded ' in line:
|
||||||
parse_forward(line)
|
parse_forward(line)
|
||||||
|
|
||||||
elif (': reply ' in line) or (': cached ' in line):
|
elif (': reply ' in line) or (': cached ' in line):
|
||||||
parse_reply(line)
|
parse_reply(line)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue