phystool.helper
Module Contents
Classes
Wrapper around an iterable that allows peeking ahead to get next elements without consuming the iterator. |
Functions
Ask for a confirmation in the terminal. |
|
Find query in tex files stored in the single directory |
|
Taken from slugify at https://github.com/django/django/blob/stable/5.2.x/ Convert to ASCII. Convert spaces or repeated dashes to single dashes. Remove characters that aren’t alphanumerics, underscores, or hyphens. Convert to lowercase. Strip leading and trailing white spaces, dashes, and underscores. |
|
Data
API
- phystool.helper.logger
“getLogger(…)”
- phystool.helper.should_compile(tex_file: pathlib.Path) bool
- phystool.helper.terminal_yes_no(prompt: str) bool
Ask for a confirmation in the terminal.
- Paramètres:
prompt – text displayed before the “[y/n]:” question
- phystool.helper.silent_keyboard_interrupt(func)
- phystool.helper.ripgrep(query: str, path: pathlib.Path, silent: bool) set[uuid.UUID]
Find query in tex files stored in the single directory
path.Format query to match a newline followed by spaces and returns a set of uuids of tex files containing query.
- Paramètres:
query – string that should be matched
path – directory where the search occurs
silent – if True, logs a warning when no match was found
- Renvoie:
a set of uuids corresponding to tex files that contains the query
- phystool.helper.as_valid_filename(value: str) str
Taken from slugify at https://github.com/django/django/blob/stable/5.2.x/ Convert to ASCII. Convert spaces or repeated dashes to single dashes. Remove characters that aren’t alphanumerics, underscores, or hyphens. Convert to lowercase. Strip leading and trailing white spaces, dashes, and underscores.
- class phystool.helper.ContextIterator(iterable: Iterable[T], before: int, after: int)
Wrapper around an iterable that allows peeking ahead to get next elements without consuming the iterator.
Initialization
- get() list[T]
- phystool.helper.progress_bar(f: Callable[[], Iterator[tuple[int, int, str]]]) None
- phystool.helper.texfile_to_symlink(tex_file: pathlib.Path) pathlib.Path