/opt/support/venv/lib/python3.13/site-packages/pip/_vendor/rich
NameSizeModeActions
__pycache__/-0755rm
abc.py8900755editdlrm
align.py103240755editdlrm
ansi.py69210755editdlrm
bar.py32630755editdlrm
box.py106860755editdlrm
cells.py51300755editdlrm
color.py182110755editdlrm
color_triplet.py10540755editdlrm
columns.py71310755editdlrm
console.py1008490755editdlrm
constrain.py12880755editdlrm
containers.py55020755editdlrm
control.py64870755editdlrm
default_styles.py82570755editdlrm
diagnose.py10250755editdlrm
emoji.py23670755editdlrm
errors.py6420755editdlrm
filesize.py24840755editdlrm
file_proxy.py16830755editdlrm
highlighter.py95860755editdlrm
json.py50310755editdlrm
jupyter.py32520755editdlrm
layout.py140040755editdlrm
LICENSE10560755editdlrm
live.py151800755editdlrm
live_render.py35210755editdlrm
logging.py124680755editdlrm
markup.py84510755editdlrm
measure.py53050755editdlrm
padding.py49080755editdlrm
pager.py8280755editdlrm
palette.py33960755editdlrm
panel.py111570755editdlrm
pretty.py363910755editdlrm
progress.py604080755editdlrm
progress_bar.py81620755editdlrm
prompt.py124470755editdlrm
protocol.py13910755editdlrm
py.typed00755editdlrm
region.py1660755editdlrm
repr.py44310755editdlrm
rule.py46020755editdlrm
scope.py28430755editdlrm
screen.py15910755editdlrm
segment.py247430755editdlrm
spinner.py42140755editdlrm
status.py44240755editdlrm
style.py269900755editdlrm
styled.py12580755editdlrm
syntax.py363710755editdlrm
table.py400490755editdlrm
terminal_theme.py33700755editdlrm
text.py475520755editdlrm
theme.py37710755editdlrm
themes.py1020755editdlrm
traceback.py358610755editdlrm
tree.py94510755editdlrm
_cell_widths.py102090755editdlrm
_emoji_codes.py1402350755editdlrm
_emoji_replace.py10640755editdlrm
_export_format.py21280755editdlrm
_extension.py2650755editdlrm
_fileno.py7990755editdlrm
_inspect.py96560755editdlrm
_log_render.py32250755editdlrm
_loop.py12360755editdlrm
_null_file.py13940755editdlrm
_palettes.py70630755editdlrm
_pick.py4230755editdlrm
_ratio.py53250755editdlrm
_spinners.py199190755editdlrm
_stack.py3510755editdlrm
_timer.py4170755editdlrm
_win32_console.py227550755editdlrm
_windows.py19250755editdlrm
_windows_renderer.py27830755editdlrm
_wrap.py34040755editdlrm
__init__.py60900755editdlrm
__main__.py78960755editdlrm
Edit: /opt/support/venv/lib/python3.13/site-packages/pip/_vendor/rich/file_proxy.py (1683B)
import io from typing import IO, TYPE_CHECKING, Any, List from .ansi import AnsiDecoder from .text import Text if TYPE_CHECKING: from .console import Console class FileProxy(io.TextIOBase): """Wraps a file (e.g. sys.stdout) and redirects writes to a console.""" def __init__(self, console: "Console", file: IO[str]) -> None: self.__console = console self.__file = file self.__buffer: List[str] = [] self.__ansi_decoder = AnsiDecoder() @property def rich_proxied_file(self) -> IO[str]: """Get proxied file.""" return self.__file def __getattr__(self, name: str) -> Any: return getattr(self.__file, name) def write(self, text: str) -> int: if not isinstance(text, str): raise TypeError(f"write() argument must be str, not {type(text).__name__}") buffer = self.__buffer lines: List[str] = [] while text: line, new_line, text = text.partition("\n") if new_line: lines.append("".join(buffer) + line) buffer.clear() else: buffer.append(line) break if lines: console = self.__console with console: output = Text("\n").join( self.__ansi_decoder.decode_line(line) for line in lines ) console.print(output) return len(text) def flush(self) -> None: output = "".join(self.__buffer) if output: self.__console.print(output) del self.__buffer[:] def fileno(self) -> int: return self.__file.fileno()