summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-07 21:45:52 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-07 21:45:52 -0400
commitbb2dd69bd04f5dccff9474c018eb6b6eea74c6af (patch)
tree543f626a84ac96d97c478e4e1af185ce07831908 /examples
parentf8db8b766540920de6c85a26a6740170455b9354 (diff)
downloadcmd2-git-bb2dd69bd04f5dccff9474c018eb6b6eea74c6af.tar.gz
Moved all custom argparse classes intended for normal development to argparse_custom.py.
Lazy loading AutoCompleter in cmd2 instance methods to allow argparse_completer.py to import cmd2.Cmd class. This Architecture makes more sense because AutoCompleter depends on cmd2.Cmd.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/tab_autocompletion.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py
index 4b13b5c3..a6d5487d 100755
--- a/examples/tab_autocompletion.py
+++ b/examples/tab_autocompletion.py
@@ -8,8 +8,7 @@ import functools
from typing import List
import cmd2
-from cmd2 import argparse_completer, utils
-from cmd2.argparse_custom import Cmd2ArgParser
+from cmd2 import utils, Cmd2ArgParser, CompletionItem
actors = ['Mark Hamill', 'Harrison Ford', 'Carrie Fisher', 'Alec Guinness', 'Peter Mayhew',
'Anthony Daniels', 'Adam Driver', 'Daisy Ridley', 'John Boyega', 'Oscar Isaac',
@@ -116,7 +115,7 @@ class TabCompleteExample(cmd2.Cmd):
for movie_id in utils.natural_sort(self.MOVIE_DATABASE_IDS):
if movie_id in self.MOVIE_DATABASE:
movie_entry = self.MOVIE_DATABASE[movie_id]
- completions_with_desc.append(argparse_completer.CompletionItem(movie_id, movie_entry['title']))
+ completions_with_desc.append(CompletionItem(movie_id, movie_entry['title']))
# Mark that we already sorted the matches
self.matches_sorted = True