404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.218.63.176: ~ $
3


.�]�5�@s�dZddlZddlZddlZddlZejddd�dZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZejddkZer�eZdd�ZGdd�d�ZdS)a�This implements a virtual screen. This is used to support ANSI terminal
emulation. The screen representation and state is implemented in this class.
Most of the methods are inspired by ANSI screen control codes. The
:class:`~pexpect.ANSI.ANSI` class extends this class to add parsing of ANSI
escape codes.

PEXPECT LICENSE

    This license is approved by the OSI and FSF as GPL-compatible.
        http://opensource.org/licenses/isc-license.txt

    Copyright (c) 2012, Noah Spurrier <noah@noah.org>
    PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
    PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE
    COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES.
    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

�Nz�pexpect.screen and pexpect.ANSI are deprecated. We recommend using pyte to emulate a terminal screen: https://pypi.python.org/pypi/pyte�)�
stacklevel����	�
���
��������� �cCs||kr|S||kr|S|S)z@This returns a number, n constrained to the min and max bounds. �)�n�min�maxrr�/usr/lib/python3.6/screen.py�	constrain<s
rc@s�eZdZdZdbdd�Zdd	�Zd
d�Zer0eZneZ	dd
�Zdd�Z
dd�Zefdd�Z
efdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zdcd/d0�Zddd1d2�Zded3d4�Zdfd5d6�Zdgd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$dCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3daS)h�screena5This object maintains the state of a virtual text screen as a
    rectangular array. This maintains a virtual cursor position and handles
    scrolling as characters are added. This supports most of the methods needed
    by an ANSI text screen. Row and column indexes are 1-based (not zero-based,
    like arrays).

    Characters are represented internally using unicode. Methods that accept
    input characters, when passed 'bytes' (which in Python 2 is equivalent to
    'str'), convert them from the encoding specified in the 'encoding'
    parameter to the constructor. Methods that return screen contents return
    unicode strings, with the exception of __str__() under Python 2. Passing
    ``encoding=None`` limits the API to only accept unicode input, so passing
    bytes in will raise :exc:`TypeError`.
    r�P�latin-1�replacecs||�_|�_|�_|�_|dk	r2tj|�|��_nd�_d�_d�_d�_	d�_
d�_�j�_�fdd�t
�j�D��_dS)z8This initializes a blank screen of the given dimensions.N�csg|]}tg�j�qSr)�SPACE�cols)�.0�_)�selfrr�
<listcomp>fsz#screen.__init__.<locals>.<listcomp>)�rowsr"�encoding�encoding_errors�codecs�getincrementaldecoder�decoder�cur_r�cur_c�cur_saved_r�cur_saved_c�scroll_row_start�scroll_row_end�range�w)r%�r�cr(r)r)r%r�__init__Uszscreen.__init__cCs"|jdk	r|jj|�Std��dS)ztThis converts from the external coding system (as passed to
        the constructor) to the internal one (unicode). NzLThis screen was constructed with encoding=None, so it does not handle bytes.)r,�decode�	TypeError)r%�srrr�_decodehs
zscreen._decodecCsdjdd�|jD��S)z�This returns a printable representation of the screen as a unicode
        string (which, under Python 3.x, is the same as 'str'). The end of each
        screen line is terminated by a newline.�
cSsg|]}dj|��qS)�)�join)r#r6rrrr&vsz#screen._unicode.<locals>.<listcomp>)r>r4)r%rrr�_unicodeqszscreen._unicodecCs|jpd}|j�j|d�S)z{This returns a printable representation of the screen. The end of
            each screen line is terminated by a newline. �asciir)r(r?�encode)r%r(rrr�__str__}s
zscreen.__str__cCsdjdd�|jD��S)z�This returns a copy of the screen as a unicode string. This is similar to
        __str__/__unicode__ except that lines are not terminated with line
        feeds.r=cSsg|]}dj|��qS)r=)r>)r#r6rrrr&�szscreen.dump.<locals>.<listcomp>)r>r4)r%rrr�dump�szscreen.dumpcCs<dd|jd}|djdd�t|�jd�D��d|S)z�This returns a copy of the screen as a unicode string with an ASCII
        text box around the screen border. This is similar to
        __str__/__unicode__ except that it adds a box.�+�-z+
r<cSsg|]}d|d�qS)�|r)r#�linerrrr&�sz!screen.pretty.<locals>.<listcomp>)r"r>�unicode�split)r%Ztop_botrrr�pretty�sz
screen.prettycCs.t|t�r|j|�}|jdd|j|j|�dS)Nr )�
isinstance�bytesr;�fill_regionr'r")r%�chrrr�fill�s

zscreen.fillcCs�t|t�r|j|�}t|d|j�}t|d|j�}t|d|j�}t|d|j�}||kr^||}}||krp||}}x<t||d�D]*}x$t||d�D]}|j|||�q�Wq�WdS)Nr )rKrLr;rr'r"r3�put_abs)r%�rs�cs�re�cerNr5r6rrrrM�s



zscreen.fill_regioncCs|j|jd�dS)zKThis moves the cursor to the beginning (col 1) of the current row.
        r N)�cursor_homer-)r%rrr�cr�sz	screen.crcCs,|j}|j�||jkr(|j�|j�dS)z3This moves the cursor down with scrolling.
        N)r-�cursor_down�	scroll_up�
erase_line)r%�old_rrrr�lf�s

z	screen.lfcCs|j�|j�dS)ztThis advances the cursor with CRLF properties.
        The cursor will line wrap and the screen may scroll.
        N)rVr[)r%rrr�crlf�szscreen.crlfcCs|j�dS)z%This is an alias for crlf().
        N)r\)r%rrr�newline�szscreen.newlinecCsXt|d|j�}t|d|j�}t|t�r6|j|�d}n|d}||j|d|d<dS)zScreen array starts at 1 index.r rN)rr'r"rKrLr;r4)r%r5r6rNrrrrP�s
zscreen.put_abscCs*t|t�r|j|�}|j|j|j|�dS)z?This puts a characters at the current cursor position.
        N)rKrLr;rPr-r.)r%rNrrr�put�s

z
screen.putcCstt|t�r|j|�}t|d|j�}t|d|j�}x0t|j|d�D]}|j|||j||d��q@W|j|||�dS)z�This inserts a character at (r,c). Everything under
        and to the right is shifted right one character.
        The last character of the line is lost.
        r N���)	rKrLr;rr'r"r3rP�get_abs)r%r5r6rNZcirrr�
insert_abs�s

zscreen.insert_abscCs*t|t�r|j|�}|j|j|j|�dS)N)rKrLr;rar-r.)r%rNrrr�insert�s

z
screen.insertcCs2t|d|j�}t|d|j�}|j|d|dS)Nr )rr'r"r4)r%r5r6rrrr`�szscreen.get_abscCs|j|j|j�dS)N)r`r-r.)r%rrr�get�sz
screen.getc
Cs�t|d|j�}t|d|j�}t|d|j�}t|d|j�}||krJ||}}||kr\||}}g}xPt||d�D]>}d}x*t||d�D]}|j||�}	||	}q�W|j|�qpW|S)z>This returns a list of lines representing the region.
        r r=)rr'r"r3r`�append)
r%rQrRrSrTZscr5rGr6rNrrr�
get_region�s 

zscreen.get_regioncCs(t|jd|j�|_t|jd|j�|_dS)z6This keeps the cursor within the screen area.
        r N)rr-r'r.r")r%rrr�cursor_constrainszscreen.cursor_constrainr cCs||_||_|j�dS)N)r-r.rf)r%r5r6rrrrUszscreen.cursor_homecCs|j||_|j�dS)N)r.rf)r%�countrrr�cursor_backszscreen.cursor_backcCs|j||_|j�dS)N)r-rf)r%rgrrrrW#szscreen.cursor_downcCs|j||_|j�dS)N)r.rf)r%rgrrr�cursor_forward(szscreen.cursor_forwardcCs|j||_|j�dS)N)r-rf)r%rgrrr�	cursor_up-szscreen.cursor_upcCs$|j}|j�||jkr |j�dS)N)r-rjrX)r%rZrrr�cursor_up_reverse2s
zscreen.cursor_up_reversecCs|j||�dS)zIdentical to Cursor Home.N)rU)r%r5r6rrr�cursor_force_position9szscreen.cursor_force_positioncCs|j�dS)zSave current cursor position.N)�cursor_save_attrs)r%rrr�cursor_save>szscreen.cursor_savecCs|j�dS)z-Restores cursor position after a Save Cursor.N)�cursor_restore_attrs)r%rrr�
cursor_unsaveCszscreen.cursor_unsavecCs|j|_|j|_dS)zSave current cursor position.N)r-r/r.r0)r%rrrrmHszscreen.cursor_save_attrscCs|j|j|j�dS)z-Restores cursor position after a Save Cursor.N)rUr/r0)r%rrrroNszscreen.cursor_restore_attrscCs(|jdkrd|_|j|jkr$|j|_dS)z6This keeps the scroll region within the screen region.rr N)r1r2r')r%rrr�scroll_constrainSs
zscreen.scroll_constraincCsd|_|j|_dS)z$Enable scrolling for entire display.r N)r1r'r2)r%rrr�
scroll_screen[szscreen.scroll_screencCs||_||_|j�dS)z/Enable scrolling from row {start} to row {end}.N)r1r2rq)r%rQrSrrr�scroll_screen_rowsaszscreen.scroll_screen_rowscCs>|jd}|jd}tj|j||��|j|d|d�<dS)zScroll display down one line.r N)r1r2�copy�deepcopyr4)r%r:�errr�scroll_downhs

zscreen.scroll_downcCs>|jd}|jd}tj|j|d|d��|j||�<dS)zScroll display up one line.r N)r1r2rtrur4)r%r:rvrrrrXps

zscreen.scroll_upcCs|j|j|j|j|j�dS)zOErases from the current cursor position to the end of the current
        line.N)rMr-r.r")r%rrr�erase_end_of_linexszscreen.erase_end_of_linecCs|j|jd|j|j�dS)zQErases from the current cursor position to the start of the current
        line.r N)rMr-r.)r%rrr�erase_start_of_line~szscreen.erase_start_of_linecCs|j|jd|j|j�dS)zErases the entire current line.r N)rMr-r")r%rrrrY�szscreen.erase_linecCs&|j�|j|jdd|j|j�dS)zQErases the screen from the current line down to the bottom of the
        screen.r N)rxrMr-r'r")r%rrr�
erase_down�szscreen.erase_downcCs$|j�|j|jddd|j�dS)zLErases the screen from the current line up to the top of the
        screen.r N)ryrMr-r")r%rrr�erase_up�szscreen.erase_upcCs|j�dS)z,Erases the screen with the background color.N)rO)r%rrr�erase_screen�szscreen.erase_screencCsdS)z#Sets a tab at the current position.Nr)r%rrr�set_tab�szscreen.set_tabcCsdS)z#Clears tab at the current position.Nr)r%rrr�	clear_tab�szscreen.clear_tabcCsdS)zClears all tabs.Nr)r%rrr�clear_all_tabs�szscreen.clear_all_tabsN)rrrr)r r )r )r )r )r )4�__name__�
__module__�__qualname__�__doc__r7r;r?�PY3rBZ__unicode__rCrJr!rOrMrVr[r\r]rPr^rarbr`rcrerfrUrhrWrirjrkrlrnrprmrorqrrrsrwrXrxryrYrzr{r|r}r~rrrrrrFsb
	
	




r)r�r*rt�sys�warnings�warnZNULZENQZBELZBSZHTZLFZVTZFFZCR�SOZSIZXONZXOFFZCANZSUBZESCZDELr!�version_infor��strrHrrrrrr�<module>s:

Filemanager

Name Type Size Permission Actions
ANSI.cpython-36.opt-1.pyc File 10.01 KB 0644
ANSI.cpython-36.pyc File 10.01 KB 0644
FSM.cpython-36.opt-1.pyc File 12.37 KB 0644
FSM.cpython-36.pyc File 12.37 KB 0644
__init__.cpython-36.opt-1.pyc File 3.84 KB 0644
__init__.cpython-36.pyc File 3.84 KB 0644
_async.cpython-36.opt-1.pyc File 2.62 KB 0644
_async.cpython-36.pyc File 2.62 KB 0644
exceptions.cpython-36.opt-1.pyc File 1.77 KB 0644
exceptions.cpython-36.pyc File 1.77 KB 0644
expect.cpython-36.opt-1.pyc File 7.73 KB 0644
expect.cpython-36.pyc File 7.73 KB 0644
fdpexpect.cpython-36.opt-1.pyc File 5.52 KB 0644
fdpexpect.cpython-36.pyc File 5.52 KB 0644
popen_spawn.cpython-36.opt-1.pyc File 4.91 KB 0644
popen_spawn.cpython-36.pyc File 4.91 KB 0644
pty_spawn.cpython-36.opt-1.pyc File 30.33 KB 0644
pty_spawn.cpython-36.pyc File 30.46 KB 0644
pxssh.cpython-36.opt-1.pyc File 13.12 KB 0644
pxssh.cpython-36.pyc File 13.12 KB 0644
replwrap.cpython-36.opt-1.pyc File 4.06 KB 0644
replwrap.cpython-36.pyc File 4.06 KB 0644
run.cpython-36.opt-1.pyc File 5.61 KB 0644
run.cpython-36.pyc File 5.61 KB 0644
screen.cpython-36.opt-1.pyc File 14.29 KB 0644
screen.cpython-36.pyc File 14.29 KB 0644
spawnbase.cpython-36.opt-1.pyc File 16.75 KB 0644
spawnbase.cpython-36.pyc File 16.75 KB 0644
utils.cpython-36.opt-1.pyc File 2.89 KB 0644
utils.cpython-36.pyc File 2.89 KB 0644