runner.py


Runner class

Display Footer

Runner source
class Runner:
    """Display Footer"""

    _status = "waiting"

    _dirhash = ""
    time = time.time()

    def __init__(self, markata: "Markata") -> None:
        self.m = markata

    def run(self) -> None:
        self.status = "running"
        self.m.run()
        self.time = time.time()
        self.status = "waiting"

    def __rich__(self) -> Panel:

        if self._dirhash != self.m.content_dir_hash:
            self.run()
            self._dirhash = self.m.content_dir_hash

        s = f"runner is waiting {round(time.time() - self.time)}"

        return Panel(Text(s), border_style="green", title="runner")

init method

None

init source
def __init__(self, markata: "Markata") -> None:
        self.m = markata

run method

None

run source
def run(self) -> None:
        self.status = "running"
        self.m.run()
        self.time = time.time()
        self.status = "waiting"

rich method

None

rich source
def __rich__(self) -> Panel:

        if self._dirhash != self.m.content_dir_hash:
            self.run()
            self._dirhash = self.m.content_dir_hash

        s = f"runner is waiting {round(time.time() - self.time)}"

        return Panel(Text(s), border_style="green", title="runner")