snowmobile.core.utils.console

Base class for all module-level Stdout objects.

Module Contents

Classes

Console

Base class for console output containers.

class snowmobile.core.utils.console.Console(silence: bool = False)

Base class for console output containers.

p(self, text: str)

Conditional print

static offset_path(file_path: Union[str, Path], root_dir_nm: Optional[str] = None, indent: Optional[str] = None, output: bool = False)str

Gets truncated string for file path relative to a root directory.

Parameters
  • file_path (Union[str, Path]) – Full string or Path to the file.

  • root_dir_nm (str) – Directory name to anchor truncated file path to.

  • indent (str) – Optional character to indent by (e.g. ‘ ‘)

  • output (bool) – Option to print the string as well as return it.

Returns (str):

Truncation of a path for console output.