From 96308edb406bfe57437a6b662d8a20cb7f1b9778 Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Sat, 17 Aug 2019 10:34:31 +0100 Subject: cleanup: remove unused parameter ... to Completer.relevant_part --- alot/completion/completer.py | 14 +++++++------- alot/completion/multipleselection.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'alot/completion') diff --git a/alot/completion/completer.py b/alot/completion/completer.py index de15d312..6894bb88 100644 --- a/alot/completion/completer.py +++ b/alot/completion/completer.py @@ -11,8 +11,8 @@ class Completer: @abc.abstractmethod def complete(self, original, pos): - """returns a list of completions and cursor positions for the - string original from position pos on. + """returns a list of completions and cursor positions for the string + `original` from position `pos` on. :param original: the string to complete :type original: str @@ -25,13 +25,13 @@ class Completer: """ pass - def relevant_part(self, original, pos, sep=' '): + def relevant_part(self, original, pos): """ - calculates the subword in a `sep`-splitted list of substrings of - `original` that `pos` is ia.n + Calculate the subword in a ' '-separated list of substrings of + `original` that `pos` is in. """ - start = original.rfind(sep, 0, pos) + 1 - end = original.find(sep, pos - 1) + start = original.rfind(' ', 0, pos) + 1 + end = original.find(' ', pos - 1) if end == -1: end = len(original) return original[start:end], start, end, pos - start diff --git a/alot/completion/multipleselection.py b/alot/completion/multipleselection.py index 8ceb9ed6..45de5a28 100644 --- a/alot/completion/multipleselection.py +++ b/alot/completion/multipleselection.py @@ -25,7 +25,7 @@ class MultipleSelectionCompleter(Completer): self._completer = completer self._separator = separator - def relevant_part(self, original, pos, sep=' '): + def relevant_part(self, original, pos): """Calculate the subword of `original` that `pos` is in.""" start = original.rfind(self._separator, 0, pos) if start == -1: -- cgit v1.2.3