From ab4393b50ecc3fc9a1c81804fc71144f2eee44bd Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 23 Jul 2020 11:49:02 -0400 Subject: [PATCH] Document unicode. --- src/allmydata/util/abbreviate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/allmydata/util/abbreviate.py b/src/allmydata/util/abbreviate.py index 95d547836..e7bdd8410 100644 --- a/src/allmydata/util/abbreviate.py +++ b/src/allmydata/util/abbreviate.py @@ -22,6 +22,10 @@ MONTH = 30*DAY YEAR = 365*DAY def abbreviate_time(s): + """ + Given time in seconds (float or int) or timedelta, summarize as English by + returning unicode string. + """ postfix = '' if isinstance(s, timedelta): # this feels counter-intuitive that positive numbers in a @@ -58,6 +62,9 @@ def abbreviate_time(s): return _plural(s / YEAR, "year") def abbreviate_space(s, SI=True): + """ + Given size in bytes summarize as English by returning unicode string. + """ if s is None: return "unknown" if SI: