mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix timezone native/non-native comparison and missing argument
This commit is contained in:
parent
0d10f928b4
commit
0fdcc14b76
|
@ -64,7 +64,7 @@ class Client:
|
||||||
if isinstance(given_time, float) or isinstance(given_time, int):
|
if isinstance(given_time, float) or isinstance(given_time, int):
|
||||||
return float(given_time)
|
return float(given_time)
|
||||||
now = datetime.now(timezone.utc)
|
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)
|
return float((then - now).seconds)
|
||||||
def wrap_reschedule(function, period: float, *args, **kwargs):
|
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"""
|
"""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()
|
return dict()
|
||||||
|
|
||||||
def parse_links(self, summary: str):
|
def parse_links(self, summary: str):
|
||||||
link_parser = self.LinkParser()
|
link_parser = self.LinkParser(self.WIKI_JUST_DOMAIN)
|
||||||
link_parser.feed(summary)
|
link_parser.feed(summary)
|
||||||
return link_parser.new_string
|
return link_parser.new_string
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue