diff --git a/docs/formatting.md b/docs/formatting.md index d6ca913e..d0e6c6a9 100644 --- a/docs/formatting.md +++ b/docs/formatting.md @@ -117,9 +117,9 @@ Conversion specifiers allow to *convert* the value to a different form or type. ["sun", "tree", "water"] - L + n Return the length of a value - {foo!L} + {foo!n} 7 diff --git a/gallery_dl/formatter.py b/gallery_dl/formatter.py index 037e436c..a84e7d34 100644 --- a/gallery_dl/formatter.py +++ b/gallery_dl/formatter.py @@ -484,7 +484,7 @@ _CONVERSIONS = { "C": string.capwords, "j": util.json_dumps, "t": str.strip, - "L": len, + "n": len, "T": util.datetime_to_timestamp_string, "d": text.parse_timestamp, "D": util.to_datetime, diff --git a/test/test_formatter.py b/test/test_formatter.py index f6b5888f..67632141 100644 --- a/test/test_formatter.py +++ b/test/test_formatter.py @@ -73,9 +73,9 @@ class TestFormatter(unittest.TestCase): self._run_test("{l!j}", '["a","b","c"]') self._run_test("{dt!j}", '"2010-01-01 00:00:00"') self._run_test("{a!g}", "hello-world") - self._run_test("{a!L}", 11) - self._run_test("{l!L}", 3) - self._run_test("{d!L}", 3) + self._run_test("{a!n}", 11) + self._run_test("{l!n}", 3) + self._run_test("{d!n}", 3) self._run_test("{i_str!i}", 12345) self._run_test("{i_str!f}", 12345.0) self._run_test("{f_str!f}", 12.45)