summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheotheo <theotheo@users.noreply.github.com>2018-12-30 05:57:40 +0300
committerVal Neekman <un33kvu@gmail.com>2018-12-29 21:57:39 -0500
commit683364ea0f4637364b84486ef24124ece0e0597c (patch)
treed96204a80732ca57e9440fdb99ddeb9785dbf545
parentfb869bdad9023916eede6cf0215bb90893df0dcf (diff)
downloadpython-slugify-683364ea0f4637364b84486ef24124ece0e0597c.tar.gz
Rename word_boundaries: more consistent naming (#64)
-rw-r--r--slugify/slugify.py6
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: