tools: renamed module sat.tools.datetime to date.tools.xmpp_datetime to avoid conflict with Python's standard lib

This commit is contained in:
Goffi 2022-08-31 13:18:56 +02:00
commit 672174fb23

View file

@ -23,7 +23,7 @@
from sat.core.constants import Const as C
from sat.core.i18n import D_
from sat.core.sat_main import SAT
from sat.tools import datetime
from sat.tools import xmpp_datetime
__all__ = [ # pylint: disable=unused-variable
@ -49,7 +49,7 @@ class XEP_0082: # pylint: disable=invalid-name
"""
Implementation of the date and time profiles specified in XEP-0082 using Python's
datetime module. The legacy format described in XEP-0082 section "4. Migration" is not
supported. Reexports of the functions in :mod:`sat.tools.datetime`.
supported. Reexports of the functions in :mod:`sat.tools.xmpp_datetime`.
This is a passive plugin, i.e. it doesn't hook into any triggers to process stanzas
actively, but offers API for other plugins to use.
@ -60,9 +60,9 @@ class XEP_0082: # pylint: disable=invalid-name
@param sat: The SAT instance.
"""
format_date = staticmethod(datetime.format_date)
parse_date = staticmethod(datetime.parse_date)
format_datetime = staticmethod(datetime.format_datetime)
parse_datetime = staticmethod(datetime.parse_datetime)
format_time = staticmethod(datetime.format_time)
parse_time = staticmethod(datetime.parse_time)
format_date = staticmethod(xmpp_datetime.format_date)
parse_date = staticmethod(xmpp_datetime.parse_date)
format_datetime = staticmethod(xmpp_datetime.format_datetime)
parse_datetime = staticmethod(xmpp_datetime.parse_datetime)
format_time = staticmethod(xmpp_datetime.format_time)
parse_time = staticmethod(xmpp_datetime.parse_time)