Updated server.py removing direct reference to DB_PWD
This commit is contained in:
+8
-1
@@ -38,6 +38,13 @@ DISCONNECT_MESSAGE = "!DISCONNECT"
|
||||
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
server.bind(ADDR)
|
||||
|
||||
|
||||
# Open most recent Configuration and grab DB_PWD as a python variable
|
||||
with open('/home/pi/BirdNET-Pi/thisrun.txt', 'r') as f:
|
||||
this_run = f.readlines()
|
||||
db_pwd = str(str(str([i for i in this_run if i.startswith('DB_PWD')]).split('=')[1]).split('\\')[0])
|
||||
|
||||
|
||||
def loadModel():
|
||||
|
||||
global INPUT_LAYER_INDEX
|
||||
@@ -334,7 +341,7 @@ def handle_client(conn, addr):
|
||||
connection = mysql.connector.connect(host='localhost',
|
||||
database='birds',
|
||||
user='birder',
|
||||
password='databasepassword')
|
||||
password=db_pwd)
|
||||
cursor = connection.cursor()
|
||||
mySql_insert_query = """INSERT INTO detections (Date, Time, Sci_Name, Com_Name, Confidence, Lat, Lon, Cutoff, Week, Sens, Overlap)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """
|
||||
|
||||
Reference in New Issue
Block a user