Fix timezone native/non-native comparison and missing argument

This commit is contained in:
Frisk 2024-09-27 15:33:35 +02:00
parent 0d10f928b4
commit 0fdcc14b76

View file

@ -64,7 +64,7 @@ class Client:
if isinstance(given_time, float) or isinstance(given_time, int):
return float(given_time)
now = datetime.now(timezone.utc)
then = datetime(now.year, now.month, now.day, *(map(int, given_time.split(':'))), 0, 0)
then = datetime(now.year, now.month, now.day, *(map(int, given_time.split(':'))), 0, 0, tzinfo=timezone.utc)
return float((then - now).seconds)
def wrap_reschedule(function, period: float, *args, **kwargs):
"""Function for rescheduling a function every period of times. It provides args and kwargs to the function"""
@ -91,7 +91,7 @@ class Client:
return dict()
def parse_links(self, summary: str):
link_parser = self.LinkParser()
link_parser = self.LinkParser(self.WIKI_JUST_DOMAIN)
link_parser.feed(summary)
return link_parser.new_string