예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
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()
예제 #6
0
파일: set.py 프로젝트: globus/globus-cli
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()
예제 #7
0
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()
예제 #8
0
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()