Skip to content

decorators

dandy.recorder.decorators

recorder_to_html_file

Source code in dandy/recorder/decorators.py
def recorder_to_html_file(recording_name: str | None = None, path: Path | str | None = None) -> Callable:
    if path is None:
        path = Recorder.get_default_recording_path()

    def decorator(func: Callable) -> Callable:
        @wraps(func)
        def wrapper(*args, **kwargs) -> Callable:
            return _recorder_to_file_decorator_function(func, args, kwargs, recording_name, 'html', path)

        return wrapper

    return decorator

recorder_to_json_file

Source code in dandy/recorder/decorators.py
def recorder_to_json_file(recording_name: str | None = None, path: Path | str | None = None) -> Callable:
    if path is None:
        path = Recorder.get_default_recording_path()

    def decorator(func: Callable) -> Callable:
        @wraps(func)
        def wrapper(*args, **kwargs) -> Callable:
            return _recorder_to_file_decorator_function(func, args, kwargs, recording_name, 'json', path)

        return wrapper

    return decorator

recorder_to_markdown_file

Source code in dandy/recorder/decorators.py
def recorder_to_markdown_file(recording_name: str | None = None, path: Path | str | None = None) -> Callable:
    if path is None:
        path = Recorder.get_default_recording_path()

    def decorator(func: Callable) -> Callable:
        @wraps(func)
        def wrapper(*args, **kwargs) -> Callable:
            return _recorder_to_file_decorator_function(func, args, kwargs, recording_name, 'markdown', path)

        return wrapper

    return decorator