On branch new_daily_plot
Changes to be committed: modified: scripts/daily_plot.py
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import mysql.connector as sql
|
import mysql.connector as sql
|
||||||
import os
|
import os
|
||||||
|
import configparser
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import seaborn as sns
|
import seaborn as sns
|
||||||
@@ -11,15 +12,17 @@ from matplotlib.colors import LogNorm
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
BIRD_DB_PWD=os.getenv('DB_PWD')
|
#Extract DB_PWD from thisrun.txt
|
||||||
|
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])
|
||||||
|
|
||||||
print(BIRD_DB_PWD)
|
|
||||||
|
|
||||||
db_connection = sql.connect(host='localhost',
|
db_connection = sql.connect(host='localhost',
|
||||||
database='birds',
|
database='birds',
|
||||||
user='birder',
|
user='birder',
|
||||||
password='forms')
|
password=db_pwd)
|
||||||
#password = BIRD_DB_PASSWORD)
|
|
||||||
|
|
||||||
db_cursor=db_connection.cursor(dictionary=True)
|
db_cursor=db_connection.cursor(dictionary=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user