Work on native gui design and install documentation
This commit is contained in:
+11
-2
@@ -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)
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@ def init_named_controls(window, builder):
|
||||
'tbl': 'table',
|
||||
'mnu': 'menu',
|
||||
'img': 'image',
|
||||
'drw': 'area'
|
||||
'drw': 'area',
|
||||
'stk': 'stack'
|
||||
}
|
||||
for ctrl in ctrltype.values():
|
||||
setattr(window, ctrl, {})
|
||||
|
||||
+2044
-46
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user