INNER CODE UNIT · Python

ensure_plugins_enabled

overhangio/tutor · tutor/commands/cli.py:64

    def ensure_plugins_enabled(self, ctx: click.Context) -> None:
        """
        We enable plugins as soon as possible to have access to commands.
        """
        if "root" not in ctx.params:
            # When generating docs, this function is called with empty args.
            # That's ok, we just ignore it.
            return
        if not self.IS_ROOT_READY:
            hooks.Actions.PROJECT_ROOT_READY.do(ctx.params["root"])
            self.IS_ROOT_READY = True
            for cmd in hooks.Filters.CLI_COMMANDS.iterate():
                self.add_command(cmd)


@click.group(
    cls=TutorCli,
    invoke_without_command=True,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…