aboutsummaryrefslogtreecommitdiffstats
path: root/env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-11-14 16:43:12 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-11-14 16:43:12 +0530
commitd47f8b48935d258f4c5c3e2267911753bebd5214 (patch)
tree3ed04e75bc3fc7c8e4ce618f527565da1df630a1 /env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py
parent9468226a9e2e2ab8cdd599f1d8538e860ca86120 (diff)
downloadidcard-d47f8b48935d258f4c5c3e2267911753bebd5214.tar.gz
idcard-d47f8b48935d258f4c5c3e2267911753bebd5214.tar.bz2
idcard-d47f8b48935d258f4c5c3e2267911753bebd5214.zip
id card
Diffstat (limited to 'env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py')
-rw-r--r--env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py b/env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py
deleted file mode 100644
index 65fdf56..0000000
--- a/env/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py
+++ /dev/null
@@ -1,37 +0,0 @@
-from typing import Optional, TYPE_CHECKING
-
-from .jupyter import JupyterMixin
-from .measure import Measurement
-
-if TYPE_CHECKING:
- from .console import Console, ConsoleOptions, RenderableType, RenderResult
-
-
-class Constrain(JupyterMixin):
- """Constrain the width of a renderable to a given number of characters.
-
- Args:
- renderable (RenderableType): A renderable object.
- width (int, optional): The maximum width (in characters) to render. Defaults to 80.
- """
-
- def __init__(self, renderable: "RenderableType", width: Optional[int] = 80) -> None:
- self.renderable = renderable
- self.width = width
-
- def __rich_console__(
- self, console: "Console", options: "ConsoleOptions"
- ) -> "RenderResult":
- if self.width is None:
- yield self.renderable
- else:
- child_options = options.update_width(min(self.width, options.max_width))
- yield from console.render(self.renderable, child_options)
-
- def __rich_measure__(
- self, console: "Console", options: "ConsoleOptions"
- ) -> "Measurement":
- if self.width is not None:
- options = options.update_width(self.width)
- measurement = Measurement.get(console, options, self.renderable)
- return measurement