]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Add explicit signatures to some date autofunctions 554/head
authorxmo-odoo <xmo@odoo.com>
Fri, 26 Jan 2018 10:14:57 +0000 (11:14 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Jan 2018 10:14:57 +0000 (11:14 +0100)
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

docs/api/dates.rst

index 0fa9f1f32ea652ca4fa7ee9e4b4c5d25c3a4d251..f3e59b63bf49af1c136ac83c45f31ec5d8a53487 100644 (file)
@@ -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
 ----------------------