diff options
author | theotheo <theotheo@users.noreply.github.com> | 2018-12-30 05:57:40 +0300 |
---|---|---|
committer | Val Neekman <un33kvu@gmail.com> | 2018-12-29 21:57:39 -0500 |
commit | 683364ea0f4637364b84486ef24124ece0e0597c (patch) | |
tree | d96204a80732ca57e9440fdb99ddeb9785dbf545 | |
parent | fb869bdad9023916eede6cf0215bb90893df0dcf (diff) | |
download | python-slugify-683364ea0f4637364b84486ef24124ece0e0597c.tar.gz |
Rename word_boundaries: more consistent naming (#64)
-rw-r--r-- | slugify/slugify.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/slugify/slugify.py b/slugify/slugify.py index 8569233..ccd33a8 100644 --- a/slugify/slugify.py +++ b/slugify/slugify.py @@ -32,12 +32,12 @@ NUMBERS_PATTERN = re.compile(r'(?<=\d),(?=\d)') DEFAULT_SEPARATOR = '-' -def smart_truncate(string, max_length=0, word_boundaries=False, separator=' ', save_order=False): +def smart_truncate(string, max_length=0, word_boundary=False, separator=' ', save_order=False): """ Truncate a string. :param string (str): string for modification :param max_length (int): output string length - :param word_boundaries (bool): + :param word_boundary (bool): :param save_order (bool): if True then word order of output string is like input string :param separator (str): separator between words :return: @@ -51,7 +51,7 @@ def smart_truncate(string, max_length=0, word_boundaries=False, separator=' ', s if len(string) < max_length: return string - if not word_boundaries: + if not word_boundary: return string[:max_length].strip(separator) if separator not in string: |