cafe.configurator package

cafe.configurator.cli module

class cafe.configurator.cli.ConfiguratorCLI[source]

Bases: object

CLI for future engine management and configuration options.

classmethod run()[source]
class cafe.configurator.cli.EngineActions[source]

Bases: object

class Init(args)[source]

Bases: object

class InitInstall(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

class cafe.configurator.cli.PluginActions[source]

Bases: object

class InstallPlugin(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

class ListPlugins(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: argparse.Action

cafe.configurator.cli.entry_point()[source]

cafe.configurator.managers module

class cafe.configurator.managers.EngineConfigManager[source]

Bases: object

ENGINE_CONFIG_PATH = '/home/docs/checkouts/readthedocs.org/user_builds/opencafe/envs/stable/.opencafe/engine.config'
classmethod build_engine_config()[source]
classmethod generate_default_engine_config()[source]
classmethod install_optional_configs(source_directory, print_progress=True)[source]
static read_config_file(path)[source]
static rename_section(config_parser_object, current_section_name, new_section_name)[source]
static rename_section_option(config_parser_object, section_name, current_option_name, new_option_name)[source]
classmethod update_engine_config()[source]

Applies to an existing engine.config file all modifications made to the default engine.config file since opencafe’s release in the order those modification where added.

wrapper = <textwrap.TextWrapper instance>
static write_and_chown_config(config_parser_object, path)[source]
classmethod write_config_backup(config)[source]
class cafe.configurator.managers.EngineDirectoryManager[source]

Bases: object

OPENCAFE_ROOT_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/opencafe/envs/stable/.opencafe'
OPENCAFE_SUB_DIRS = {'DATA_DIR': '/home/docs/checkouts/readthedocs.org/user_builds/opencafe/envs/stable/.opencafe/data', 'CONFIG_DIR': '/home/docs/checkouts/readthedocs.org/user_builds/opencafe/envs/stable/.opencafe/configs', 'LOG_DIR': '/home/docs/checkouts/readthedocs.org/user_builds/opencafe/envs/stable/.opencafe/logs', 'TEMP_DIR': '/home/docs/checkouts/readthedocs.org/user_builds/opencafe/envs/stable/.opencafe/temp'}
classmethod build_engine_directories()[source]

Updates, creates, and owns (as needed) all default directories

classmethod create_engine_directories()[source]
classmethod set_engine_directory_permissions()[source]

Recursively changes permissions default engine directory so that everything is user-owned

wrapper = <textwrap.TextWrapper instance>
class cafe.configurator.managers.EnginePluginManager[source]

Bases: object

classmethod install_plugin(plugin_name)[source]

Install a single plugin by name into the current environment

classmethod install_plugins(plugin_names)[source]

Installs a list of plugins into the current environment

classmethod list_plugins()[source]

Lists all plugins currently available in user’s .opencafe cache

exception cafe.configurator.managers.PackageNotFoundError[source]

Bases: exceptions.Exception

class cafe.configurator.managers.PlatformManager[source]

Bases: object

Methods for dealing with the OS cafe is running on

USING_VIRTUALENV = True
USING_WINDOWS = False
classmethod get_current_user()[source]

Returns the name of the current user. For Linux, always tries to return a user other than ‘root’ if it can.

classmethod get_user_gid()[source]
classmethod get_user_home_path()[source]
classmethod get_user_uid()[source]
classmethod safe_chown(path)[source]
classmethod safe_create_dir(directory_path)[source]
class cafe.configurator.managers.TestEnvManager(product_name, test_config_file_name, engine_config_path=None, test_repo_package_name=None)[source]

Bases: object

Sets all environment variables used by cafe and its implementations.

Wraps all internally-set and config-controlled environment variables in read-only properties for easy access. Useful for writing bootstrappers for runners and scripts.

Set the environment variable “CAFE_ALLOW_MANAGED_ENV_VAR_OVERRIDES” to any value to enable overrides for derived environment variables. (The full list of these is available in the attribute MANAGED_VARS)

NOTE: The TestEnvManager is only responsible for setting these vars, it has no control over how they are used by the engine or its implementations, so override them at your own risk!

USAGE HINTS: If you set CAFE_TEST_REPO_PATH, you should also set the CAFE_TEST_REPO_PACKAGE accordingly, as having them point to different things could cause undefined behavior. (The path is normally derived from the package).

MANAGED_VARS = {'test_data_directory': 'CAFE_DATA_DIR_PATH', 'test_config_file_path': 'CAFE_CONFIG_FILE_PATH', 'engine_config_path': 'CAFE_ENGINE_CONFIG_FILE_PATH', 'test_master_log_file_name': 'CAFE_MASTER_LOG_FILE_NAME', 'test_log_dir': 'CAFE_TEST_LOG_PATH', 'test_repo_path': 'CAFE_TEST_REPO_PATH', 'test_logging_verbosity': 'CAFE_LOGGING_VERBOSITY', 'test_root_log_dir': 'CAFE_ROOT_LOG_PATH', 'test_repo_package': 'CAFE_TEST_REPO_PACKAGE'}
finalize(create_log_dirs=True)[source]

Calls all lazy_properties in the TestEnvManager.

Sets all lazy_properties to their configured or derived values. To override this behavior, simply don’t call finalize(): note that unless you manually set the os environment variables yourself this will result in undefined behavior. Creates all log directories, overridden by making create_log_dirs=False. Checks that all set paths exists, raises exception if they don’t.

test_config_file_path = None
test_data_directory = None
test_log_dir = None
test_logging_verbosity = None
test_master_log_file_name = None
test_repo_package = None
test_repo_path = None
test_root_log_dir = None