aboutsummaryrefslogtreecommitdiffstats
path: root/src/extras/sos-html-logs/lib/database.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/extras/sos-html-logs/lib/database.py')
-rw-r--r--src/extras/sos-html-logs/lib/database.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/extras/sos-html-logs/lib/database.py b/src/extras/sos-html-logs/lib/database.py
deleted file mode 100644
index d1082f52..00000000
--- a/src/extras/sos-html-logs/lib/database.py
+++ /dev/null
@@ -1,26 +0,0 @@
-try: from pysqlite2 import dbapi2 as sqlite
-except: print "python-sqlite is missing. Exiting."; sys.exit(1)
-
-from threading import Lock
-
-class myDB_class:
- def __init__(self):
- self.dbcon = sqlite.connect(":memory:", check_same_thread=False)
- self.dbcon.row_factory = sqlite.Row
-# self.dbcur = dbcon.cursor()
- self.dblock = Lock()
-
- self.execute("create table events(eid INTEGER PRIMARY KEY AUTOINCREMENT, date KEY, host, position, parser, message, css_style, tooltip BLOB)")
-
- def execute(self, query):
- self.dblock.acquire()
- toret = self.dbcon.execute(query)
- self.dblock.release()
- return toret
-
- def execute_and_fetch(self, query):
- self.dblock.acquire()
- dbcur = self.dbcon.execute(query)
- toret = dbcur.fetchall()
- self.dblock.release()
- return toret