summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/rich_click/rich_context.py
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2024-04-03 03:17:55 -0400
committercyfraeviolae <cyfraeviolae>2024-04-03 03:17:55 -0400
commit12cf076118570eebbff08c6b3090e0d4798447a1 (patch)
tree3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/rich_click/rich_context.py
parentc45662ff3923b34614ddcc8feb9195541166dcc5 (diff)
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/rich_click/rich_context.py')
-rw-r--r--venv/lib/python3.11/site-packages/rich_click/rich_context.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/venv/lib/python3.11/site-packages/rich_click/rich_context.py b/venv/lib/python3.11/site-packages/rich_click/rich_context.py
deleted file mode 100644
index 8e5e0a2..0000000
--- a/venv/lib/python3.11/site-packages/rich_click/rich_context.py
+++ /dev/null
@@ -1,47 +0,0 @@
-from typing import Any, Optional, Type
-
-import click
-from rich.console import Console
-
-from rich_click.rich_help_configuration import RichHelpConfiguration
-from rich_click.rich_help_formatter import RichHelpFormatter
-
-
-class RichContext(click.Context):
- """Click Context class endowed with Rich superpowers."""
-
- formatter_class: Type[RichHelpFormatter] = RichHelpFormatter
-
- def __init__(
- self,
- *args: Any,
- rich_console: Optional[Console] = None,
- rich_help_config: Optional[RichHelpConfiguration] = None,
- **kwargs: Any,
- ) -> None:
- """Create Rich Context instance.
-
- Args:
- rich_console: Rich Console.
- Defaults to None.
- rich_help_config: Rich help configuration.
- Defaults to None.
- """
- super().__init__(*args, **kwargs)
- parent: Optional[RichContext] = kwargs.pop("parent", None)
-
- if rich_console is None and hasattr(parent, "console"):
- rich_console = parent.console # type: ignore[has-type,union-attr]
-
- self.console = rich_console
-
- if rich_help_config is None and hasattr(parent, "help_config"):
- rich_help_config = parent.help_config # type: ignore[has-type,union-attr]
-
- self.help_config = rich_help_config
-
- def make_formatter(self) -> RichHelpFormatter:
- """Create the Rich Help Formatter."""
- return self.formatter_class(
- width=self.terminal_width, max_width=self.max_content_width, config=self.help_config
- )