def add(name): """ Usage: parguments add <name> """ print(prompt_bool(name='correct', default=True, yes_choices=['y'], no_choices=['n']) and 'yes' or 'no')
def parse(path): """ Parser json configuration file """ try: f = open(path, 'r') except IOError: print("Can't find config file %s" % path) if prompt_bool("Create a new config file", default=True): create_config_file() else: logger.error("Can't find config file. Exiting..") sys.exit(0) return update_nested_dict(ObjectDict(), ujson.load(f))
def parse(path): """ Parser json configuration file """ try: f = open(path, "r") except IOError: print("Can't find config file %s" % path) if prompt_bool("Create a new config file", default=True): init("") else: import logging logging.error("Can't find config file." "Exiting catsup.") sys.exit(0) else: update_config(config, json_decode(f.read()))