From cc3fe5363a4f4eb7eccb6039a1f380c5431893fe Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 2 Oct 2016 17:39:37 +0100 Subject: [PATCH] dan dropped a `line = line.rstrip()`, not to worry, I picked it up for him. --- advanced/Scripts/gravity_parse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/gravity_parse.py b/advanced/Scripts/gravity_parse.py index 42446f4e..ff2cc44f 100644 --- a/advanced/Scripts/gravity_parse.py +++ b/advanced/Scripts/gravity_parse.py @@ -47,7 +47,7 @@ import sqlite3 logfile = '/etc/pihole/pihole.2.eventHorizon.txt' # Create the SQLite connection -conn = sqlite3.connect('/etc/pihole/pihole.db') +conn = sqlite3.connect('/etc/pihole/gravity.db') # Python auto-handle commits, no need to call for commits manually with conn: @@ -71,5 +71,6 @@ with conn: # Parse the log file into the database with open(logfile) as f: for line in f: + line = line.rstrip() sql = "INSERT INTO gravity (domain) VALUES (?)" c.execute(sql, (line,))