add read and write methods to db.DuckDB

This commit is contained in:
randomuser 2021-07-20 23:53:49 -05:00
parent 7a8f286e78
commit 6389478750
1 changed files with 10 additions and 0 deletions

10
db.py
View File

@ -16,6 +16,16 @@ class DuckDB:
for i in self.db: for i in self.db:
fd.write(i.stringify() + "\n") fd.write(i.stringify() + "\n")
def read(self, location):
fd = open(location, "r")
self.parse(fd)
fd.close()
def write(self, location):
fd = open(location, "w")
self.output(fd)
fd.close
class DuckEvent: class DuckEvent:
def __init__(self, line=None): def __init__(self, line=None):
self.status = "" self.status = ""