diff --git a/scripts/dashboard/dashboard.py b/scripts/dashboard/dashboard.py index 67acad2..c322b67 100644 --- a/scripts/dashboard/dashboard.py +++ b/scripts/dashboard/dashboard.py @@ -133,40 +133,40 @@ def check_emergency(): # open emergency txt try: sos_file = ast.literal_eval(os.popen('cat /tmp/gps_data_user_sos.txt').read()) + if type(sos_file['time']) == str: + loc_time = str(sos_file['time']) + if type(sos_file['time']) == int or type(sos_file['time']) == float: + loc_time = datetime.fromtimestamp(sos_file['time']).strftime(time_format) if '@NOTICE' in sos_file['message'] and '@SOS' not in sos_file['message']: notice_header = 'NOTICE:' else: - if type(sos_file['time']) == str: - loc_time = str(sos_file['time']) - if type(sos_file['time']) == int or type(sos_file['time']) == float: - loc_time = datetime.fromtimestamp(sos_file['time']).strftime(time_format) notice_header = 'EMERGENCY ACTIVATION' value = Markup(""" -
From: | -""" + sos_file['call'] + """ - """ + str(sos_file['dmr_id']) + """ | -
Message: | -""" + sos_file['message'] + """ | -
Time: | -""" + loc_time + """ | -
- - -
From: | +""" + sos_file['call'] + """ - """ + str(sos_file['dmr_id']) + """ | +
Message: | +""" + sos_file['message'] + """ | +
Time: | +""" + loc_time + """ | +
+ + +