None

Plugins class

Plugins source


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

            def __rich__(self) -> Panel:
                grid = Table.grid(expand=True)
                num_plugins = f"[bright_blue]({len(self.m._pm.get_plugins())})[/]"

                for plugin in self.m._pm.get_plugins():
                    grid.add_row(
                        "".join(
                            [
                                "[bright_black]",
                                ".".join(plugin.__name__.split(".")[:-1]),
                                ".[/]",
                                plugin.__name__.split(".")[-1],
                            ],
                        ),
                    )
                return Panel(
                    grid,
                    title=f"plugins {num_plugins}",
                    border_style="gold1",
                    expand=False,
                )

configure function

configure source


        def configure(markata: "Markata") -> None:
            def get_plugins(self):
                try:
                    return self._plugins
                except AttributeError:
                    self._plugins: Plugins = Plugins(self)
                    return self._plugins

            from markata import Markata

            Markata.plugins = property(get_plugins)

init method

init source


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

rich method

rich source


        def __rich__(self) -> Panel:
                grid = Table.grid(expand=True)
                num_plugins = f"[bright_blue]({len(self.m._pm.get_plugins())})[/]"

                for plugin in self.m._pm.get_plugins():
                    grid.add_row(
                        "".join(
                            [
                                "[bright_black]",
                                ".".join(plugin.__name__.split(".")[:-1]),
                                ".[/]",
                                plugin.__name__.split(".")[-1],
                            ],
                        ),
                    )
                return Panel(
                    grid,
                    title=f"plugins {num_plugins}",
                    border_style="gold1",
                    expand=False,
                )

get_plugins function

get_plugins source


        def get_plugins(self):
                try:
                    return self._plugins
                except AttributeError:
                    self._plugins: Plugins = Plugins(self)
                    return self._plugins