diff options
| author | 2020-06-04 04:06:50 -0400 | |
|---|---|---|
| committer | 2020-06-04 04:06:50 -0400 | |
| commit | a465a1eb5d06b342d4fcc14746668bcbe57cd215 (patch) | |
| tree | 8e1d4a8e35342f87f251c487a0de00c05acb5986 | |
| parent | Improve LinePaginator to support long lines (diff) | |
Fix docstring for _split_remaing_words()
| -rw-r--r-- | bot/pagination.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bot/pagination.py b/bot/pagination.py index 5c7be564d..590d9da96 100644 --- a/bot/pagination.py +++ b/bot/pagination.py @@ -114,9 +114,13 @@ class LinePaginator(Paginator): self.add_line(remaining_words) def _split_remaining_words(self, line: str, max_chars: int) -> t.Tuple[str, t.Optional[str]]: - """Internal: split a line into two strings; one that fits within *max_chars* characters - (reduced_words) and another for the remaining (remaining_words), rounding down to the - nearest word. + """Internal: split a line into two strings -- reduced_words and remaining_words. + + reduced_words: the remaining words in `line`, after attempting to remove all words that + exceed `max_chars` (rounding down to the nearest word boundary). + + remaining_words: the words in `line` which exceed `max_chars`. This value is None if + no words could be split from `line`. Return a tuple in the format (reduced_words, remaining_words). """ |