Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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()