From be25f97cbfaa2dcca354add3c9ef0f61d389fe12 Mon Sep 17 00:00:00 2001 From: randomuser Date: Tue, 20 Jul 2021 23:58:37 -0500 Subject: [PATCH] add 'add' method to db.DuckDB --- db.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/db.py b/db.py index 083d8f1..1bbbc45 100644 --- a/db.py +++ b/db.py @@ -2,7 +2,18 @@ class DuckDB: def __init__(self, location=None): self.location = location self.db = [] - if location != None: read(location) + if location != None: self.read(location) + + def add(self, state, nick, abstime, reltime, channel): + self.db.append(DuckEvent( + "{}{} {} {} {}".format( + state, + nick, + str(abstime), + str(reltime), + channel, + ) + ) def parse(self, fd): lines = [i.rstrip() for i in fd.readlines()]