Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/conch/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/conch/__pycache__/recvline.cpython-310.pyc
o

�b�J�@s�UdZddlZddlmZddlmZddlmZmZddl	m
Z
ddlmZddl
mZiZeeefed	<Gd
d�d�Zeej�Gdd
�d
��ZGdd�d�ZGdd�dej�ZGdd�de�ZdS)z4
Basic line editing support.

@author: Jp Calderone
�N)�Dict)�implementer)�helper�insults)�Logger)�reflect)�	iterbytes�	_counterscsLeZdZdZdd�Zdef�fdd�Zdef�fdd�Z�fd	d
�Z�Z	S)�Loggingz�
    Wrapper which logs attribute lookups.

    This was useful in debugging something, I guess.  I forget what.
    It can probably be deleted or moved somewhere more appropriate.
    Nothing special going on here, really.
    cCsF||_t�|j�}t�|d�}|dt|<t|dt|�d�|_dS)Nr��-�w)	�originalr�qual�	__class__r	�get�open�str�_logFile)�selfr�key�count�r�8/usr/lib/python3/dist-packages/twisted/conch/recvline.py�__init__!s
zLogging.__init__�returnc�tt��d��S�Nr)r�super�__getattribute__�r�rrr�__str__(�zLogging.__str__crr)�reprrrr r!rr�__repr__+r#zLogging.__repr__cs0t��d�}t��d�}|�|d�t||�S)Nrr�
)rr�write�getattr)r�namer�logFiler!rrr.s
zLogging.__getattribute__)
�__name__�
__module__�__qualname__�__doc__rrr"r%r�
__classcell__rrr!rr
sr
c@s�eZdZdZdD]ZedZe�d�Zee�qdZ	dZ
dd�Zej
D]
Zed	eef�q#d
d�Zdd
�Zdd�Zdd�Zdd�Zdidd�Zdidd�Zdidd�Zdidd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z d/d0�Z!d1d2�Z"d3d4�Z#d5d6�Z$d7d8�Z%d9d:�Z&d;d<�Z'd=d>�Z(d?d@�Z)dAdB�Z*dCdD�Z+dEdF�Z,dGdH�Z-djdJdK�Z.dLdM�Z/dNdO�Z0dPdQ�Z1dRdS�Z2dTdU�Z3dVdW�Z4dXdY�Z5dZd[�Z6did\d]�Z7did^d_�Z8did`da�Z9dbdc�Z:ddde�Z;dfdg�Z<dhS)k�TransportSequencea_
    An L{ITerminalTransport} implementation which forwards calls to
    one or more other L{ITerminalTransport}s.

    This is a cheap way for servers to keep track of the state they
    expect the client to see, since all terminal manipulations can be
    send to the real client and to a terminal emulator that lives in
    the server process.
    )sUP_ARROWs
DOWN_ARROWsRIGHT_ARROWs
LEFT_ARROWsHOMEsINSERTsDELETEsENDsPGUPsPGDNsF1sF2sF3sF4sF5sF6sF7sF8sF9sF10sF11sF12s = object()�ascii�	�cGs|sJd��||_dS)Nz7Cannot construct a TransportSequence with no transports)�
transports)rr4rrrr`s
zTransportSequence.__init__zldef %s(self, *a, **kw):
    for tpt in self.transports:
        result = tpt.%s(*a, **kw)
    return result
cC�td��)Nz(Unimplemented: TransportSequence.getHost��NotImplementedErrorr rrr�getHosto�zTransportSequence.getHostcCr5)Nz(Unimplemented: TransportSequence.getPeerr6r rrr�getPeersr9zTransportSequence.getPeercCr5)Nz/Unimplemented: TransportSequence.loseConnectionr6r rrr�loseConnectionwr9z TransportSequence.loseConnectioncCr5)Nz&Unimplemented: TransportSequence.writer6�r�datarrrr'{r9zTransportSequence.writecCr5)Nz.Unimplemented: TransportSequence.writeSequencer6r<rrr�
writeSequencer9zTransportSequence.writeSequencercCr5)Nz)Unimplemented: TransportSequence.cursorUpr6�r�nrrr�cursorUp�r9zTransportSequence.cursorUpcCr5)Nz+Unimplemented: TransportSequence.cursorDownr6r?rrr�
cursorDown�r9zTransportSequence.cursorDowncCr5)Nz.Unimplemented: TransportSequence.cursorForwardr6r?rrr�
cursorForward�r9zTransportSequence.cursorForwardcCr5)Nz/Unimplemented: TransportSequence.cursorBackwardr6r?rrr�cursorBackward�r9z TransportSequence.cursorBackwardcCr5)Nz/Unimplemented: TransportSequence.cursorPositionr6)r�column�linerrr�cursorPosition�r9z TransportSequence.cursorPositioncCr5)Nz+Unimplemented: TransportSequence.cursorHomer6r rrr�
cursorHome�r9zTransportSequence.cursorHomecCr5)Nz&Unimplemented: TransportSequence.indexr6r rrr�index�r9zTransportSequence.indexcCr5)Nz-Unimplemented: TransportSequence.reverseIndexr6r rrr�reverseIndex�r9zTransportSequence.reverseIndexcCr5)Nz)Unimplemented: TransportSequence.nextLiner6r rrr�nextLine�r9zTransportSequence.nextLinecCr5)Nz+Unimplemented: TransportSequence.saveCursorr6r rrr�
saveCursor�r9zTransportSequence.saveCursorcCr5)Nz.Unimplemented: TransportSequence.restoreCursorr6r rrr�
restoreCursor�r9zTransportSequence.restoreCursorcCr5)Nz)Unimplemented: TransportSequence.setModesr6�r�modesrrr�setModes�r9zTransportSequence.setModescCr5)Nz+Unimplemented: TransportSequence.resetModesr6)r�moderrr�
resetModes�r9zTransportSequence.resetModescCr5)Nz0Unimplemented: TransportSequence.setPrivateModesr6rNrrr�setPrivateModes�r9z!TransportSequence.setPrivateModescCr5)Nz2Unimplemented: TransportSequence.resetPrivateModesr6rNrrr�resetPrivateModes�r9z#TransportSequence.resetPrivateModescCr5)Nz6Unimplemented: TransportSequence.applicationKeypadModer6r rrr�applicationKeypadMode���z'TransportSequence.applicationKeypadModecCr5)Nz2Unimplemented: TransportSequence.numericKeypadModer6r rrr�numericKeypadMode�r9z#TransportSequence.numericKeypadModecCr5)Nz3Unimplemented: TransportSequence.selectCharacterSetr6)r�charSet�whichrrr�selectCharacterSet�r9z$TransportSequence.selectCharacterSetcCr5)Nz(Unimplemented: TransportSequence.shiftInr6r rrr�shiftIn�r9zTransportSequence.shiftIncCr5)Nz)Unimplemented: TransportSequence.shiftOutr6r rrr�shiftOut�r9zTransportSequence.shiftOutcCr5)Nz-Unimplemented: TransportSequence.singleShift2r6r rrr�singleShift2�r9zTransportSequence.singleShift2cCr5)Nz-Unimplemented: TransportSequence.singleShift3r6r rrr�singleShift3�r9zTransportSequence.singleShift3cGr5)Nz7Unimplemented: TransportSequence.selectGraphicRenditionr6)r�
attributesrrr�selectGraphicRendition�rVz(TransportSequence.selectGraphicRenditioncCr5)Nz8Unimplemented: TransportSequence.horizontalTabulationSetr6r rrr�horizontalTabulationSet�rVz)TransportSequence.horizontalTabulationSetcCr5)Nz0Unimplemented: TransportSequence.tabulationClearr6r rrr�tabulationClear�r9z!TransportSequence.tabulationClearcCr5)Nz3Unimplemented: TransportSequence.tabulationClearAllr6r rrr�tabulationClearAll�r9z$TransportSequence.tabulationClearAllTcCr5)Nz1Unimplemented: TransportSequence.doubleHeightLiner6)r�toprrr�doubleHeightLine�r9z"TransportSequence.doubleHeightLinecCr5)Nz0Unimplemented: TransportSequence.singleWidthLiner6r rrr�singleWidthLine�r9z!TransportSequence.singleWidthLinecCr5)Nz0Unimplemented: TransportSequence.doubleWidthLiner6r rrr�doubleWidthLine�r9z!TransportSequence.doubleWidthLinecCr5)Nz/Unimplemented: TransportSequence.eraseToLineEndr6r rrr�eraseToLineEnd�r9z TransportSequence.eraseToLineEndcCr5)Nz5Unimplemented: TransportSequence.eraseToLineBeginningr6r rrr�eraseToLineBeginningrVz&TransportSequence.eraseToLineBeginningcCr5)Nz*Unimplemented: TransportSequence.eraseLiner6r rrr�	eraseLiner9zTransportSequence.eraseLinecCr5)Nz2Unimplemented: TransportSequence.eraseToDisplayEndr6r rrr�eraseToDisplayEndr9z#TransportSequence.eraseToDisplayEndcCr5)Nz8Unimplemented: TransportSequence.eraseToDisplayBeginningr6r rrr�eraseToDisplayBeginningrVz)TransportSequence.eraseToDisplayBeginningcCr5)Nz-Unimplemented: TransportSequence.eraseDisplayr6r rrr�eraseDisplayr9zTransportSequence.eraseDisplaycCr5)Nz0Unimplemented: TransportSequence.deleteCharacterr6r?rrr�deleteCharacterr9z!TransportSequence.deleteCharactercCr5)Nz+Unimplemented: TransportSequence.insertLiner6r?rrr�
insertLiner9zTransportSequence.insertLinecCr5)Nz+Unimplemented: TransportSequence.deleteLiner6r?rrr�
deleteLine!r9zTransportSequence.deleteLinecCr5)Nz5Unimplemented: TransportSequence.reportCursorPositionr6r rrr�reportCursorPosition%rVz&TransportSequence.reportCursorPositioncCr5)Nz&Unimplemented: TransportSequence.resetr6r rrr�reset+r9zTransportSequence.resetcCr5)Nz9Unimplemented: TransportSequence.unhandledControlSequencer6�r�seqrrr�unhandledControlSequence/rVz*TransportSequence.unhandledControlSequenceN)r)T)=r+r,r-r.�keyID�	execBytes�decode�execStr�exec�TAB�	BACKSPACErr�ITerminalTransport�methodr8r:r;r'r>rArBrCrDrGrHrIrJrKrLrMrPrRrSrTrUrWrZr[r\r]r^r`rarbrcrerfrgrhrirjrkrlrmrnrorprqrrrurrrrr05sz



��








r0cs.eZdZdZ�fdd�Zdefdd�Z�ZS)�LocalTerminalBufferMixina�
    A mixin for RecvLine subclasses which records the state of the terminal.

    This is accomplished by performing all L{ITerminalTransport} operations on both
    the transport passed to makeConnection and an instance of helper.TerminalBuffer.

    @ivar terminalCopy: A L{helper.TerminalBuffer} instance which efforts
    will be made to keep up to date with the actual terminal
    associated with this protocol instance.
    cs(t��|_|j��t��t||j��S�N)r�TerminalBuffer�terminalCopy�connectionMader�makeConnectionr0)r�	transportr!rrr�Bs

z'LocalTerminalBufferMixin.makeConnectionrcCs
t|j�Sr�)rr�r rrrr"Gs
z LocalTerminalBufferMixin.__str__)r+r,r-r.r�rr"r/rrr!rr6src@s�eZdZdZdZdZdZdZdZe	j
�d�Ze
�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Z d,d-�Z!d.d/�Z"d0S)1�RecvLinea�
    L{TerminalProtocol} which adds line editing features.

    Clients will be prompted for lines of input with all the usual
    features: character echoing, left and right arrow support for
    moving the cursor to different areas of the line buffer, backspace
    and delete for removing characters, and insert for toggling
    between typeover and insert mode.  Tabs will be expanded to enough
    spaces to move the cursor to the next tabstop (every four
    characters by default).  Enter causes the line buffer to be
    cleared and the line to be passed to the lineReceived() method
    which, by default, does nothing.  Subclasses are responsible for
    redrawing the input prompt (this will probably change).
    �P��)s>>> s... rr1cCspg|_d|_|j}|j|j|j|j|j|jd|j	d|j	|j
|j|j|j
|j|j|j|j|j|ji
|_|��dS)Nr�
�
)�
lineBuffer�lineBufferIndex�terminal�
LEFT_ARROW�handle_LEFT�RIGHT_ARROW�handle_RIGHTr{�
handle_TAB�
handle_RETURNr|�handle_BACKSPACE�DELETE�
handle_DELETE�INSERT�
handle_INSERT�HOME�handle_HOME�END�
handle_END�keyHandlers�initializeScreen�r�trrrr�fs�zRecvLine.connectionMadecCs*|j��|j�|j|j�|��dSr�)r�rrr'�ps�pn�
setInsertModer rrrr��s

zRecvLine.initializeScreencCs(d�|j�}|d|j�||jd�fS�N�)�joinr�r�)r�srrr�currentLineBuffer�szRecvLine.currentLineBuffercC�d|_|j�tjjg�dS)N�insert)rQr�rPrrO�IRMr rrrr���zRecvLine.setInsertModecCr�)N�typeover)rQr�rRrrOr�r rrr�setTypeoverMode�r�zRecvLine.setTypeoverModecCs$|j�|j|jd�|j��dS)z�
        Write a line containing the current input prompt and the current line
        buffer at the current cursor position.
        r�N)r�r'r�r�r�r�r rrr�
drawInputLine�s$zRecvLine.drawInputLinecCs,|j��|j��||_||_|��dSr�)r�rmrH�width�heightr�)rr�r�rrr�terminalSize�s


zRecvLine.terminalSizecC�dSr�rrsrrrru��z!RecvLine.unhandledControlSequencecCsL|j�|�}|dur|�dS||jvr|�|d�dS|jjd|d�dS)NFz#Received unhandled keyID: {keyID!r})rv)r�r�_printableChars�characterReceived�_log�warn)rrv�modifier�mrrr�keystrokeReceived�s

zRecvLine.keystrokeReceivedcCsR|jdkr|j�|j|�n|g|j|j|jd�<|jd7_|j�|�dS)Nr�r)rQr�r�r�r�r')r�ch�moreCharactersComingrrrr��s

zRecvLine.characterReceivedcCsH|jt|j�|j}|j�|�|j|7_|j�td|��dS)N� )�TABSTOP�lenr�r�rCr��extendrr?rrrr��szRecvLine.handle_TABcCs*|jdkr|jd8_|j��dSdS�Nrr�r�r�rDr rrrr��s
�zRecvLine.handle_LEFTcCs0|jt|j�kr|jd7_|j��dSdS)Nr)r�r�r�r�rCr rrrr��s�zRecvLine.handle_RIGHTcCs"|jr|j�|j�d|_dSdS�Nrr�r rrrr��s
�zRecvLine.handle_HOMEcCs4t|j�|j}|r|j�|�t|j�|_dSdSr�)r�r�r�r�rC)r�offsetrrrr��s
�zRecvLine.handle_ENDcCs>|jdkr|jd8_|j|j=|j��|j��dSdSr�)r�r�r�rDrnr rrrr��s


�zRecvLine.handle_BACKSPACEcCs,|jt|j�kr|j|j=|j��dSdSr�)r�r�r�r�rnr rrrr��s
�zRecvLine.handle_DELETEcCs0d�|j�}g|_d|_|j��|�|�dS)Nr�r)r�r�r�r�rK�lineReceived�rrFrrrr��s

zRecvLine.handle_RETURNcCs0|jdvsJ�|jdkr|��dS|��dS)N)r�r�r�)rQr�r�r rrrr��s
zRecvLine.handle_INSERTcCr�r�rr�rrrr��r�zRecvLine.lineReceivedN)#r+r,r-r.r�r�r�r�r��string�	printable�encoder�rr�r�r�r�r�r�r�r�rur�r�r�r�r�r�r�r�r�r�r�r�rrrrr�Ks:		r�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�HistoricRecvLinea;
    L{TerminalProtocol} which adds both basic line-editing features and input history.

    Everything supported by L{RecvLine} is also supported by this class.  In addition, the
    up and down arrows traverse the input history.  Each received line is automatically
    added to the end of the input history.
    cCs<t�|�g|_d|_|j}|j�|j|j|j	|j
i�dSr�)r�r��historyLines�historyPositionr�r��update�UP_ARROW�	handle_UP�
DOWN_ARROW�handle_DOWNr�rrrr�s
�zHistoricRecvLine.connectionMadecCs&t|j�}|d|j�||jd�fSr�)�tupler�r�)r�brrr�currentHistoryBuffers
z%HistoricRecvLine.currentHistoryBuffercCsB|rt|dd��D]}|�|d�q
|�|dd�d�dSdS)N���TF)rr�)r�bufr�rrr�_deliverBuffers
�zHistoricRecvLine._deliverBuffercCst|jr|jt|j�kr|j�d�|j��|jdkr8|��|j��|jd8_g|_|�	|j|j�dSdS)Nr�rr)
r�r�r�r��appendr�r�r�rhr�r rrrr�s

�zHistoricRecvLine.handle_UPcCs~|jt|j�dkr(|��|j��|jd7_g|_|�|j|j�dS|��|j��t|j�|_g|_d|_dS)Nrr)	r�r�r�r�r�rhr�r�r�r rrrr�$s


zHistoricRecvLine.handle_DOWNcCs0|jr
|j�d�|j��t|j�|_t�|�Sr�)r�r�r�r�r�r�r�r�r rrrr�5s
zHistoricRecvLine.handle_RETURNN)
r+r,r-r.r�r�r�r�r�r�rrrrr��sr�)r.r��typingr�zope.interfacer�twisted.conch.insultsrr�twisted.loggerr�twisted.pythonr�twisted.python.compatrr	r�int�__annotations__r
r}r0r�TerminalProtocolr�r�rrrr�<module>s$0

Spamworldpro Mini