def shell(self, items, pargs):
self.pargs = pargs
self.items = items
stdout.write(
'\n') # When the fetching messege ends need to add \n after \r.
self.prompt_show_items()
history = InMemoryHistory()
while True:
p = prompt(
u'we-get > ', history=history,
auto_suggest=AutoSuggestFromHistory(),
completer=WGCompleter(list(self.items.keys())),
style=we_get_prompt_style
)
if self.prompt_no_command(p):
continue
elif self.prompt_is_single_command(p):
command = p
args = None
else:
_ = p.split()
command = _[0]
_.pop(0)
args = ' '.join(_)
if not self.prompt_verify_command(command, args):
continue
elif not self.prompt_parse_command(command, args):
break
评论列表
文章目录