From efce6be44154920a79f580e5e0c2f4721d0d0944 Mon Sep 17 00:00:00 2001 From: SebastiaanZ <33516116+SebastiaanZ@users.noreply.github.com> Date: Wed, 16 Jan 2019 13:18:00 +0100 Subject: Changing incorrect type hinting for _parse_infraction_time and updating its docstring --- bot/cogs/bigbrother.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot/cogs/bigbrother.py b/bot/cogs/bigbrother.py index b68785161..f07289985 100644 --- a/bot/cogs/bigbrother.py +++ b/bot/cogs/bigbrother.py @@ -113,8 +113,12 @@ class BigBrother: return WatchInformation(reason="(no reason specified)", actor_id=None, inserted_at=None) @staticmethod - def _parse_infraction_time(infraction: str) -> struct_time: - """Takes RFC1123 date_time string and returns time object for sorting purposes""" + def _parse_infraction_time(infraction: dict) -> struct_time: + """ + Helper function that retrieves the insertion time from the infraction dictionary, + converts the retrieved RFC1123 date_time string to a time object, and returns it + so infractions can be sorted by their insertion time. + """ date_string = infraction["inserted_at"] return strptime(date_string, "%a, %d %b %Y %H:%M:%S %Z") -- cgit v1.2.3