Skip to content

Babylon.utils.decorators

describe_dry_run(description)

Add a dry run description for the decorated call

Parameters:

Name Type Description Default
description str

description to de displayed during dry runs (accepts markdown content)

required

output_to_file(func)

Add output to file option to a command

prepend_doc_with_ascii(func)

Decorator used to add a babylon ascii art in the documentation of a function

Parameters:

Name Type Description Default
func Callable[..., Any]

The function being decorated

required

requires_external_program(program_name)

Decorator allowing to check if a specific executable is available. If the check is failed the command won't run, and following checks won't be done

Parameters:

Name Type Description Default
program_name str

the name of the required program

required

timing_decorator(func)

Decorator adding timings before and after the run of a function

Parameters:

Name Type Description Default
func Callable[..., Any]

The function being decorated

required