From: xmo-odoo Date: Fri, 26 Jan 2018 10:14:57 +0000 (+0100) Subject: Add explicit signatures to some date autofunctions X-Git-Tag: v2.6.0~10^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57832c6e3d3b6513d66a3825de9bf537bb07be17;p=thirdparty%2Fbabel.git Add explicit signatures to some date autofunctions Because default_locale is eager, it generates misleading documentation when built (including on the site) as the doc will show the LC_TIME for the machine which built the doc. An explicit autofunction signature fixes that and provides a more correct view of the signature. An alternative fix would be for the LC_TIME value in the module to be a custom object with a repr of LC_TIME or something along those lines. Fixes #542 --- diff --git a/docs/api/dates.rst b/docs/api/dates.rst index 0fa9f1f3..f3e59b63 100644 --- a/docs/api/dates.rst +++ b/docs/api/dates.rst @@ -9,17 +9,17 @@ Python `datetime`, `date` and `time` objects and work with timezones. Date and Time Formatting ------------------------ -.. autofunction:: format_datetime +.. autofunction:: format_datetime(datetime=None, format='medium', tzinfo=None, locale=default_locale('LC_TIME')) -.. autofunction:: format_date +.. autofunction:: format_date(date=None, format='medium', locale=default_locale('LC_TIME')) -.. autofunction:: format_time +.. autofunction:: format_time(time=None, format='medium', tzinfo=None, locale=default_locale('LC_TIME')) -.. autofunction:: format_timedelta +.. autofunction:: format_timedelta(delta, granularity='second', threshold=.85, add_direction=False, format='long', locale=default_locale('LC_TIME')) -.. autofunction:: format_skeleton +.. autofunction:: format_skeleton(skeleton, datetime=None, tzinfo=None, fuzzy=True, locale=default_locale('LC_TIME')) -.. autofunction:: format_interval +.. autofunction:: format_interval(start, end, skeleton=None, tzinfo=None, fuzzy=True, locale=default_locale('LC_TIME')) Timezone Functionality ----------------------