| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 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 : /usr/lib/python3/dist-packages/IPython/core/__pycache__/ |
Upload File : |
�
�@�c�- � �t � d Z ddlZddlZddlZddlZddlZddlZddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZ dd
�Zd� Z ej d� � Zdd�Zd� Zdd�Zdd�Zdd�Z d d�Z!d� Z"ej# dk r(ej$ �% dd� � dk r ddl&Z&d� Z'dS d� Z'dS )!z�
Paging capabilities for IPython.core
Notes
-----
For now this uses IPython hooks, so it can't be in IPython.utils. If we can get
rid of that dependency, we could move it there.
-----
� N)�UnsupportedOperation)�Path)�get_ipython)�display)�TryNext)�chop)�system)�get_terminal_size)� py3compat� c �� � t | t � � r| }n5|r/d� | � � � |d� � � } d| i}t |d�� � dS )z1Just display, no paging. screen_lines is ignored.�
N�
text/plainT)�raw)�
isinstance�dict�join�
splitlinesr )�strng�start�screen_lines�datas �3/usr/lib/python3/dist-packages/IPython/core/page.py�display_pager $ sl � ��%���� '����� ;��J�J�u�/�/�1�1�%�&�&�9�:�:�E��u�&���D�d������� c � � � � fd�S )zRWrap a pager func to strip the `self` arg
so it can be called as a hook.
c � �� �|i |��S �N� )�self�args�kwargs� page_funcs �r �<lambda>zas_hook.<locals>.<lambda>4 s �� ���D�)C�F�)C�)C� r r )r# s `r �as_hookr% / s �� �
D�C�C�C�Cr z(\x1b[^m]+m)c � � t | t � � r| � dd� � } | � � � |d� }t ||dz
� � }t |� � dk r4t
t j � |d � � � � dS d}|dd� D ]y}t j � |� � }t
||z � � t � � s dS t � |� � }t |� � dk r|d }�zt
|t j � |d � � z � � dS )z�Very dumb 'pager' in Python, for when nothing else works.
Only moves forward, same interface as page(), except for pager_cmd and
mode.
r � N� r ���)
r r �getr r �len�print�os�linesepr � page_more�esc_re�findall) r r r �out_ln�screens�last_escape�scr�hunk�esc_lists r � page_dumbr8 9 s9 � � �%���� ,�� � �,��+�+����� � ����(�F��6�,�q�.�)�)�G�
�7�|�|�q���
�b�j�o�o�g�a�j�)�)�*�*�*�*�*����1�R�4�=� +� +�C��:�?�?�3�'�'�D��+��$�%�%�%��;�;�
�����~�~�d�+�+�H��8�}�}�q� � �&�r�l���
�k�B�J�O�O�G�B�K�8�8�8�9�9�9�9�9r c �X � t j � dd� � }|dk s|dk rt j dk s| S ddl}ddl}n# t $ r | cY S w xY w |� t j � � }n5# |j
$ r(}t d� |� � � � |�d}~ww xY w |�
� � }n# t $ r | cY S w xY w|� � � \ }}|� � � |� t j |j |� � |S )z�Attempt to work out the number of lines on the screen.
This is called by page(). It can raise an error (e.g. when run in the
test suite), so it's separated out so it can easily be called in a try block.
�TERMN�xtermzxterm-color�sunos5r ztermios error: {0})r- �environr* �sys�platform�termios�curses�ImportError� tcgetattr�stdout�error� TypeError�format�initscr�AttributeError�getmaxyx�endwin� tcsetattr�TCSANOW) �screen_lines_defr: r@ rA �
term_flags�errr5 �screen_lines_real�screen_colss r �_detect_screen_sizerS Q sd � � �:�>�>�&��&�&�D��'�M�M�T�=�0�0�c�l�h�6N�6N� �� ������
�
�
�
��� � � ����� ����C��&�&�s�z�2�2�
�
���=� C� C� C��,�3�3�C�8�8�9�9�s�B�����C���� ��n�n������� � � ����� ���� %(�L�L�N�N�!��k�
�M�M�O�O�O� ���c�j����<�<�<��s<