How to use the zdict.completer.DictCompleter function in zdict

To help you get started, we’ve selected a few zdict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zdict / zdict / zdict / zdict.py View on Github external
def interactive_mode():
    # configure readline and completer
    readline.parse_and_bind("tab: complete")
    readline.set_completer(DictCompleter().complete)

    zdict = MetaInteractivePrompt(args.dict)
    zdict.loop_prompt(args)
github zdict / zdict / zdict / zdict_completer.py View on Github external
def main():
    if len(sys.argv) > 1:
        text = sys.argv[1]
        completer = DictCompleter().complete
        output_set = set()
        try:
            for i in count():
                word = completer(text, i)
                if not isinstance(word, str):
                    break

                if word not in output_set:
                    print(word)
                    output_set.add(word)
        except IndexError:
            pass