Work on native gui design and install documentation

This commit is contained in:
2026-07-16 13:54:03 +02:00
parent a183a4725f
commit 3a8233e930
5 changed files with 2106 additions and 58 deletions
+11 -2
View File
@@ -8,6 +8,7 @@ class Database():
self.conn = None
self.cur = None
self.dcur = None
self.error = None
def connect(self, dbuser, dbpass):
if self.conn:
@@ -17,7 +18,7 @@ class Database():
self.conn = MySQLdb.connect(host=self.hostname, db=self.schema,
user=dbuser, passwd=dbpass, charset='utf8')
except MySQLdb.Error as e:
print(e)
self.error = e
return False
self.cur = self.conn.cursor()
self.dcur = self.conn.cursor(MySQLdb.cursors.DictCursor)
@@ -32,7 +33,7 @@ class Database():
self.conn = MySQLdb.connect(host='localhost', db=self.schema,
unix_socket='/run/mysqld/mysqld.sock', charset='utf8')
except MySQLdb.Error as e:
print(e)
self.error = e
return False
self.cur = self.conn.cursor()
self.dcur = self.conn.cursor(MySQLdb.cursors.DictCursor)
@@ -45,3 +46,11 @@ class Database():
def is_connected(self):
return self.conn.open
def last_error(self):
if not self.error:
return(0, '')
code = self.error.args[0]
text = self.error.args[1]
self.error = None
return(code, text)