PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  Ɵ[c@sdZddlZddlZddlZddlZejddddZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdZdZdZdZdZejddkZereZndZdddYZdS(sThis 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 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. iNspexpect.screen and pexpect.ANSI are deprecated. We recommend using pyte to emulate a terminal screen: https://pypi.python.org/pypi/pytet stackleveliiiiii i i i i iiiiiiiiu icCs$||kr|S||kr |S|S(s@This returns a number, n constrained to the min and max bounds. ((tntmintmax((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt constrain<s   tscreencBseZdZdddddZdZdZerBeZneZdZd Z d Z e d Z e d Z d ZdZdZdZdZdZdZdZdZdZdZdZdddZddZddZddZddZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2RS(3s5This 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`. iiPslatin-1treplacecCs||_||_||_||_|dk rKtj|||_n d|_d|_d|_ d|_ d|_ d|_ |j|_ gt|jD]}tg|j^q|_dS(s8This initializes a blank screen of the given dimensions.iN(trowstcolstencodingtencoding_errorstNonetcodecstgetincrementaldecodertdecodertcur_rtcur_ct cur_saved_rt cur_saved_ctscroll_row_starttscroll_row_endtrangetSPACEtw(tselftrtcR R t_((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt__init__Us            cCs/|jdk r|jj|StddS(stThis converts from the external coding system (as passed to the constructor) to the internal one (unicode). sLThis screen was constructed with encoding=None, so it does not handle bytes.N(RR tdecodet TypeError(Rts((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt_decodehscCs,djg|jD]}dj|^qS(sThis 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.u u(tjoinR(RR((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt_unicodeqscCs%|jp d}|jj|dS(s{This returns a printable representation of the screen. The end of each screen line is terminated by a newline. tasciiR(R R"tencode(RR ((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt__str__}scCs,djg|jD]}dj|^qS(sThis 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.u(R!R(RR((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytdumpscCsXdd|jd}|djgt|jdD]}d|d^q4d|S(sThis 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.u+u-u+ u u|(RR!tunicodetsplit(Rttop_bottline((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytprettyscCsDt|tr!|j|}n|jdd|j|j|dS(Ni(t isinstancetbytesR t fill_regionRR(Rtch((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytfillscCst|tr!|j|}nt|d|j}t|d|j}t|d|j}t|d|j}||kr||}}n||kr||}}nxLt||dD]7}x.t||dD]}|j|||qWqWdS(Ni(R,R-R RRRRtput_abs(RtrstcstretceR/RR((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyR.s  cCs|j|jddS(sKThis moves the cursor to the beginning (col 1) of the current row. iN(t cursor_homeR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytcrscCs=|j}|j||jkr9|j|jndS(s3This moves the cursor down with scrolling. N(Rt cursor_downt scroll_upt erase_line(Rtold_r((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytlfs    cCs|j|jdS(stThis advances the cursor with CRLF properties. The cursor will line wrap and the screen may scroll. N(R7R<(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytcrlfs cCs|jdS(s%This is an alias for crlf(). N(R=(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytnewlinescCsvt|d|j}t|d|j}t|trO|j|d}n |d}||j|d|dt|tr!|j|}n|j|j|j|dS(s?This puts a characters at the current cursor position. N(R,R-R R1RR(RR/((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytputscCst|tr!|j|}nt|d|j}t|d|j}x@t|j|dD])}|j|||j||dqaW|j|||dS(sThis 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. iiN( R,R-R RRRRR1tget_abs(RRRR/tci((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt insert_abss'cCs>t|tr!|j|}n|j|j|j|dS(N(R,R-R RBRR(RR/((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytinsertscCsAt|d|j}t|d|j}|j|d|dS(Ni(RRRR(RRR((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyR@scCs|j|j|jdS(N(R@RR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytgetsc Cst|d|j}t|d|j}t|d|j}t|d|j}||krp||}}n||kr||}}ng}xht||dD]S}d}x7t||dD]"}|j||} || }qW|j|qW|S(s>This returns a list of lines representing the region. iu(RRRRR@tappend( RR2R3R4R5tscRR*RR/((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt get_regions   cCs:t|jd|j|_t|jd|j|_dS(s6This keeps the cursor within the screen area. iN(RRRRR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytcursor_constrainsicCs ||_||_|jdS(N(RRRH(RRR((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyR6s  cCs|j||_|jdS(N(RRH(Rtcount((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt cursor_backscCs|j||_|jdS(N(RRH(RRI((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyR8#scCs|j||_|jdS(N(RRH(RRI((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytcursor_forward(scCs|j||_|jdS(N(RRH(RRI((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt cursor_up-scCs3|j}|j||jkr/|jndS(N(RRLR9(RR;((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytcursor_up_reverse2s  cCs|j||dS(sIdentical to Cursor Home.N(R6(RRR((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytcursor_force_position9scCs|jdS(sSave current cursor position.N(tcursor_save_attrs(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt cursor_save>scCs|jdS(s-Restores cursor position after a Save Cursor.N(tcursor_restore_attrs(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt cursor_unsaveCscCs|j|_|j|_dS(sSave current cursor position.N(RRRR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyROHs cCs|j|j|jdS(s-Restores cursor position after a Save Cursor.N(R6RR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyRQNscCs@|jdkrd|_n|j|jkr<|j|_ndS(s6This keeps the scroll region within the screen region.iiN(RRR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytscroll_constrainSs cCsd|_|j|_dS(s$Enable scrolling for entire display.iN(RRR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt scroll_screen[s cCs ||_||_|jdS(s/Enable scrolling from row {start} to row {end}.N(RRRS(RR2R4((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytscroll_screen_rowsas  cCsI|jd}|jd}tj|j||!|j|d|d+dS(sScroll display down one line.iN(RRtcopytdeepcopyR(RRte((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt scroll_downhs  cCsI|jd}|jd}tj|j|d|d!|j||+dS(sScroll display up one line.iN(RRRVRWR(RRRX((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyR9ps  cCs&|j|j|j|j|jdS(sOErases from the current cursor position to the end of the current line.N(R.RRR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyterase_end_of_linexscCs#|j|jd|j|jdS(sQErases from the current cursor position to the start of the current line.iN(R.RR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyterase_start_of_line~scCs#|j|jd|j|jdS(sErases the entire current line.iN(R.RR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyR:scCs1|j|j|jdd|j|jdS(sQErases the screen from the current line down to the bottom of the screen.iN(RZR.RRR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt erase_downs cCs.|j|j|jddd|jdS(sLErases the screen from the current line up to the top of the screen.iN(R[R.RR(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyterase_ups cCs|jdS(s,Erases the screen with the background color.N(R0(R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt erase_screenscCsdS(s#Sets a tab at the current position.N((R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytset_tabscCsdS(s#Clears tab at the current position.N((R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyt clear_tabscCsdS(sClears all tabs.N((R((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pytclear_all_tabss(3t__name__t __module__t__doc__RR R"tPY3R%t __unicode__R&R+RR0R.R7R<R=R>R1R?RBRCR@RDRGRHR6RJR8RKRLRMRNRPRRRORQRSRTRURYR9RZR[R:R\R]R^R_R`Ra(((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyRFsb                                       ((RdR RVtsystwarningstwarntNULtENQtBELtBStHTtLFtVTtFFtCRtSOtSItXONtXOFFtCANtSUBtESCtDELRt version_infoRetstrR'RR(((s//tmp/pip-build-ViqJzN/pexpect/pexpect/screen.pyts: