|
|
|
@ -36,16 +36,6 @@ SQL_PWD = CONFIG.get('sql', 'passwd')
@@ -36,16 +36,6 @@ SQL_PWD = CONFIG.get('sql', 'passwd')
|
|
|
|
|
class HandleSql: |
|
|
|
|
"""Class to handle sql connection.""" |
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
def sql_checkconn(): |
|
|
|
|
"""Check MySQL connection.""" |
|
|
|
|
try: |
|
|
|
|
global conn |
|
|
|
|
conn = pymysql.connect(host=SQL_HOST, db=SQL_DB, user=SQL_USER, passwd=SQL_PWD) |
|
|
|
|
cur = conn.cursor() |
|
|
|
|
except pymysql.DatabaseError as error: |
|
|
|
|
print(error) |
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
def sql_conn(): |
|
|
|
|
"""Init sql connection.""" |
|
|
|
|