schema_salad.sourceline
Attributes
Classes
Functions
|
|
|
|
|
Reflow text respecting a common prefix with line & col info. |
|
Reflow a single line of text. |
|
|
|
Indent using the specified number of bullets. |
|
Strip duplicated line numbers. |
|
Strip duplicated line numbers. |
|
Apply line+column & filename data through to the provided data. |
Module Contents
- schema_salad.sourceline.lineno_re: Final
- schema_salad.sourceline.add_lc_filename(r, source)
- Parameters:
r (ruamel.yaml.comments.CommentedBase)
source (str)
- Return type:
None
- schema_salad.sourceline.reflow_all(text, maxline=None)
Reflow text respecting a common prefix with line & col info.
- schema_salad.sourceline.reflow(text, maxline, shift='')
Reflow a single line of text.
- schema_salad.sourceline.indent(v, nolead=False, shift=' ', bullet=' ')
- schema_salad.sourceline.bullets(textlist, bul)
Indent using the specified number of bullets.
- schema_salad.sourceline.strip_duplicated_lineno(text)
Strip duplicated line numbers.
Same as
strip_dup_lineno()but without reflow.
- schema_salad.sourceline.strip_dup_lineno(text, maxline=None)
Strip duplicated line numbers.
- schema_salad.sourceline.cmap(d, lc=None, fn=None)
Apply line+column & filename data through to the provided data.
- Parameters:
d (int | float | str | collections.abc.MutableMapping[str, Any] | collections.abc.MutableSequence[Any] | None) – Target datastructure: number and strings will be passed through unchanged. Non-Commented container types with be transformed into the relevant Commented container types.
lc (list[int] | None) – Line & Column information to be applied.
fn (str | None) – The Filename to store.
- Returns:
The (transformed) datastructure.
- Return type:
int | float | str | ruamel.yaml.comments.CommentedMap | ruamel.yaml.comments.CommentedSeq | None
- class schema_salad.sourceline.SourceLine(item, key=None, raise_type=str, include_traceback=False)
- Parameters:
item (Any)
key (Any | None)
raise_type (collections.abc.Callable[[str], Any])
include_traceback (bool)
- item
- key = None
- raise_type
- include_traceback = False
- __enter__()
- Return type:
- __exit__(exc_type, exc_value, tb)
- Parameters:
exc_type (Any)
exc_value (Any)
tb (Any)
- Return type:
None