Ϫf/>dZddlmZmZddlmZmZmZddl m Z m Z GddeZ ee GddZ Gd d ejZd Zd d iZGddZGddZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!Gdd Z"d!Z#d"Z$Gd#d$Z%e$Dcgc]}e%|jMc}Z'eeGd%d&ejPZ)e*e$e'D]\Z+Z,e-e)e+e,Gd'd(ejPZ.gd)Z/y*cc}w)+z? VT102 and VT220 terminal manipulation. @author: Jp Calderone ) Interface implementer)defer interfacesprotocol) iterbytes networkStringc*eZdZdZdZdZdZdZy)ITerminalProtocolcy)zX Called with an L{ITerminalTransport} when a connection is established. N) transports ?/usr/lib/python3/dist-packages/twisted/conch/insults/insults.pymakeConnectionz ITerminalProtocol.makeConnectioncy)a` A keystroke was received. Each keystroke corresponds to one invocation of this method. keyID is a string identifier for that key. Printable characters are represented by themselves. Control keys, such as arrows and function keys, are represented with symbolic constants on L{ServerProtocol}. Nr )keyIDmodifiers rkeystrokeReceivedz#ITerminalProtocol.keystrokeReceivedrrcy)z Called to indicate the size of the terminal. A terminal of 80x24 should be assumed if this method is not called. This method might not be called for real terminals. Nr )widthheights r terminalSizezITerminalProtocol.terminalSize"rrcyz Called when an unsupported control sequence is received. @type seq: L{str} @param seq: The whole control sequence which could not be interpreted. Nr seqs runhandledControlSequencez*ITerminalProtocol.unhandledControlSequence*rrcy)zh Called when the connection has been lost. reason is a Failure describing why. Nr )reasons rconnectionLostz ITerminalProtocol.connectionLost2rrN)__name__ __module__ __qualname__rrrrr"r rrr r s     rr c0eZdZdZdZdZdZdZdZy)TerminalProtocolc2||_|jyN)terminalconnectionMade)selfr*s rrzTerminalProtocol.makeConnection<s   rcy)zA Called after a connection has been established. Nr r,s rr+zTerminalProtocol.connectionMadeArrcyr)r )r,rrs rrz"TerminalProtocol.keystrokeReceivedF rcyr)r )r,rrs rrzTerminalProtocol.terminalSizeIr0rcyr)r )r,rs rrz)TerminalProtocol.unhandledControlSequenceLr0rcyr)r r,r!s rr"zTerminalProtocol.connectionLostOr0rN) r#r$r%rr+rrrr"r rrr'r':s       rr'ceZdZd+dZd+dZd+dZd+dZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZd,dZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d+d$Z&d+d%Z'd+d&Z(d'Z)d(Z*d)Z+y*)-ITerminalTransportcy)z- Move the cursor up n lines. Nr ns rcursorUpzITerminalTransport.cursorUpTrrcy)z/ Move the cursor down n lines. Nr r8s r cursorDownzITerminalTransport.cursorDownYrrcy)z2 Move the cursor right n columns. Nr r8s r cursorForwardz ITerminalTransport.cursorForward^rrcy)z1 Move the cursor left n columns. Nr r8s rcursorBackwardz!ITerminalTransport.cursorBackwardcrrcy)z? Move the cursor to the given line and column. Nr )columnlines rcursorPositionz!ITerminalTransport.cursorPositionhrrcy)z' Move the cursor home. Nr r rr cursorHomezITerminalTransport.cursorHomemrrcy)zS Move the cursor down one line, performing scrolling if necessary. Nr r rrindexzITerminalTransport.indexrrrcy)zQ Move the cursor up one line, performing scrolling if necessary. Nr r rr reverseIndexzITerminalTransport.reverseIndexwrrcy)zl Move the cursor to the first position on the next line, performing scrolling if necessary. Nr r rrnextLinezITerminalTransport.nextLine|rrcy)zj Save the cursor position, character attribute, character set, and origin mode selection. Nr r rr saveCursorzITerminalTransport.saveCursorrrcy)z Restore the previously saved cursor position, character attribute, character set, and origin mode selection. If no cursor state was previously saved, move the cursor to the home position. Nr r rr restoreCursorz ITerminalTransport.restoreCursorrrcy)z6 Set the given modes on the terminal. Nr modess rsetModeszITerminalTransport.setModesrrcy)z8 Reset the given modes on the terminal. Nr )modes r resetModeszITerminalTransport.resetModesrrcy)zB Set the given DEC private modes on the terminal. Nr rRs rsetPrivateModesz"ITerminalTransport.setPrivateModesrrcy)zD Reset the given DEC private modes on the terminal. Nr rRs rresetPrivateModesz$ITerminalTransport.resetPrivateModesrrcy)z Cause keypad to generate control functions. Cursor key mode selects the type of characters generated by cursor keys. Nr r rrapplicationKeypadModez(ITerminalTransport.applicationKeypadModerrcy)z= Cause keypad to generate normal characters. Nr r rrnumericKeypadModez$ITerminalTransport.numericKeypadModerrcy)z Select a character set. charSet should be one of CS_US, CS_UK, CS_DRAWING, CS_ALTERNATE, or CS_ALTERNATE_SPECIAL. which should be one of G0 or G1. Nr )charSetwhichs rselectCharacterSetz%ITerminalTransport.selectCharacterSetrrcy)z0 Activate the G0 character set. Nr r rrshiftInzITerminalTransport.shiftInrrcy)z0 Activate the G1 character set. Nr r rrshiftOutzITerminalTransport.shiftOutrrcy)zG Shift to the G2 character set for a single character. Nr r rr singleShift2zITerminalTransport.singleShift2rrcy)zG Shift to the G3 character set for a single character. Nr r rr singleShift3zITerminalTransport.singleShift3rrcy)z Enabled one or more character attributes. Arguments should be one or more of UNDERLINE, REVERSE_VIDEO, BLINK, or BOLD. NORMAL may also be specified to disable all character attributes. Nr ) attributess rselectGraphicRenditionz)ITerminalTransport.selectGraphicRenditionrrcy)z@ Set a tab stop at the current cursor position. Nr r rrhorizontalTabulationSetz*ITerminalTransport.horizontalTabulationSetrrcy)zD Clear the tab stop at the current cursor position. Nr r rrtabulationClearz"ITerminalTransport.tabulationClearrrcy)z& Clear all tab stops. Nr r rrtabulationClearAllz%ITerminalTransport.tabulationClearAllrrcy)z Make the current line the top or bottom half of a double-height, double-width line. If top is True, the current line is the top half. Otherwise, it is the bottom half. Nr )tops rdoubleHeightLinez#ITerminalTransport.doubleHeightLinerrcy)zK Make the current line a single-width, single-height line. Nr r rrsingleWidthLinez"ITerminalTransport.singleWidthLinerrcy)z< Make the current line a double-width line. Nr r rrdoubleWidthLinez"ITerminalTransport.doubleWidthLinerrcy)zV Erase from the cursor to the end of line, including cursor position. Nr r rreraseToLineEndz!ITerminalTransport.eraseToLineEndrrcy)zd Erase from the cursor to the beginning of the line, including the cursor position. Nr r rreraseToLineBeginningz'ITerminalTransport.eraseToLineBeginningrrcy)z/ Erase the entire cursor line. Nr r rr eraseLinezITerminalTransport.eraseLinerrcy)za Erase from the cursor to the end of the display, including the cursor position. Nr r rreraseToDisplayEndz$ITerminalTransport.eraseToDisplayEndrrcy)zg Erase from the cursor to the beginning of the display, including the cursor position. Nr r rreraseToDisplayBeginningz*ITerminalTransport.eraseToDisplayBeginningrrcy)z+ Erase the entire display. Nr r rr eraseDisplayzITerminalTransport.eraseDisplay rrcy)z Delete n characters starting at the cursor position. Characters to the right of deleted characters are shifted to the left. Nr r8s rdeleteCharacterz"ITerminalTransport.deleteCharacterrrcy)z Insert n lines at the cursor position. Lines below the cursor are shifted down. Lines moved past the bottom margin are lost. This command is ignored when the cursor is outside the scroll region. Nr r8s r insertLinezITerminalTransport.insertLinerrcy)z Delete n lines starting at the cursor position. Lines below the cursor are shifted up. This command is ignored when the cursor is outside the scroll region. Nr r8s r deleteLinezITerminalTransport.deleteLine rrcy)zi Return a Deferred that fires with a two-tuple of (x, y) indicating the cursor position. Nr r rrreportCursorPositionz'ITerminalTransport.reportCursorPosition(rrcy)z: Reset the terminal to its initial state. Nr r rrresetzITerminalTransport.reset-rrcyrr rs rrz+ITerminalTransport.unhandledControlSequence2rrNT),r#r$r%r:r<r>r@rDrFrHrJrLrNrPrTrWrYr[r]r_rcrergrirkrnrprrrtrwryr{r}rrrrrrrrrrrr rrr6r6Ss                                         rr6~stildec(eZdZdZdxZZdxZZdxZZ y)rSz$ ECMA 48 standardized modes N) r#r$r%__doc__KEYBOARD_ACTIONKAMINSERTION_REPLACEMENTIRMLINEFEED_NEWLINELNMr rrrSrS?s- Oc#$#C srrSc@eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd Zy) privateModesz' ANSI-Compatible Private Modes rrrrN)r#r$r%rERROR CURSOR_KEY ANSI_VT52COLUMNSCROLLSCREENORIGIN AUTO_WRAP AUTO_REPEATPRINTER_FORM_FEEDPRINTER_EXTENT CURSOR_MODEr rrrr[sH EJI F F F FIKNKrrsCS_USsCS_UKs CS_DRAWINGs CS_ALTERNATEsCS_ALTERNATE_SPECIALsG0sG1sG2sG3rrrrceZdZdZy)Vectorc ||_||_yr))xy)r,rrs r__init__zVector.__init__srN)r#r$r%rr rrrrsrrctdd5}|jt|dzdddy#1swYyxYw)Nloga )openwritestr)sfs rrrs7 eS Q A s4=)UP_ARROW DOWN_ARROW RIGHT_ARROW LEFT_ARROWHOMEINSERTDELETEENDPGUPPGDN NUMPAD_MIDDLEF1F2F3F4F5F6F7F8F9F10F11F12ALTSHIFTCONTROLc8eZdZdZdeddfdZdefdZdefdZy)_constz3 @ivar name: A string naming this constant namereturnNc||_yr)r)r,rs rrz_const.__init__s  rc&d|jzdzS)N[]rr.s r__repr__z_const.__repr__sTYY$$rcDd|jzdzjdS)Nrrascii)rencoder.s r __bytes__z_const.__bytes__s dii#%--g66r) r#r$r%rrrrbytesrr rrrrs2ST%#%757rrceZdZdZdZdZdZdZdZe ddZ e ddZ dZ dZ dBd Zd Zd Zd Zd ZdZdZdZdZGddZeZdCdZdCdZdCdZdCdZdZdZdZdZ dZ!dZ"dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-d)Z.d*Z/d+Z0d,Z1d-Z2dDd.Z3d/Z4d0Z5d1Z6d2Z7d3Z8d4Z9d5Z:d6Z;dCd7ZdEd:Z?d;Z@d<ZAd=ZBd>ZCd?ZDd@ZEdAZFy)FServerProtocolN rdataPrc@|||_||_||_g|_y)a @param protocolFactory: A callable which will be invoked with *a, **kw and should return an ITerminalProtocol implementor. This will be invoked when a connection to this ServerProtocol is established. @param a: Any positional arguments to pass to protocolFactory. @param kw: Any keyword arguments to pass to protocolFactory. N)protocolFactory protocolArgsprotocolKwArgs_cursorReports)r,rrkws rrzServerProtocol.__init__s*  D   rctd)Nz%Unimplemented: ServerProtocol.getHostNotImplementedErrorr.s rgetHostzServerProtocol.getHost!"IJJrctd)Nz%Unimplemented: ServerProtocol.getPeerrr.s rgetPeerzServerProtocol.getPeerrrc|je|j|ji|j|_ |j}||j_|jj |yy#t $rY(wxYwr))rrrterminalProtocolfactoryAttributeErrorr)r,rs rr+zServerProtocol.connectionMades    +$8D$8$8""%&*&9&9%D ! 8,,18%%-  ! ! 0 0 6 ,"  s A33 A?>A?ct|D]<}|jdk(r*|dk(rd|_ |jj|d=|jdk(r:|dk(rd|_g|_`|dk(rd|_md|_|j ||jdk(rv|dk(rd|_|j s|dk(r7|jd j|j|z|`d|_|jj| |jdk(r|j|d|_4td y) Nrrescaped[sbracket-escapedOslow-function-escapedrr Illegal state) rstaterrescBuf_handleShortControlSequenceisalpha_handleControlSequencejoinappend!_handleLowFunctionControlSequence ValueError)r,datachs r dataReceivedzServerProtocol.dataReceivedsD/ 2BzzW$=!+DJ));;BEz):!3DJ"$DK4Z!8DJ!(DJ44R811:!8DJZZ\R4Z//0E0JK !(DJKK&&r*6666r:$  119 2rcP|jj||jyr))rrr)r,rs rrz*ServerProtocol._handleShortControlSequence!s //DHH=rc d|z}t|jtj|dd|ddj dd}||j |y|||j |ddy)N)getattrcontrolSequenceParserCSTgetdecoderr)r,bufrs rrz%ServerProtocol._handleControlSequence$ssn   & & GGCHc"#h ' . .w 7   9  ) )# . dD))3s8 4rc:|jj|yr))rr)r,r#s rrz'ServerProtocol.unhandledControlSequence0s 66s;rc|j|j|j|jd}|j |}||j j |dy|j jd|zy)N)PQRSs)rrrrr!rrr)r,r functionKeysrs rrz0ServerProtocol._handleLowFunctionControlSequence3sd"ggTWWDGG477S   $    ! ! 3 3E4 @  ! ! : :9r> JrcHeZdZdZdZdZdZdZdZdZ dZ d Z d Z y ) $ServerProtocol.ControlSequenceParsercp|dk(r|j|jdy|j|dzy)NrA)rrrr,protohandlerr#s rAz&ServerProtocol.ControlSequenceParser.A<s/h))%..$?00tzServerProtocol.cursorForwardrlrc|dk\sJt|jj|z d|j_|jd|fzy)Nrrs[%dD)rdrerrrfs rr@zServerProtocol.cursorBackwardrgrc<|jd|dz|dzfzy)Ns[%d;%dHrr)r,rBrCs rrDzServerProtocol.cursorPositions  >TAXvz$::;rcjdx|j_|j_|jdy)Nrs)rerrrr.s rrFzServerProtocol.cursorHomes&.//4>>+ 9rct|jjdz|jjdz |j_|j dy)NrsDrir.s rrHzServerProtocol.indexs=t~~//!3T]]__q5HI 8rct|jjdz d|j_|jdy)NrrsMrcr.s rrJzServerProtocol.reverseIndexs0t~~//!3Q7 8rcd|j_t|jjdz|jjdz |j_|j dy)Nrr )rerrjrrkrr.s rrLzServerProtocol.nextLinesIt~~//!3T]]__q5HI 5rct|jj|jj|_|j dy)Ns7)rrerr_savedCursorPosrr.s rrNzServerProtocol.saveCursors1%dnn&6&68H8HI 8rcL|j|_|`|jdy)Ns8)rwrerr.s rrPzServerProtocol.restoreCursors!--   8rcbdjd|D}|jd|zdzy)NrGc3(K|] }d|fz yw%dNr .0rVs r z*ServerProtocol.setModes..A4uwArhrrr,rS modesBytess rrTzServerProtocol.setModes,YYA5AA  8j(4/0rcbdjd|D}|jd|zdzy)NrGc3(K|] }d|fz ywr{r r}s rrz1ServerProtocol.setPrivateModes..rr[?rrrs rrYzServerProtocol.setPrivateModes,YYA5AA  9z)D01rcbdjd|D}|jd|zdzy)NrGc3(K|] }d|fz ywr{r r}s rrz,ServerProtocol.resetModes..rrrlrrs rrWzServerProtocol.resetModesrrcbdjd|D}|jd|zdzy)NrGc3(K|] }d|fz ywr{r r}s rrz3ServerProtocol.resetPrivateModes..rrrrrrs rr[z ServerProtocol.resetPrivateModesrrc&|jdy)Ns=rpr.s rr]z$ServerProtocol.applicationKeypadMode 8rc&|jdy)Ns>rpr.s rr_z ServerProtocol.numericKeypadModerrc|tk(rd}n|tk(rd}n td|tk(rd}n;|tk(rd}n/|t k(rd}n#|t k(rd}n|tk(rd}n td |jd |z|zy) N()z7`which' argument to selectCharacterSet must be G0 or G1r.r4012z0Invalid `charSet' argument to selectCharacterSetr) G0G1rCS_UKCS_US CS_DRAWING CS_ALTERNATECS_ALTERNATE_SPECIALr)r,rarbs rrcz!ServerProtocol.selectCharacterSets B;E b[EVW W e G  G  "G  $G , ,GOP P 7U?W,-rc&|jdy)Nrpr.s rrezServerProtocol.shiftIn 7rc&|jdy)Nrpr.s rrgzServerProtocol.shiftOutrrc&|jdy)NsNrpr.s rrizServerProtocol.singleShift2 rrc&|jdy)NsOrpr.s rrkzServerProtocol.singleShift3 rrcg}|D]}|jt||jddj|zdzy)NrrGm)rr rr)r,rmattrsrs rrnz%ServerProtocol.selectGraphicRenditionsF +A LLq) * + 8dii..56rc&|jdy)NsHrpr.s rrpz&ServerProtocol.horizontalTabulationSetrrc&|jdy)Nsrpr.s rrrzServerProtocol.tabulationClear 9rc&|jdy)Nsrpr.s rrtz!ServerProtocol.tabulationClearAll :rcN|r|jdy|jdy)Ns#3s#4rp)r,rvs rrwzServerProtocol.doubleHeightLine s  JJy ! JJy !rc&|jdy)Ns#5rpr.s rryzServerProtocol.singleWidthLine&rrc&|jdy)Ns#6rpr.s rr{zServerProtocol.doubleWidthLine)rrc&|jdy)Nsrpr.s rr}zServerProtocol.eraseToLineEnd,rrc&|jdy)Nsrpr.s rrz#ServerProtocol.eraseToLineBeginning/rrc&|jdy)Nsrpr.s rrzServerProtocol.eraseLine2rrc&|jdy)Nsrpr.s rrz ServerProtocol.eraseToDisplayEnd5rrc&|jdy)Nsrpr.s rrz&ServerProtocol.eraseToDisplayBeginning8rrc&|jdy)Nsrpr.s rrzServerProtocol.eraseDisplay;rrc.|jd|fzy)Ns[%dPrprfs rrzServerProtocol.deleteCharacter> ;!%&rc.|jd|fzy)Ns[%dLrprfs rrzServerProtocol.insertLineArrc.|jd|fzy)Ns[%dMrprfs rrzServerProtocol.deleteLineDrrc\|d|fz}nd}|d|fz}nd}|jd||fzy)Nr|rs[%b;%brrp)r,firstlasts rsetScrollRegionzServerProtocol.setScrollRegionGsD  UH$EE  D7?DD >UDM12rc$|jyr))rr.s rresetScrollRegionz ServerProtocol.resetScrollRegionRs rctj}|jj||j d|S)Ns)rDeferredrrr)r,rRs rrz#ServerProtocol.reportCursorPositionUs3 NN  ""1% :rcdx|j_|j_ |`|j dy#t$rYwxYw)Nrsc)rerrrwrrr.s rrzServerProtocol.reset[sG.//4>>+ $ 8   s8 AAc|rbt|ts|jd}||_|jj dj |jdyy)Nzutf-8s ru) isinstancerr lastWriterrrrIr,rs rrzServerProtocol.writedsM dE*{{7+!DN NN djj.?!@ A rcD|jdj|y)Nr)rrrs r writeSequencezServerProtocol.writeSequenceks 388D>"rcX|j|jjyr))rrloseConnectionr.s rrzServerProtocol.loseConnectionns  %%'rc||j$ |jj|d|_yy#d|_wxYwr))rr"r4s rr"zServerProtocol.connectionLostrs@  , -%%44V<(,% -)-%s2 ;r)rr)NN)Gr#r$r%rrrV BACKSPACErrrrkre scrollRegionrrrrr+rrrrrrarr:r<r>r@rDrFrHrJrLrNrPrTrYrWr[r]r_rcrergrirkrnrprrrtrwryr{r}rrrrrrrrrrrrrrrr"r rrrrstO CII Eb"~Hq! ILG!$KK 72>> 5<Kd=d=L23' ' ' ' <   1 21 2.,7" ''' 3 B#(-rrc eZdZdZdZdZdZddddddd d d d d d ZdddddZe e e e e dZdZddZdZdZdZdZGddZeZdZy)ClientProtocolNrsindexs reverseIndexsnextLines saveCursors restoreCursorsapplicationKeypadModesnumericKeypadModes singleShift2s singleShift3shorizontalTabulationSetsreset) r;Mr>78=>Nr rDcbracket-escape select-g0 select-g1select-height-width)r rr#)r.r4rrrc2|||_||_||_y)aw @param terminalFactory: A callable which will be invoked with *a, **kw and should return an ITerminalTransport provider. This will be invoked when this ClientProtocol establishes a connection. @param a: Any positional arguments to pass to terminalFactory. @param kw: Any keyword arguments to pass to terminalFactory. N)terminalFactory terminalArgsterminalKwArgs)r,rrrs rrzClientProtocol.__init__s"  D  rc|jb|j|ji|j|_|j|j_|jj |yyr))rrrr*rrr.s rr+zClientProtocol.connectionMadesb    +0D00""&*&9&9DM%)LLDMM ! MM ( ( . ,rch|j |jj||`yy#|`wxYwr))r*r"r4s rr"zClientProtocol.connectionLosts6 == $ " ,,V4M %Ms-1cHg}t|D]d}|jdk(rE|dk(r9|r/|jjdj ||dd=d|_R|dk(rL|r/|jjdj ||dd=|jj |dk(rL|r/|jjdj ||dd=|jj |dk(rM|r/|jjdj ||dd=|jjF|j|Y|jdk(r|jj|}|3d|_t|j|jd |jj|}| ||_|jjd|zd|_|jd k(r{|jg|_|j!s|d k(r6|j#dj |j||`d|_r|jj||jd k(rC|jj%|j&j||t(d|_|jd k(rC|jj%|j&j||t*d|_3|jdk(r|j-|d|_\t/d|r+|jjdj |yy)z Parse the given data from a terminal server, dispatching to event handlers defined by C{self.terminal}. rrrNr rrrrrrrrr )rrr*rrrgrer@r_shortsr!rr"_longsr_escBufrrrc _charsetsrr_handleHeightWidthr)r,rtoWritebfNamers rrzClientProtocol.dataReceiveds 47 2AzzW$< ++CHHW,=>#AJ!+DJ'\ ++CHHW,=>#AJMM**,'\ ++CHHW,=>#AJMM))+'\ ++CHHW,=>#AJMM002NN1%z) ((+$!(DJAGDMM5<<+@AC KKOOA.E(%*  >>w{K%, 00<<'#%DL99;!t)//0FJ !(DJLL''*|+ 001C1CAq1I2N$ |+ 001C1CAq1I2N$ 55''*$  11o7 2p  MM   1 2 rct|jtj||j dd}|"|j j d|z|zy|||j |y)Nrr)rrr r!r"r*r)r,r#r*rs rrz%ClientProtocol._handleControlSequencesc   & & GGHh ' . .w 7   9 MM 2 28c>H3L M dDMM3 'rceZdZdZdD]\ZZeedz[dZdZdZ dZ dZ d Z d Z d Zd Zd ZdZy)$ClientProtocol.ControlSequenceParserc d|zfd}|S)Ncursorc|st|dy t|}t||y#t$r|jd|zzYywxYw)Nrr)rrKrr)r,r0r1r#mrr9s rsimplez@ClientProtocol.ControlSequenceParser._makeSimple..simplesb'GGQ'*/H,+A.&N88C"9LMNs 6 AAr )rrrr9s` @r _makeSimplez0ClientProtocol.ControlSequenceParser._makeSimples5 A /Mr))r2Up)r5Down)r9Forward)r<Backwardz = _makeSimple(ch, fName)c |jdDcgc] }t|}}|j|ycc}w#t$r|j d|zdzYywxYw)NrGrr)rIrKrTrrr,r0r1r#rVrSs rhz&ClientProtocol.ControlSequenceParser.h,sd (/2yy?tT??  ' @ H00C$1FG HA;AA A#"A#c |jdDcgc] }t|}}|j|ycc}w#t$r|j d|zdzYywxYw)NrGrl)rIrKrWrrrs rrz&ClientProtocol.ControlSequenceParser.l5sd */2yy?tT??""5) @ G00C#1EF Grc~|jd}t|dk(r|jddyt|dk(r@ |drt|d}nd}|drt|d}nd}|j||y|j d|zdzy#t$r|j d|zdzYywxYw)NrGrrrrr)rIrJrrKrr)r,r0r1r#rOptpbs rrz&ClientProtocol.ControlSequenceParser.r>sIIdOE5zQ''d3Uq 4Qx q]!Qx q]!++B300C$1FG "L44X^d5JKLs,B B<;B<c|s|jy|dk(r|jy|dk(r|jy|jd|zdzy)NrrrK)r}rrrr/s rKz&ClientProtocol.ControlSequenceParser.KSsN&&(,,.!!#00C$1FGrc$|jyr))rFr/s rrEz&ClientProtocol.ControlSequenceParser.H]s    rc|s|jy|dk(r|jy|dk(r|jy|jd|zdzy)NrrrJ)rrrrr/s rJz&ClientProtocol.ControlSequenceParser.J`sN))+//1$$&00C$1FGrc|s|jdy t|}|j|y#t$r|jd|zdzYywxYw)Nrrr&)rrKrrr,r0r1r#r9s rPz&ClientProtocol.ControlSequenceParser.Pjs[''*/CA++A."L44X^d5JKL 3 AAc|s|jdy t|}|j|y#t$r|jd|zdzYywxYw)NrrL)rrKrrrs rLz&ClientProtocol.ControlSequenceParser.Lu[""1%*CA&&q)"L44X^d5JKLrc|s|jdy t|}|j|y#t$r|jd|zdzYywxYw)Nrrr)rrKrrrs rMz&ClientProtocol.ControlSequenceParser.Mrrc|dk(r:|j\}}|jjd|dz|dzfzy|jd|zdzy)N6s[%d;%dRrrn)rrrr)r,r0r1r#rrs rr9z&ClientProtocol.ControlSequenceParser.nsUd{3351%%nAq1u~&EF00C$1FGrc|s|jtyg}|jdD]} t|}|j |!|j|y#t$rY.wxYw)NrG)rnNORMALrIrKrr)r,r0r1r#rrs rrz&ClientProtocol.ControlSequenceParser.msp..v64$AFLLO $ /..6&s A A*)A*N)r#r$r%rrrexecrrrrrEr rrrr9rr rrrarsl    3IB 11 2  3  ( * H* H ! H / * * H 7rracD|dk(r|jjdy|dk(r|jjdy|dk(r|jjy|dk(r|jjy|jj d|zy)N3T4F5rs#)r*rwryr{r)r,rs rrz!ClientProtocol._handleHeightWidthsx 9 MM * *4 0 $Y MM * *5 1 $Y MM ) ) + $Y MM ) ) + MM 2 28a< @rr))r#r$r%rr*rrrrrrrrrrrrr+r"rrrarrr rrrrsOH EG&"( G $ F" IG! /"?3B (K7K7Z23 Arr)r r6rSr FUNCTION_KEYSrrrrrrrG2G3 UNDERLINE REVERSE_VIDEOBLINKBOLDrrrN)0rzope.interfacerrtwisted.internetrr iinternetrtwisted.python.compatrr r r' ITransportr6CSIr rSrrrrrrrrr"r#rr'r$r&r%rr _KEY_NAMESrrr!Protocolrziprconstsetattrr__all__)_names0rr5s  2EE:& & R     0e --e P X  8,    .          < 7 79CCu((*C   q-X&&q-!q-j z=1)KD% ND%()lAX&&lA^  YDs%D