Project: pygitweb

367a341 from __future__ import annotations
a63a5e5 from typing import Protocol, runtime_checkable
a63a5e5 from abcreg import AnnotatedProtocolMeta # type: ignore[import-untyped]
367a341 from fastapi import Request
from starlette.responses import Response
a63a5e5 @runtime_checkable
class Action(Protocol, metaclass=AnnotatedProtocolMeta):
73c9c30 """
Action: A per-project action provided by a plugin.
367a341
73c9c30 ``project`` is the project path/slug as used in URLs (under PROJECTROOT).
Subclass this protocol, or register a virtual subclass with ``@Action.register``.
"""
0b3610d
73c9c30 def action_name(self) -> str: ...
0b3610d
73c9c30 def action(self, project: str, req: Request | None = None) -> Response | None: ...