From 6389478750e0538f41084a3d311d58a9d85af8d2 Mon Sep 17 00:00:00 2001 From: randomuser Date: Tue, 20 Jul 2021 23:53:49 -0500 Subject: [PATCH] add read and write methods to db.DuckDB --- db.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db.py b/db.py index 4c844d0..7a1bb39 100644 --- a/db.py +++ b/db.py @@ -16,6 +16,16 @@ class DuckDB: for i in self.db: 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: def __init__(self, line=None): self.status = ""