mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
try new method to update_trips v2
This commit is contained in:
+7
-5
@@ -3,10 +3,6 @@ dash>=1.18.0
|
||||
plotly>=4
|
||||
pandas
|
||||
oauth2_client
|
||||
python-dateutil
|
||||
certifi
|
||||
urllib3
|
||||
six
|
||||
requests
|
||||
numpy
|
||||
pytz
|
||||
@@ -14,4 +10,10 @@ typing
|
||||
argparse
|
||||
flask
|
||||
dash_bootstrap_components
|
||||
geojson
|
||||
geojson
|
||||
|
||||
#swagger req
|
||||
certifi >= 14.05.14
|
||||
six >= 1.10
|
||||
python_dateutil >= 2.5.3
|
||||
urllib3 >= 1.15.1
|
||||
+1
-1
@@ -115,6 +115,7 @@ def update_trips():
|
||||
|
||||
|
||||
try:
|
||||
web.db.callback_fct = update_trips
|
||||
update_trips()
|
||||
min_date = trips[0].start_at
|
||||
max_date = trips[-1].start_at
|
||||
@@ -158,4 +159,3 @@ dash_app.layout = dbc.Container(fluid=True, children=[
|
||||
data_div
|
||||
])
|
||||
|
||||
web.db.update_callback = update_trips
|
||||
@@ -2,12 +2,15 @@ import sqlite3
|
||||
from datetime import datetime
|
||||
import pytz
|
||||
|
||||
callback_fct = None
|
||||
|
||||
def convert_datetime(st):
|
||||
return datetime.strptime(st.decode("utf-8"), "%Y-%m-%d %H:%M:%S+00:00").replace(tzinfo=pytz.UTC)
|
||||
|
||||
|
||||
def update_callback():
|
||||
if callback_fct is not None:
|
||||
callback_fct()
|
||||
return
|
||||
|
||||
def get_db():
|
||||
|
||||
Reference in New Issue
Block a user