:mod:`pidgy.util` ================= .. py:module:: pidgy.util Module Contents --------------- .. py:class:: ContextDepth Count the current depth of a context manager invocation. .. attribute:: depth :annotation: = 0 .. method:: __enter__(self) .. method:: __exit__(self, *e) .. function:: html_comment(text) .. function:: istype(object, cls) .. data:: WHITESPACE .. function:: indents(str: str) -> int .. function:: num_first_indent(text: str) -> int The number of indents for the first blank line. .. function:: num_last_indent(text: str) -> int The number of indents for the last blank line. .. function:: base_indent(tokens: typing.List[dict]) -> int Peek into mistune tokens and find the last code indent. .. function:: quote(text: str) -> str Wrap strings in triple quoted block strings. .. function:: whiten(text: str) -> str `whiten` strips empty lines because the `markdown.BlockLexer` doesn't like that. .. function:: strip_front_matter(text: str, sep=None) -> str Remove yaml front matter froma string. .. function:: ansify(str: str, format='md') High source to be printed in the terms. .. function:: yield_files(files: typing.Sequence[str], recursive=False) -> typing.Generator Return a list of files from a collection of files and globs. .. function:: argv(*args: str) .. function:: strip_shebang(str) .. function:: strip_html_comment(str) .. function:: strip_front_matter(text: str, sep=None) -> str Remove yaml front matter froma string. .. function:: sys_path()