catcher.utils package

Submodules

catcher.utils.file_utils module

catcher.utils.file_utils.cut_part_path(tests_path, test_path)[source]
catcher.utils.file_utils.cut_path(tests_path, test_path)[source]
catcher.utils.file_utils.ensure_dir(path: str)[source]
catcher.utils.file_utils.ensure_empty(path: str)[source]
catcher.utils.file_utils.find_resource(path: str, resource_name: str, extension='.*') → List[str][source]
catcher.utils.file_utils.get_filename(filename: str) → str[source]
catcher.utils.file_utils.get_files(path: str) → list[source]
catcher.utils.file_utils.get_module_filename(module) → str[source]
catcher.utils.file_utils.read_file(file: str) → str[source]
catcher.utils.file_utils.read_source_file(file: str) → dict[source]
catcher.utils.file_utils.remove_dir(path: str)[source]

catcher.utils.logger module

class catcher.utils.logger.OptionalOutput(active: bool)[source]

Bases: contextlib.ContextDecorator

catcher.utils.logger.blue(output: str) → str[source]
catcher.utils.logger.configure(log_level: str, use_color: bool = True)[source]
catcher.utils.logger.critical(msg: str)[source]
catcher.utils.logger.debug(msg: str)[source]
catcher.utils.logger.error(msg: str)[source]
catcher.utils.logger.get_logger() → logging.Logger[source]
catcher.utils.logger.green(output: str) → str[source]
catcher.utils.logger.info(msg: str)[source]
catcher.utils.logger.light_green(output: str) → str[source]
catcher.utils.logger.red(output: str) → str[source]
catcher.utils.logger.warning(msg: str)[source]
catcher.utils.logger.yellow(output: str) → str[source]

catcher.utils.misc module

catcher.utils.misc.eval_datetime(astr, glob=None)[source]
catcher.utils.misc.fill_template(source: str, variables: dict, isjson=False, glob=None, globs_added=None) → str[source]
catcher.utils.misc.fill_template_recursive(source: Union[dict, list, str], variables: dict, glob=None, globs_added=None) → Union[dict, list, str][source]
catcher.utils.misc.fill_template_str(source: any, variables: dict) → str[source]
catcher.utils.misc.format_datetime(iterable)[source]
catcher.utils.misc.inject_builtins(variables: dict) → dict[source]
catcher.utils.misc.merge_two_dicts(x, y)[source]
catcher.utils.misc.render(source: str, variables: dict) → str[source]
catcher.utils.misc.report_override(variables: dict, override: dict)[source]
catcher.utils.misc.try_get_object(source: str)[source]
catcher.utils.misc.try_get_objects(source: str)[source]

catcher.utils.module_utils module

catcher.utils.module_utils.add_package_to_globals(package: str, glob=None, warn_missing_package=True) → dict[source]
catcher.utils.module_utils.add_to_path(p)[source]
catcher.utils.module_utils.get_all_classes(module: Union[str, module]) → dict[source]
catcher.utils.module_utils.get_all_functions(module: str) → dict[source]
catcher.utils.module_utils.get_all_subclasses_of(clazz) → list[source]
catcher.utils.module_utils.get_submodules_of(package: str)[source]

Get all submodules and their importers for the package. It is not recursive. For recursive see __load_python_package_installed Package should be installed in the system.

catcher.utils.module_utils.is_package_installed(package: str) → bool[source]
catcher.utils.module_utils.load_external_actions(package: str)[source]

Load all classes from a package

catcher.utils.module_utils.prepare_modules(module_paths: list, available: dict) → dict[source]

Scan all paths for external modules and form key-value dict. :param module_paths: list of external modules (either python packages or third-party scripts) :param available: dict of all registered python modules (can contain python modules from module_paths) :return: dict of external modules, where keys are filenames (same as stepnames) and values are the paths

catcher.utils.time_utils module

catcher.utils.time_utils.compute_time(key: str, body: dict, to_second: float) → int[source]
catcher.utils.time_utils.to_seconds(body: dict) → int[source]

Module contents