Commented Old Code

This commit is contained in:
Alex Orid 2021-01-21 17:02:19 -05:00
parent 26c9fa6dbd
commit dee1bf4be0

36
db.py
View File

@ -36,24 +36,24 @@ class db_module():
pass pass
# This was a old function used prior to the creation of this class. I need to remake it. # This was a old function used prior to the creation of this class. I need to remake it.
def get_data_old(self, tableName: str = "", key: str = ""): # def get_data_old(self, tableName: str = "", key: str = ""):
table = '_channel_commands' # table = '_channel_commands'
table = tableName # table = tableName
#
df = pd.read_sql_query('SELECT * FROM ' + table, engine) # df = pd.read_sql_query('SELECT * FROM ' + table, engine)
stmt = "trigger == '" + key + "'" # stmt = "trigger == '" + key + "'"
temp = df.query(stmt) # temp = df.query(stmt)
result = temp.get("response") # result = temp.get("response")
#
# print(result) # # print(result)
i = len(temp.index.values) # i = len(temp.index.values)
#
if i == 1: # if i == 1:
output = result[temp.index.values[0]] # output = result[temp.index.values[0]]
pass # pass
else: # else:
output = "$$None$$" # output = "$$None$$"
return output # return output
def get_data(self, tableName: str = "", key: str = ""): def get_data(self, tableName: str = "", key: str = ""):
pass pass