How to use the zdict.utils.Color 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 set_args():
    if args.list_dicts:
        for provider in sorted(dictionary_map, key=lambda x: x if x != 'yahoo' else ''):
            print('{}: {}'.format(provider, dictionary_map[provider]().title))
        exit()

    utils.Color.colorize = args.force_color

    args.dict = args.dict.split(',')

    if 'all' in args.dict:
        args.dict = tuple(dictionary_map.keys())
    else:
        # Uniq and Filter the dict not in supported dictionary list then sort.
        args.dict = sorted(set(d for d in args.dict if d in dictionary_map))

    if len(args.dict) > 1:
        args.show_provider = True
github zdict / zdict / zdict / dictionary.py View on Github external
def __init__(self, args):
        self.args = args
        self.color = Color()
        self.db = db

        try:
            self.db.connection()
        except Exception:
            self.db = None
            raise
        else:
            for req in self.REQUIRED_TABLE:
                if not req.table_exists():
                    req.create_table()