Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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()
Exemplo n.º 6
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
    safeprint("Writing updated config to {}".format(conf.filename))
    conf.write()
Exemplo n.º 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()
Exemplo n.º 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()