Example #1
0
def _cmd_settings(*args):  # pragma: no cover
    check_repo_ex(exit_on_error=True)

    ns = args[0]
    # Used to specify if config needs to be saved
    save_config = True
    cm = ConfigManager()
    config = cm.load_config()

    # Set the path of the client_config.py relative to the root of
    # the repository
    if ns.config_path is True:
        setup_client_config_path(config)

    # Change the company name. This will effect the file path on the end users
    # computer to place update files & meta data
    if ns.company is True:
        setup_company(config)

    # The amount of times the client retries downloads
    if ns.max_download_retries is True:
        setup_max_download_retries(config)

    # The http timeout for FileDownloader
    if ns.http_timeout is True:
        setup_http_timeout(config)

    # Base urls to online updates & meta data
    if ns.urls is True:
        setup_urls(config)

    # Enable/Disable binary patches
    if ns.patches is True:
        setup_patches(config)

    # Setup config for requested upload plugin
    if ns.plugin is not None:
        setup_plugin(ns.plugin, config)

    # Show list of installed upload plugins
    if ns.show_plugin is not None:
        save_config = False
        print_plugin_settings(ns.show_plugin, config)

    # If any changes have been made, save data to disk.
    if save_config is True:
        cm.save_config(config)
        log.info("Saved config")
Example #2
0
def _cmd_settings(*args):  # pragma: no cover
    check_repo_ex(exit_on_error=True)

    ns = args[0]
    # Used to specify if config needs to be saved
    save_config = True
    cm = ConfigManager()
    config = cm.load_config()

    # Set the path of the client_config.py relative to the root of
    # the repository
    if ns.config_path is True:
        setup_client_config_path(config)

    # Change the company name. This will effect the file path on the end users
    # computer to place update files & meta data
    if ns.company is True:
        setup_company(config)

    # The amount of times the client retries downloads
    if ns.max_download_retries is True:
        setup_max_download_retries(config)

    # Base urls to online updates & meta data
    if ns.urls is True:
        setup_urls(config)

    # Enable/Disable binary patches
    if ns.patches is True:
        setup_patches(config)

    # Setup config for requested upload plugin
    if ns.plugin is not None:
        setup_plugin(ns.plugin, config)

    # Show list of installed upload plugins
    if ns.show_plugin is not None:
        save_config = False
        print_plugin_settings(ns.show_plugin, config)

    # If any changes have been made, save data to disk.
    if save_config is True:
        cm.save_config(config)
        log.info('Saved config')