MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / AutoStyleApp

Class AutoStyleApp

tests/test_dynamic_complete_style.py:8–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class AutoStyleApp(cmd2.Cmd):
9 def __init__(self):
10 super().__init__()
11
12 def do_foo(self, args):
13 pass
14
15 def complete_foo(self, text, line, begidx, endidx) -> Completions:
16 # Return 10 items
17 items = [f"item{i}" for i in range(10) if f"item{i}".startswith(text)]
18 return Completions.from_values(items)
19
20 def do_bar(self, args):
21 pass
22
23 def complete_bar(self, text, line, begidx, endidx) -> Completions:
24 # Return 5 items
25 items = [f"item{i}" for i in range(5) if f"item{i}".startswith(text)]
26 return Completions.from_values(items)
27
28
29@pytest.fixture

Callers 1

appFunction · 0.85

Calls

no outgoing calls

Tested by 1

appFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…