Lots of fixes, added player loading/ unloading, login.py custom event system, mysql_utils.columns property

This commit is contained in:
PanFritz
2015-11-25 18:22:08 +01:00
parent 513996a351
commit 14b6c6905a
6 changed files with 153 additions and 322 deletions

View File

@@ -13,11 +13,23 @@ class mysql_connect:
if args is None:
return self.curs.execute(query)
else:
print query
print args
return self.curs.execute(query, args)
def fetchall(self):
return self.curs.fetchall()
@property
def columns(self):
self.execute("SHOW COLUMNS FROM utils_players")
fetched = self.fetchall()
columns = []
for row in fetched:
columns.append(row[0])
return columns
def __enter__(self):
return self