Skip to content

omnipy.components.raw.protocols

Protocols for raw-text content transformation callbacks.

CLASS DESCRIPTION
IsModifyAllLinesCallable

Protocol for callbacks that rewrite a list of lines in bulk.

IsModifyContentCallable

Protocol for callbacks that rewrite an entire raw content item.

IsModifyEachLineCallable

Protocol for callbacks that rewrite one line at a time.

IsModifyAllLinesCallable

Bases: Protocol


              flowchart BT
              omnipy.components.raw.protocols.IsModifyAllLinesCallable[IsModifyAllLinesCallable]

              

              click omnipy.components.raw.protocols.IsModifyAllLinesCallable href "" "omnipy.components.raw.protocols.IsModifyAllLinesCallable"
            

Protocol for callbacks that rewrite a list of lines in bulk.

Source code in src/omnipy/components/raw/protocols.py
class IsModifyAllLinesCallable(Protocol):
    """Protocol for callbacks that rewrite a list of lines in bulk."""
    def __call__(self, all_lines: list[str], **kwargs: object) -> list[str]:
        ...

IsModifyContentCallable

Bases: Protocol


              flowchart BT
              omnipy.components.raw.protocols.IsModifyContentCallable[IsModifyContentCallable]

              

              click omnipy.components.raw.protocols.IsModifyContentCallable href "" "omnipy.components.raw.protocols.IsModifyContentCallable"
            

Protocol for callbacks that rewrite an entire raw content item.

Source code in src/omnipy/components/raw/protocols.py
6
7
8
9
class IsModifyContentCallable(Protocol):
    """Protocol for callbacks that rewrite an entire raw content item."""
    def __call__(self, data_file: str, **kwargs: object) -> str:
        ...

IsModifyEachLineCallable

Bases: Protocol


              flowchart BT
              omnipy.components.raw.protocols.IsModifyEachLineCallable[IsModifyEachLineCallable]

              

              click omnipy.components.raw.protocols.IsModifyEachLineCallable href "" "omnipy.components.raw.protocols.IsModifyEachLineCallable"
            

Protocol for callbacks that rewrite one line at a time.

Source code in src/omnipy/components/raw/protocols.py
class IsModifyEachLineCallable(Protocol):
    """Protocol for callbacks that rewrite one line at a time."""
    def __call__(self, line_no: int, line: str, **kwargs: object) -> str:
        ...