Utilities

List Files

This module contains a function to get a list of file paths from a root directory and its subdirectories, filtered by file extension.

markdown_checker.utils.list_files.get_files_paths_list(root_path, extensions=None)

Get a list of file paths from a root directory and its subdirectories, filtered by file extension.

Args:

root_path (Path): The root directory to start the search. extensions (list[str]): A list of file extensions to filter the search.

Returns:

A tuple containing a list of subdirectories and a list of file paths.

Parameters:
Return type:

tuple[list[Path], list[Path]]

Spinner

class markdown_checker.utils.spinner.Spinner(beep=False, disable=False, force=False, stream=sys.stdout)

Bases: object

Parameters:
spinner_cycle = <itertools.cycle object>
start()
Return type:

None

stop()
Return type:

None

init_spin()
Return type:

None

markdown_checker.utils.spinner.spinner(beep=False, disable=False, force=False, stream=sys.stdout)

This function creates a context manager that is used to display a spinner on stdout as long as the context has not exited.

The spinner is created only if stdout is not redirected, or if the spinner is forced using the force parameter.

Args:
beep (bool):

Beep when spinner finishes.

disable (bool):

Hide spinner.

force (bool):

Force creation of spinner even when stdout is redirected.

Example

with spinner():

do_something() do_something_else()

Parameters:
Return type:

Spinner