| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/utils/__pycache__/ |
Upload File : |
�
�@�c� � � � d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
ddlmZm
Z
eej dd �
� � Z ej ej � � G d� de� � Zdd
�Zdd�Ze
d� � � Ze
d� � � ZdS )z
IO related utilities.
� N)�Path)�warn)�undoc� )�
CapturedIO�capture_output�w�utf-8��encodingc �2 � e Zd ZdZd
d�Zd� Zd� Zd� Zd� Zd S )�Teez�A class to duplicate an output stream to stdout/err.
This works in a manner very similar to the Unix 'tee' command.
When the object is closed or deleted, it closes the original file given to
it for duplication.
r �stdoutc �< � |dvrt d|z � � �t |d� � rt |d� � r|| _ nd|v rdnd}t |||�� � | _ || _ t t |� � | _ t t || � � d | _ dS )
aN Construct a new Tee object.
Parameters
----------
file_or_name : filename or open filehandle (writable)
File that will be duplicated
mode : optional, valid mode for open().
If a filename was give, open with this mode.
channel : str, one of ['stdout', 'stderr']
)r �stderrzInvalid channel spec %s�write�seek�bNr
r F)
�
ValueError�hasattr�file�open�channel�getattr�sys�ostream�setattr�_closed)�self�file_or_name�moder r s �2/usr/lib/python3/dist-packages/IPython/utils/io.py�__init__zTee.__init__&