def completer(): list = [] for name in history(): list.append(name) return WordCompleter(set(list), ignore_case=True)
def print_history(self): print('\nLast ten entries from history:') entries = history() qty = len(entries) for entry in entries[qty-10:qty]: print(entry)
def completer(): s = set() history_strings = history().load_history_strings() for name in history_strings: s.add(name) return WordCompleter(list(s), ignore_case=True)
def custom_prompt(): return prompt(get_prompt_tokens=get_prompt_tokens, history=history(), auto_suggest=AutoSuggestFromHistory(), enable_history_search=True, on_abort=AbortAction.RETRY, get_bottom_toolbar_tokens=get_bottom_toolbar_tokens, completer=completer(), complete_while_typing=True, style=style)
def custom_prompt(currentSong): return prompt( get_prompt_tokens=get_prompt_tokens, history=history(), auto_suggest=AutoSuggestFromHistory(), enable_history_search=True, on_abort=AbortAction.RETRY, get_bottom_toolbar_tokens=get_bottom_toolbar_tokens(currentSong), completer=completer(), complete_while_typing=True, style=style )
def custom_prompt(currentSong): session = PromptSession(message=get_prompt, history=history(), auto_suggest=AutoSuggestFromHistory(), enable_history_search=True, bottom_toolbar=get_bottom_toolbar(currentSong), completer=completer(), complete_while_typing=True, complete_in_thread=True, style=style) return session.prompt()