Mercurial > libervia-backend
diff sat/plugins/plugin_xep_0082.py @ 3879:46930301f0c1
tools: renamed module `sat.tools.datetime` to `date.tools.xmpp_datetime` to avoid conflict with Python's standard lib
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 31 Aug 2022 13:18:56 +0200 |
parents | 00212260f659 |
children | 8289ac1b34f4 |
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0082.py Wed Aug 31 13:11:26 2022 +0200 +++ b/sat/plugins/plugin_xep_0082.py Wed Aug 31 13:18:56 2022 +0200 @@ -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 @@ """ 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 @@ @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)