Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
screen.py
Go to the documentation of this file.
1
from
typing
import
Optional, TYPE_CHECKING
2
3
from
.segment
import
Segment
4
from
.style
import
StyleType
5
from
._loop
import
loop_last
6
7
8
if
TYPE_CHECKING:
9
from
.console
import
(
10
Console,
11
ConsoleOptions,
12
RenderResult,
13
RenderableType,
14
Group,
15
)
16
17
18
class
Screen
:
19
"""A renderable that fills the terminal screen and crops excess.
20
21
Args:
22
renderable (RenderableType): Child renderable.
23
style (StyleType, optional): Optional background style. Defaults to None.
24
"""
25
26
renderable:
"RenderableType"
27
28
def
__init__
(
29
self,
30
*renderables:
"RenderableType"
,
31
style: Optional[StyleType] =
None
,
32
application_mode: bool =
False
,
33
) ->
None
:
34
from
pip._vendor.rich.console
import
Group
35
36
self.
renderable
renderable
=
Group
(*renderables)
37
self.
style
= style
38
self.
application_mode
= application_mode
39
40
def
__rich_console__
(
41
self, console:
"Console"
, options:
"ConsoleOptions"
42
) ->
"RenderResult"
:
43
width, height =
options.size
44
style =
console.get_style
(self.
style
)
if
self.
style
else
None
45
render_options =
options.update
(width=width, height=height)
46
lines =
console.render_lines
(
47
self.
renderable
renderable
or
""
, render_options, style=style, pad=
True
48
)
49
lines =
Segment.set_shape
(lines, width, height, style=style)
50
new_line =
Segment
(
"\n\r"
)
if
self.
application_mode
else
Segment.line
()
51
for
last, line
in
loop_last(lines):
52
yield
from
line
53
if
not
last:
54
yield
new_line
pip._vendor.rich.console.Group
Definition
console.py:462
pip._vendor.rich.screen.Screen
Definition
screen.py:18
pip._vendor.rich.screen.Screen.renderable
str renderable
Definition
screen.py:26
pip._vendor.rich.screen.Screen.renderable
renderable
Definition
screen.py:36
pip._vendor.rich.screen.Screen.application_mode
application_mode
Definition
screen.py:38
pip._vendor.rich.screen.Screen.__rich_console__
"RenderResult" __rich_console__(self, "Console" console, "ConsoleOptions" options)
Definition
screen.py:42
pip._vendor.rich.screen.Screen.style
style
Definition
screen.py:37
pip._vendor.rich.screen.Screen.__init__
None __init__(self, *"RenderableType" renderables, Optional[StyleType] style=None, bool application_mode=False)
Definition
screen.py:33
pip._vendor.rich.segment.Segment
Definition
segment.py:64
pip._vendor.rich.console
Definition
console.py:1
i
for i
Definition
prime_search.m:10
venv
lib
python3.12
site-packages
pip
_vendor
rich
screen.py
Generated by
1.9.8