add 'add' method to db.DuckDB
This commit is contained in:
parent
6bf490ead4
commit
be25f97cbf
13
db.py
13
db.py
|
@ -2,7 +2,18 @@ class DuckDB:
|
||||||
def __init__(self, location=None):
|
def __init__(self, location=None):
|
||||||
self.location = location
|
self.location = location
|
||||||
self.db = []
|
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):
|
def parse(self, fd):
|
||||||
lines = [i.rstrip() for i in fd.readlines()]
|
lines = [i.rstrip() for i in fd.readlines()]
|
||||||
|
|
Loading…
Reference in New Issue