diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2018-05-20 23:15:18 +0200 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2018-05-20 23:15:18 +0200 |
commit | 89bb836ab0e48e1a47746d65a9bd0919550ea50e (patch) | |
tree | d9edaebeb6281da25e52cfac33588a94bd85e006 /examples/prompts/auto-completion | |
parent | afccb572f7cfd0ba300d1a08d95a1e0475dc1baa (diff) |
Fixed WordCompleter imports in examples.
Diffstat (limited to 'examples/prompts/auto-completion')
5 files changed, 14 insertions, 71 deletions
diff --git a/examples/prompts/auto-completion/autocomplete-with-control-space.py b/examples/prompts/auto-completion/autocomplete-with-control-space.py index 51105b09..df272a3f 100755 --- a/examples/prompts/auto-completion/autocomplete-with-control-space.py +++ b/examples/prompts/auto-completion/autocomplete-with-control-space.py @@ -5,7 +5,7 @@ Eample of using the control-space key binding for auto completion. from __future__ import unicode_literals from prompt_toolkit import prompt -from prompt_toolkit.contrib.completers import WordCompleter +from prompt_toolkit.completion import WordCompleter from prompt_toolkit.key_binding import KeyBindings diff --git a/examples/prompts/auto-completion/autocompletion-like-readline.py b/examples/prompts/auto-completion/autocompletion-like-readline.py index de10584d..48654445 100755 --- a/examples/prompts/auto-completion/autocompletion-like-readline.py +++ b/examples/prompts/auto-completion/autocompletion-like-readline.py @@ -6,7 +6,7 @@ binding a custom handler to the Tab key. from __future__ import unicode_literals from prompt_toolkit.shortcuts import prompt, CompleteStyle -from prompt_toolkit.contrib.completers import WordCompleter +from prompt_toolkit.completion import WordCompleter animal_completer = WordCompleter([ diff --git a/examples/prompts/auto-completion/autocompletion.py b/examples/prompts/auto-completion/autocompletion.py index 6e0fd415..a2c61f6b 100755 --- a/examples/prompts/auto-completion/autocompletion.py +++ b/examples/prompts/auto-completion/autocompletion.py @@ -9,42 +9,15 @@ Press [Tab] to complete the current word. """ from __future__ import unicode_literals -from prompt_toolkit.contrib.completers import WordCompleter +from prompt_toolkit.completion import WordCompleter from prompt_toolkit import prompt animal_completer = WordCompleter([ - 'alligator', - 'ant', - 'ape', - 'bat', - 'bear', - 'beaver', - 'bee', - 'bison', - 'butterfly', - 'cat', - 'chicken', - 'crocodile', - 'dinosaur', - 'dog', - 'dolphin', - 'dove', - 'duck', - 'eagle', - 'elephant', - 'fish', - 'goat', - 'gorilla', - 'kangaroo', - 'leopard', - 'lion', - 'mouse', - 'rabbit', - 'rat', - 'snake', - 'spider', - 'turkey', + 'alligator', 'ant', 'ape', 'bat', 'bear', 'beaver', 'bee', 'bison', + 'butterfly', 'cat', 'chicken', 'crocodile', 'dinosaur', 'dog', 'dolphin', + 'dove', 'duck', 'eagle', 'elephant', 'fish', 'goat', 'gorilla', 'kangaroo', + 'leopard', 'lion', 'mouse', 'rabbit', 'rat', 'snake', 'spider', 'turkey', 'turtle', ], ignore_case=True) diff --git a/examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py b/examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py index e1a01539..9985679c 100755 --- a/examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py +++ b/examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py @@ -4,15 +4,12 @@ Autocompletion example that shows meta-information alongside the completions. """ from __future__ import unicode_literals -from prompt_toolkit.contrib.completers import WordCompleter +from prompt_toolkit.completion import WordCompleter from prompt_toolkit.shortcuts import prompt, CompleteStyle animal_completer = WordCompleter([ - 'alligator', - 'ant', - 'ape', - 'bat', + 'alligator', 'ant', 'ape', 'bat', 'bear', 'beaver', 'bee', 'bison', 'butterfly', 'cat', 'chicken', 'crocodile', 'dinosaur', 'dog', 'dolphin', 'dove', 'duck', 'eagle', diff --git a/examples/prompts/auto-completion/multi-column-autocompletion.py b/examples/prompts/auto-completion/multi-column-autocompletion.py index cb4fffa9..1fcd917e 100755 --- a/examples/prompts/auto-completion/multi-column-autocompletion.py +++ b/examples/prompts/auto-completion/multi-column-autocompletion.py @@ -4,42 +4,15 @@ Similar to the autocompletion example. But display all the completions in multip """ from __future__ import unicode_literals -from prompt_toolkit.contrib.completers import WordCompleter +from prompt_toolkit.completion import WordCompleter from prompt_toolkit.shortcuts import prompt, CompleteStyle animal_completer = WordCompleter([ - 'alligator', - 'ant', - 'ape', - 'bat', - 'bear', - 'beaver', - 'bee', - 'bison', - 'butterfly', - 'cat', - 'chicken', - 'crocodile', - 'dinosaur', - 'dog', - 'dolphin', - 'dove', - 'duck', - 'eagle', - 'elephant', - 'fish', - 'goat', - 'gorilla', - 'kangaroo', - 'leopard', - 'lion', - 'mouse', - 'rabbit', - 'rat', - 'snake', - 'spider', - 'turkey', + 'alligator', 'ant', 'ape', 'bat', 'bear', 'beaver', 'bee', 'bison', + 'butterfly', 'cat', 'chicken', 'crocodile', 'dinosaur', 'dog', 'dolphin', + 'dove', 'duck', 'eagle', 'elephant', 'fish', 'goat', 'gorilla', 'kangaroo', + 'leopard', 'lion', 'mouse', 'rabbit', 'rat', 'snake', 'spider', 'turkey', 'turtle', ], ignore_case=True) |