doot.reporters._interface

Type Aliases

Logger

Protocols

ReportGroup_p

Base class for protocol classes.

WorkflowGroup_p

A Re-entrant ctx manager,

GeneralGroup_p

Reporter Methods for general user facing messages

TreeGroup_p

Base class for protocol classes.

SummaryGroup_p

Base class for protocol classes.

Reporter_p

Reporters provide attr access to any registered ReportGroup_p's,

ReportFormatter_p

Base class for protocol classes.

Classes

TraceRecord_d

For Storing what happened, where, and why

ReportStackEntry_d

Data for storing the context of the reporter

Module Contents

doot.reporters._interface.Logger: TypeAlias = logmod.Logger
class doot.reporters._interface.ReportGroup_p[source]

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
_out(
key: str,
*,
info: jgdv.Maybe = None,
msg: jgdv.Maybe = None,
level: int = 0,
) None[source]
Parameters:
  • key (str)

  • info (jgdv.Maybe)

  • msg (jgdv.Maybe)

  • level (int)

Return type:

None

class doot.reporters._interface.WorkflowGroup_p[source]

Bases: ReportGroup_p, Protocol

A Re-entrant ctx manager, used for reporting user-level information about a task workflow run.

root() Self[source]
Return type:

Self

wait() Self[source]
Return type:

Self

act(info: str, msg: str) Self[source]
Parameters:
Return type:

Self

fail(
*,
info: jgdv.Maybe[str] = None,
msg: jgdv.Maybe[str] = None,
) Self[source]
Parameters:
  • info (jgdv.Maybe[str])

  • msg (jgdv.Maybe[str])

Return type:

Self

branch(
name: str | doot.workflow._interface.TaskName_p,
info: jgdv.Maybe[str] = None,
) Self[source]
Parameters:
Return type:

Self

pause(reason: str) Self[source]
Parameters:

reason (str)

Return type:

Self

result(
state: list[str],
info: jgdv.Maybe[str] = None,
) Self[source]
Parameters:
Return type:

Self

resume(
name: str | doot.workflow._interface.TaskName_p,
) Self[source]
Parameters:

name (str | doot.workflow._interface.TaskName_p)

Return type:

Self

finished() Self[source]
Return type:

Self

queue(num: int) Self[source]
Parameters:

num (int)

Return type:

Self

state_result(*vals: str) Self[source]
Parameters:

vals (str)

Return type:

Self

line(
msg: jgdv.Maybe[str] = None,
char: jgdv.Maybe[str] = None,
) Self[source]
Parameters:
  • msg (jgdv.Maybe[str])

  • char (jgdv.Maybe[str])

Return type:

Self

class doot.reporters._interface.GeneralGroup_p[source]

Bases: ReportGroup_p, Protocol

Reporter Methods for general user facing messages

header() Self[source]
Return type:

Self

user(msg: str, *rest: Any, **kwargs: Any) Self[source]
Parameters:
  • msg (str)

  • rest (Any)

  • kwargs (Any)

Return type:

Self

trace(msg: str, *rest: Any, **kwargs: Any) Self[source]
Parameters:
  • msg (str)

  • rest (Any)

  • kwargs (Any)

Return type:

Self

failure(
msg: str,
*rest: Any,
**kwargs: Any,
) Self[source]
Parameters:
  • msg (str)

  • rest (Any)

  • kwargs (Any)

Return type:

Self

detail(
msg: str,
*rest: Any,
**kwargs: Any,
) Self[source]
Parameters:
  • msg (str)

  • rest (Any)

  • kwargs (Any)

Return type:

Self

warn(msg: str, *rest: Any, **kwargs: Any) Self[source]
Parameters:
  • msg (str)

  • rest (Any)

  • kwargs (Any)

Return type:

Self

error(msg: str, *rest: Any, **kwargs: Any) Self[source]
Parameters:
  • msg (str)

  • rest (Any)

  • kwargs (Any)

Return type:

Self

line(
msg: jgdv.Maybe[str] = None,
char: jgdv.Maybe[str] = None,
) Self[source]
Parameters:
  • msg (jgdv.Maybe[str])

  • char (jgdv.Maybe[str])

Return type:

Self

gap() Self[source]
Return type:

Self

class doot.reporters._interface.TreeGroup_p[source]

Bases: ReportGroup_p, Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
class doot.reporters._interface.SummaryGroup_p[source]

Bases: ReportGroup_p, Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
start() None[source]
Return type:

None

finish() None[source]
Return type:

None

add(key: str, *vals: Any) Self[source]
Parameters:
  • key (str)

  • vals (Any)

Return type:

Self

summarise() Self[source]
Return type:

Self

class doot.reporters._interface.Reporter_p[source]

Bases: Protocol

Reporters provide attr access to any registered ReportGroup_p’s, for formatted printing of workflow information

_entry_count: int
_fmt: ReportFormatter_p
_logger: Logger
_stack: list[ReportStackEntry_d]
property state: ReportStackEntry_d[source]
Return type:

ReportStackEntry_d

property wf: WorkflowGroup_p[source]
Return type:

WorkflowGroup_p

property gen: GeneralGroup_p[source]
Return type:

GeneralGroup_p

property tree: TreeGroup_p[source]
Return type:

TreeGroup_p

property summary: SummaryGroup_p[source]
Return type:

SummaryGroup_p

push_state(state: str, **kwargs: Any) Self[source]
Parameters:
  • state (str)

  • kwargs (Any)

Return type:

Self

pop_state() Self[source]
Return type:

Self

active_level(level: int) None[source]
Parameters:

level (int)

Return type:

None

class doot.reporters._interface.ReportFormatter_p[source]

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
get_segment(key: str) jgdv.Maybe[str][source]
Parameters:

key (str)

Return type:

jgdv.Maybe[str]

class doot.reporters._interface.TraceRecord_d(
*,
what: str,
where: str,
why: str,
when: jgdv.DateTime,
)[source]

For Storing what happened, where, and why

Parameters:
  • what (str)

  • where (str)

  • why (str)

  • when (jgdv.DateTime)

what
where
why
when
class doot.reporters._interface.ReportStackEntry_d(**kwargs: Any)[source]

Data for storing the context of the reporter

Parameters:

kwargs (Any)

log_extra: dict
log_level: int
depth: int
state: str
data: dict
prefix: list[str]
extra: dict