def filename_command(): """Output the path of the config file""" try: config = get_config_obj(file_error=True) except IOError as e: click.echo(e, err=True) click.get_current_context().exit(1) else: click.echo(config.filename)
def filename_command(): """ Executor for `globus config filename` """ try: config = get_config_obj(file_error=True) except IOError as e: safeprint(e, write_to_stderr=True) click.get_current_context().exit(1) else: safeprint(config.filename)
def filename_command(): """ Executor for `globus config filename` """ try: config = get_config_obj(file_error=True) except IOError as e: click.echo(e, err=True) click.get_current_context().exit(1) else: click.echo(config.filename)
def remove_command(parameter): """Remove a value from the Globus config file""" conf = get_config_obj() section = "cli" if "." in parameter: section, parameter = parameter.split(".", 1) # ensure that the section exists if section not in conf: conf[section] = {} # remove the value for the given parameter del conf[section][parameter] # write to disk click.echo("Writing updated config to {}".format(conf.filename)) conf.write()
def set_command(value, parameter): """ Executor for `globus config set` """ conf = get_config_obj() section = "cli" if "." in parameter: section, parameter = parameter.split(".", 1) # ensure that the section exists if section not in conf: conf[section] = {} # set the value for the given parameter conf[section][parameter] = value # write to disk safeprint("Writing updated config to {}".format(conf.filename)) conf.write()
def remove_command(parameter): """ Executor for `globus config remove` """ conf = get_config_obj() section = "cli" if '.' in parameter: section, parameter = parameter.split('.', 1) # ensure that the section exists if section not in conf: conf[section] = {} # remove the value for the given parameter del conf[section][parameter] # write to disk safeprint('Writing updated config to {}'.format(conf.filename)) conf.write()
def set_command(value, parameter): """ Executor for `globus config set` """ conf = get_config_obj() section = "cli" if "." in parameter: section, parameter = parameter.split(".", 1) # ensure that the section exists if section not in conf: conf[section] = {} # set the value for the given parameter conf[section][parameter] = value # write to disk click.echo("Writing updated config to {}".format(conf.filename)) conf.write()