From 7b2cf8eef27f0ed9fece8a2a1489f96e2a5cd83c Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:15:10 +0100 Subject: [PATCH] Tidy & fix deprecation warning --- cylc/flow/tui/util.py | 13 ------------- cylc/flow/wallclock.py | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/cylc/flow/tui/util.py b/cylc/flow/tui/util.py index 88e960e249a..33494f9fb06 100644 --- a/cylc/flow/tui/util.py +++ b/cylc/flow/tui/util.py @@ -384,19 +384,6 @@ def get_task_status_summary(flow): ] -def get_workflow_status_str(flow): - """Return a workflow status string for the header. - - Arguments: - flow (dict): - GraphQL JSON response for this workflow. - - Returns: - list - Text list for the urwid.Text widget. - - """ - - def _render_user(node, data): return f'~{ME}' diff --git a/cylc/flow/wallclock.py b/cylc/flow/wallclock.py index 46c5d2487ce..5c3479a07db 100644 --- a/cylc/flow/wallclock.py +++ b/cylc/flow/wallclock.py @@ -16,7 +16,7 @@ """Wall clock related utilities.""" from calendar import timegm -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from metomi.isodatetime.timezone import ( get_local_time_zone_format, get_local_time_zone, TimeZoneFormatMode) @@ -209,7 +209,7 @@ def get_time_string_from_unix_time(unix_time, display_sub_seconds=False, to use as the time zone designator. """ - date_time = datetime.utcfromtimestamp(unix_time) + date_time = datetime.fromtimestamp(unix_time, timezone.utc) return get_time_string(date_time, display_sub_seconds=display_sub_seconds, use_basic_format=use_basic_format,