Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
§

hµµhˆ5ãóà—dZddlZddlZddlZddlZejdd¬¦«dZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZejddkZereZd„ZGd„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éééé	é
ééé
ééééééééú écó&—||kr|S||kr|S|S)z@This returns a number, n constrained to the min and max bounds. ©)ÚnÚminÚmaxs   ú9/usr/local/lib/python3.11/site-packages/pexpect/screen.pyÚ	constrainr<s%€ð	ˆ3‚w€w؈
؈3‚w€w؈
Ø€HócóB—eZdZdZd5d„Zd„Zd„ZereZneZ	d	„Zd
„Z
d„Zefd„Z
efd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd6d„Zd7d„Zd7d„Zd7d„Zd7d„Zd „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/d0„Z0d1„Z1d2„Z2d3„Z3d4S)8Ú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Úreplacecó@‡—|‰_|‰_|‰_|‰_|#t	j|¦«|¦«‰_nd‰_d‰_d‰_d‰_	d‰_
d‰_‰j‰_ˆfd„t‰j¦«D¦«‰_dS)z8This initializes a blank screen of the given dimensions.Nécó0•—g|]}tg‰jz‘ŒSr)ÚSPACEÚcols)Ú.0Ú_Úselfs  €rú
<listcomp>z#screen.__init__.<locals>.<listcomp>fs"ø€ÐAÐAÐA¨1•E7˜TœYÑ&ÐAÐAÐAr)Ú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/s`    rÚ__init__zscreen.__init__Us¦ø€ðˆŒ	؈Œ	Ø ˆŒ
Ø.ˆÔØÐØA6Ô7¸ÑAÔAÀ/ÑRÔRˆDŒLˆLàˆDŒL؈Œ
؈Œ
ØˆÔØˆÔØ !ˆÔØ"œiˆÔØAÐAÐAÐAµ°d´iÑ0@Ô0@ÐAÑAÔAˆŒˆˆrcób—|j|j |¦«Std¦«‚)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.)r2ÚdecodeÚ	TypeError)r+Úss  rÚ_decodezscreen._decodehs9€ðŒ<Ð#Ø”<×&Ò& qÑ)Ô)Ð)åð;ñ<ô<ð
<rcóJ—d d„|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.ú
có8—g|]}d |¦«‘ŒS©Ú©Újoin©r)r<s  rr,z#screen._unicode.<locals>.<listcomp>vs"€Ð:Ð:Ð:¨Q˜SŸXšX a™[œ[Ð:Ð:Ð:r©rIr:©r+s rÚ_unicodezscreen._unicodeqs'€ð
zŠzÐ:Ð:°$´&Ð:Ñ:Ô:Ñ;Ô;Ð;rcód—|jpd}| ¦« |d¦«S)z{This returns a printable representation of the screen. The end of
            each screen line is terminated by a newline. Úasciir#)r.rMÚencode)r+r.s  rÚ__str__zscreen.__str__}s.€ð”}Ð/¨ˆHØ—=’=‘?”?×)Ò)¨(°IÑ>Ô>Ð>rcóJ—d d„|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.rGcó8—g|]}d |¦«‘ŒSrFrHrJs  rr,zscreen.dump.<locals>.<listcomp>ˆs"€Ð8Ð8Ð8¨1˜3Ÿ8š8 A™;œ;Ð8Ð8Ð8rrKrLs rÚdumpzscreen.dumpƒs'€ð
xŠxÐ8Ð8°´Ð8Ñ8Ô8Ñ9Ô9Ð9rcó²—dd|jzzdz}|d d„t|¦« d¦«D¦«¦«zdz|zS)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+
rDcó—g|]
}d|zdz‘ŒS)ú|r)r)Úlines  rr,z!screen.pretty.<locals>.<listcomp>s €Ð$[Ð$[Ð$[¸ T¨$¡Y¨t¡^Ð$[Ð$[Ð$[r)r(rIÚunicodeÚsplit)r+Útop_bots  rÚprettyz
screen.prettyŠs`€ð
˜˜dœi™Ñ'¨&Ñ0ˆØ˜ŸšÐ$[Ð$[ÅÈÁ
Ä
×@SÒ@SÐTYÑ@ZÔ@ZÐ$[Ñ$[Ô$[Ñ\Ô\Ñ\Ð_dÑdÐgnÑnÐnrcó —t|t¦«r| |¦«}| dd|j|j|¦«dS©Nr%)Ú
isinstanceÚbytesrBÚfill_regionr-r(©r+Úchs  rÚfillzscreen.fill’sK€åb%Ñ Ô ð	"Ø—’˜bÑ!Ô!ˆBà×Ò˜!˜A˜dœi¨¬	°2Ñ6Ô6Ð6Ð6Ð6rcó¸—t|t¦«r| |¦«}t|d|j¦«}t|d|j¦«}t|d|j¦«}t|d|j¦«}||kr||}}||kr||}}t
||dz¦«D]/}t
||dz¦«D]}| |||¦«ŒŒ0dSr`)rarbrBrr-r(r9Úput_abs)r+ÚrsÚcsÚreÚcerer;r<s        rrczscreen.fill_region™s÷€åb%Ñ Ô ð	"Ø—’˜bÑ!Ô!ˆBå
˜˜A˜tœyÑ
)Ô
)ˆÝ
˜˜A˜tœyÑ
)Ô
)ˆÝ
˜˜A˜tœyÑ
)Ô
)ˆÝ
˜˜A˜tœyÑ
)Ô
)ˆØ
Š7ˆ7ؘˆBØ
Š7ˆ7ؘˆBݘ˜B˜q™DÑ!Ô!ð	&ð	&ˆAݘB  Q¡Ñ'Ô'ð
&ð
&Ø—’˜a  "Ñ%Ô%Ð%Ð%ð
&ð	&ð	&rcó<—| |jd¦«dS)zKThis moves the cursor to the beginning (col 1) of the current row.
        r%N)Úcursor_homer3rLs rÚcrz	screen.crªs"€ð	
×Ò˜$œ* aÑ(Ô(Ð(Ð(Ð(rcó¦—|j}| ¦«||jkr*| ¦«| ¦«dSdS)z3This moves the cursor down with scrolling.
        N)r3Úcursor_downÚ	scroll_upÚ
erase_line©r+Úold_rs  rÚlfz	screen.lf°sX€ð”
ˆØ×ÒÑÔÐØD”JÒÐØNŠNÑÔÐØOŠOÑÔÐÐÐðÐrcóV—| ¦«| ¦«dS)ztThis advances the cursor with CRLF properties.
        The cursor will line wrap and the screen may scroll.
        N)rorvrLs rÚcrlfzscreen.crlfºs"€ð
	
Š‰
Œ
ˆ
ØŠ‰
Œ
ˆ
ˆ
ˆ
rcó.—| ¦«dS)z%This is an alias for crlf().
        N)rxrLs rÚnewlinezscreen.newlineÂs€ð	
	Š	‰Œˆˆˆrcóü—t|d|j¦«}t|d|j¦«}t|t¦«r| |¦«d}n|d}||j|dz
|dz
<dS)zScreen array starts at 1 index.r%rN)rr-r(rarbrBr:)r+r;r<res    rrhzscreen.put_absÈs{€õ
q˜!˜TœYÑ'Ô'ˆÝq˜!˜TœYÑ'Ô'ˆÝb%Ñ Ô ð	Ø—’˜bÑ!Ô! !Ô$ˆBˆBàA”ˆB؈Œˆq‰sŒAa‘CÑÐÐrcóœ—t|t¦«r| |¦«}| |j|j|¦«dS)z?This puts a characters at the current cursor position.
        N)rarbrBrhr3r4rds  rÚputz
screen.putÓsG€õb%Ñ Ô ð	"Ø—’˜bÑ!Ô!ˆBàŠd”j $¤*¨bÑ1Ô1Ð1Ð1Ð1rc
ón—t|t¦«r| |¦«}t|d|j¦«}t|d|j¦«}t
|j|d¦«D]0}| ||| ||dz
¦«¦«Œ1| |||¦«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)	rarbrBrr-r(r9rhÚget_abs)r+r;r<reÚcis     rÚ
insert_abszscreen.insert_absÜs±€õb%Ñ Ô ð	"Ø—’˜bÑ!Ô!ˆBåq˜!˜TœYÑ'Ô'ˆÝq˜!˜TœYÑ'Ô'ˆÝ˜œ A rÑ*Ô*ð	6ð	6ˆBØLŠL˜!˜B §¢¨Q¨r°!©tÑ 4Ô 4Ñ5Ô5Ð5Ð5ØŠa˜˜"ÑÔÐÐÐrcóœ—t|t¦«r| |¦«}| |j|j|¦«dS©N)rarbrBr‚r3r4rds  rÚinsertz
screen.insertësE€åb%Ñ Ô ð	"Ø—’˜bÑ!Ô!ˆBàŠ˜œ T¤Z°Ñ4Ô4Ð4Ð4Ð4rcóŒ—t|d|j¦«}t|d|j¦«}|j|dz
|dz
Sr`)rr-r(r:©r+r;r<s   rr€zscreen.get_absòsA€åq˜!˜TœYÑ'Ô'ˆÝq˜!˜TœYÑ'Ô'ˆØŒva˜‘cŒ{˜1˜Q™3ÔÐrcóF—| |j|j¦«dSr„)r€r3r4rLs rÚgetz
screen.getøs €àŠd”j $¤*Ñ-Ô-Ð-Ð-Ð-rcóž—t|d|j¦«}t|d|j¦«}t|d|j¦«}t|d|j¦«}||kr||}}||kr||}}g}t||dz¦«D]J}d}t||dz¦«D]}| ||¦«}	||	z}Œ| |¦«ŒK|S)z>This returns a list of lines representing the region.
        r%rG)rr-r(r9r€Úappend)
r+rirjrkrlÚscr;rZr<res
          rÚ
get_regionzscreen.get_regionüsð€õ˜˜A˜tœyÑ
)Ô
)ˆÝ
˜˜A˜tœyÑ
)Ô
)ˆÝ
˜˜A˜tœyÑ
)Ô
)ˆÝ
˜˜A˜tœyÑ
)Ô
)ˆØ
Š7ˆ7ؘˆBØ
Š7ˆ7ؘˆBØ
ˆÝ˜˜B˜q™DÑ!Ô!ð	ð	ˆA؈DݘB  Q¡Ñ'Ô'ð
!ð
!Ø—\’\ 1 QÑ'Ô'Ø˜b‘yØIŠItÑÔÐÐ؈	rcó†—t|jd|j¦«|_t|jd|j¦«|_dS)z6This keeps the cursor within the screen area.
        r%N)rr3r-r4r(rLs rÚcursor_constrainzscreen.cursor_constrains6€õ ¤
¨A¨t¬yÑ9Ô9ˆŒ
Ý ¤
¨A¨t¬yÑ9Ô9ˆŒ
ˆ
ˆ
rr%cóJ—||_||_| ¦«dSr„)r3r4rr‡s   rrnzscreen.cursor_homes(€àˆŒ
؈Œ
Ø×ÒÑ Ô Ð Ð Ð rcóL—|j|z
|_| ¦«dSr„©r4r©r+Úcounts  rÚcursor_backzscreen.cursor_backó(€à”Z %Ñ'ˆŒ
Ø×ÒÑ Ô Ð Ð Ð rcóL—|j|z|_| ¦«dSr„©r3rr“s  rrqzscreen.cursor_down#r–rcóL—|j|z|_| ¦«dSr„r’r“s  rÚcursor_forwardzscreen.cursor_forward(r–rcóL—|j|z
|_| ¦«dSr„r˜r“s  rÚ	cursor_upzscreen.cursor_up-r–rcó~—|j}| ¦«||jkr| ¦«dSdSr„)r3rœrrrts  rÚcursor_up_reversezscreen.cursor_up_reverse2sD€à”
ˆØŠÑÔÐØD”JÒÐØNŠNÑÔÐÐÐðÐrcó2—| ||¦«dS)zIdentical to Cursor Home.N)rnr‡s   rÚcursor_force_positionzscreen.cursor_force_position9s €ð	
×Ò˜!˜QÑÔÐÐÐrcó.—| ¦«dS©zSave current cursor position.N)Úcursor_save_attrsrLs rÚcursor_savezscreen.cursor_save>s€ð	
×ÒÑ Ô Ð Ð Ð rcó.—| ¦«dS©z-Restores cursor position after a Save Cursor.N)Úcursor_restore_attrsrLs rÚ
cursor_unsavezscreen.cursor_unsaveCs€ð	
×!Ò!Ñ#Ô#Ð#Ð#Ð#rcó6—|j|_|j|_dSr¢)r3r5r4r6rLs rr£zscreen.cursor_save_attrsHs€ð œ:ˆÔØœ:ˆÔÐÐrcóF—| |j|j¦«dSr¦)rnr5r6rLs rr§zscreen.cursor_restore_attrsNs&€ð	
×Ò˜$Ô*¨DÔ,<Ñ=Ô=Ð=Ð=Ð=rcóf—|jdkrd|_|j|jkr|j|_dSdS)z6This keeps the scroll region within the screen region.rr%N)r7r8r-rLs rÚscroll_constrainzscreen.scroll_constrainSsB€ðÔ  AÒ%Ð%Ø$%ˆDÔ!ØÔ ¤Ò*Ð*Ø"&¤)ˆDÔÐÐð+Ð*rcó,—d|_|j|_dS)z$Enable scrolling for entire display.r%N)r7r-r8rLs rÚ
scroll_screenzscreen.scroll_screen[s€ð!"ˆÔØ"œiˆÔÐÐrcóJ—||_||_| ¦«dS)z/Enable scrolling from row {start} to row {end}.N)r7r8r¬)r+rirks   rÚscroll_screen_rowszscreen.scroll_screen_rowsas,€ð!#ˆÔØ ˆÔØ×ÒÑÔÐÐÐrcó—|jdz
}|jdz
}tj|j||…¦«|j|dz|dz…<dS)zScroll display down one line.r%N©r7r8ÚcopyÚdeepcopyr:©r+rAÚes   rÚscroll_downzscreen.scroll_downhsM€ð
Ô! AÑ%ˆØÔ !Ñ#ˆÝœ-¨¬¨q°¨s¬Ñ4Ô4ˆŒˆq‰s1Q‘3ˆw‰ˆˆrcó—|jdz
}|jdz
}tj|j|dz|dz…¦«|j||…<dS)zScroll display up one line.r%Nr²rµs   rrrzscreen.scroll_uppsM€ð
Ô! AÑ%ˆØÔ !Ñ#ˆÝ”m D¤F¨1¨Q©3¨q°©s¨7¤OÑ4Ô4ˆŒˆqˆs‰ˆˆrcó^—| |j|j|j|j¦«dS)zOErases from the current cursor position to the end of the current
        line.N)rcr3r4r(rLs rÚerase_end_of_linezscreen.erase_end_of_linexs,€ð	
×Ò˜$œ* d¤j°$´*¸d¼iÑHÔHÐHÐHÐHrcóT—| |jd|j|j¦«dS)zQErases from the current cursor position to the start of the current
        line.r%N)rcr3r4rLs rÚerase_start_of_linezscreen.erase_start_of_line~s*€ð	
×Ò˜$œ* a¨¬°T´ZÑ@Ô@Ð@Ð@Ð@rcóT—| |jd|j|j¦«dS)zErases the entire current line.r%N)rcr3r(rLs rrszscreen.erase_line„s*€ð	
×Ò˜$œ* a¨¬°T´YÑ?Ô?Ð?Ð?Ð?rcó‚—| ¦«| |jdzd|j|j¦«dS)zQErases the screen from the current line down to the bottom of the
        screen.r%N)rºrcr3r-r(rLs rÚ
erase_downzscreen.erase_down‰s@€ð	
×ÒÑ!Ô!Ð!Ø×Ò˜$œ* q™.¨!¨T¬Y¸¼	ÑBÔBÐBÐBÐBrcóx—| ¦«| |jdz
dd|j¦«dS)zLErases the screen from the current line up to the top of the
        screen.r%N)r¼rcr3r(rLs rÚerase_upzscreen.erase_ups>€ð	
× Ò Ñ#Ô#Ð#Ø×Ò˜$œ* Q™,¨¨1¨d¬iÑ8Ô8Ð8Ð8Ð8rcó.—| ¦«dS)z,Erases the screen with the background color.N)rfrLs rÚerase_screenzscreen.erase_screen—s€ð	
	Š	‰Œˆˆˆrcó—dS)z#Sets a tab at the current position.NrrLs rÚset_tabzscreen.set_tabœó	€ð	
ˆrcó—dS)z#Clears tab at the current position.NrrLs rÚ	clear_tabzscreen.clear_tab¡rÆrcó—dS)zClears all tabs.NrrLs rÚclear_all_tabszscreen.clear_all_tabs¦rÆrN)rr!r"r#)r%r%)r%)4Ú__name__Ú
__module__Ú__qualname__Ú__doc__r=rBrMÚPY3rQÚ__unicode__rTr^r'rfrcrorvrxrzrhr}r‚r…r€r‰rrrnr•rqršrœržr r¤r¨r£r§r¬r®r°r·rrrºr¼rsr¿rÁrÃrÅrÈrÊrrrr r Fs€€€€€ð
ð
ðBðBðBðBð&<ð<ð<ð<ð<ð<ðð	?؈ˆàˆð	?ð	?ð	?ð:ð:ð:ðoðoðoðð7ð7ð7ð7ð-2ð&ð&ð&ð&ð")ð)ð)ðððððððððð	ð	ð	ð2ð2ð2ð
ð
ð
ð5ð5ð5ð ð ð ð.ð.ð.ðððð*:ð:ð:ð!ð!ð!ð!ð!ð!ð!ð!ð
!ð!ð!ð!ð
!ð!ð!ð!ð
!ð!ð!ð!ð
ððð ð ð ð
!ð!ð!ð
$ð$ð$ð
&ð&ð&ð>ð>ð>ð
,ð,ð,ð(ð(ð(ð ð ð ð5ð5ð5ð5ð5ð5ðIðIðIðAðAðAð@ð@ð@ð
CðCðCð9ð9ð9ðððð

ð
ð
ð

ð
ð
ð

ð
ð
ð
ð
rr )rÎr0r³ÚsysÚwarningsÚwarnÚNULÚENQÚBELÚBSÚHTÚLFÚVTÚFFÚCRÚSOÚSIÚXONÚXOFFÚCANÚSUBÚESCÚDELr'Úversion_inforÏÚstrr[rr rrrú<module>rçs ðððð2€
€
€
Ø€€€Ø
€
€
€
à€€€à
€„
ð3ððñôðð
ۯۯۯۯۯۯۯۯۯۯۯۯ	ۯۯۯۯ	ۯۈ
Ô˜Ô˜aÒ€ØðØ€Gð
ð
ð
ðc
ðc
ðc
ðc
ðc
ñc
ôc
ðc
ðc
ðc
r