code cleanup with prospector

This commit is contained in:
Florian Bezannier
2021-03-08 18:57:13 +01:00
parent 920a67fea5
commit 3201d26317
16 changed files with 206 additions and 205 deletions
+3 -1
View File
@@ -4,6 +4,8 @@ import pytz
callback_fct = None
default_db_file = 'info.db'
def convert_datetime(st):
return datetime.strptime(st.decode("utf-8"), "%Y-%m-%d %H:%M:%S+00:00").replace(tzinfo=pytz.UTC)
@@ -11,7 +13,7 @@ def convert_datetime(st):
def update_callback():
if callback_fct is not None:
callback_fct()
return
def get_db(db_file=default_db_file):
sqlite3.register_converter("DATETIME", convert_datetime)