diff options
Diffstat (limited to 'gr-utils/python/modtool/util_functions.py')
-rw-r--r-- | gr-utils/python/modtool/util_functions.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gr-utils/python/modtool/util_functions.py b/gr-utils/python/modtool/util_functions.py index b20970175c..9a949c8031 100644 --- a/gr-utils/python/modtool/util_functions.py +++ b/gr-utils/python/modtool/util_functions.py @@ -150,10 +150,13 @@ class SequenceCompleter(object): """ A simple completer function wrapper to be used with readline, e.g. option_iterable = ("search", "seek", "destroy") readline.set_completer(SequenceCompleter(option_iterable).completefunc) + + Typical usage is with the `with` statement. Restores the previous completer + at exit, thus nestable. """ - def __init__(self, sequence): - self._seq = sequence + def __init__(self, sequence=None): + self._seq = sequence or [] self._tmp_matches = [] def completefunc(self, text, state): |