+
     h^  c                   sb   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt	 ^ RI
Ht ^ RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ]P6                  ! R4      t]P:                  R8X  d   RtRtMRtRt ! R R]P@                  ],          4      t!R-R R llt"R R lt#R R lt$R R lt% ! R R 4      t&R.R! R" llt'R# R$ lt(]'       d"   ^ RI)t)]PT                  R% R& l4       t+R' R( lt,R# ^ RI-t-^ RI.t.]PT                  R) R* l4       t+R+ R, lt,R# )/z
This module contains implementations for the termui module. To keep the
import time of Click down, some infrequently used functionality is
placed in this module and only imported as needed.
N)gettext)StringIO)TracebackType)_default_text_stdout)CYGWIN)get_best_encoding)isatty)open_stream)
strip_ansi)term_len)WIN)ClickException)echoVZntZ
z[?25lz[?25h
c                   s  a  ] tR t^%t o R)V 3R lR lltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR ltV 3R lR lt	]
V 3R lR l4       t]
V 3R lR l4       t]
V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R  lR! ltR*V 3R" lR# lltV 3R$ lR% ltV 3R& lR' ltR(tV tR# )+ProgressBarNc                 s   < V ^8  d   QhRS[ P                  S[ P                  S[,          ,          RS[ P                  S[,          RS[RS[RS[RS[RS[RS[ P                  S[,          R	S[R
S[ P                  S[ P                  S[ P                  S[,          .S[ P                  S[,          3,          ,          RS[ P                  S[,          RS[ P                  S[ P                  ,          RS[ P                  S[,          RS[RS[RR/# )   iterablelength	fill_char
empty_charbar_templateinfo_sepshow_etashow_percentshow_positem_show_funclabelfilecolorupdate_min_stepswidthreturnN)	tOptionalIterabler   intstrboolZCallableTextIOformat__classdict__   "7/usr/lib/python3.14/site-packages/click/_termui_impl.py__annotate__ProgressBar.__annotate__&   s&    C0 C0**QZZ]+C0 

3C0 	C0
 C0 C0 C0 C0 jj&C0 C0 

1::qzz!}oqzz#.N#OPC0 zz#C0 jj"C0 zz$C0 C0  !C0" 
#C0    c                s   W0n         W@n        WPn        W`n        Wpn        Wn        Wn        Wn        T;'       g    R V n        Vf   \        4       pVf   \        4       pWn        Wn        Wn        ^ V n        Wn        V^ 8H  V n        Vf   ^ RIHp V! VR4      pVR8X  d   RpVfI   Vf   \'        R4      h\(        P*                  ! \(        P,                  \.        ,          \1        V4      4      p\3        V4      V n        W n        ^ V n        . V n        V  V  \:        P:                  ! 4       ;V n        V n        RV n         RV n!        RV n"        RV n#        RV n$        \K        V P                  4      '       * V n&        RV n'        R# ) N)length_hintziterable or length is requiredF)(r   r   r   r   r   r   r   r   r   r   r   r   r   r   _completed_intervalsr   	autowidthZoperatorr1   Z	TypeErrorr!   castr#   r   Zrangeiterr   posavgtimestartlast_eta	eta_knownfinished	max_widthenteredcurrent_itemr   	is_hidden
_last_line)selfr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r1   s   &&&&&&&&&&&&&&&& r,   __init__ZProgressBar.__init__&   sH   $ #$(  ( ,++2
<')D |z	
 0$%!
$z>, 2.F|~ @AAvvajjmU6];H#'>	"$%)YY[0
T]$#*."+/#)$))#44+/r/   c                   < V ^8  d   QhRR/# )r   r    zProgressBar[V] r(   r+   r,   r-   r.   k   s      + r/   c                s4    R V n         V P                  4        V # )T)r?   render_progressrC      &r,   	__enter__ZProgressBar.__enter__k   s    r/   c                s   < V ^8  d   QhRS[ P                  S[ P                  S[,          ,          RS[ P                  S[,          RS[ P                  S[,          RR/# )r   exc_type	exc_valuetbr    N)r!   r"   ZTypeBaseExceptionr   r(   r+   r,   r-   r.   p   sW      **QVVM23 ::m, JJ}%	
 
r/   c                s&    V P                  4        R # N)render_finish)rC   rK   rL   rM   s   &&&&r,   __exit__ZProgressBar.__exit__p   s     	r/   c                D   < V ^8  d   QhRS[ P                  S[,          /# r   r    r!   Iteratorr   r(   r+   r,   r-   r.   x   s        !**Q-  r/   c                s|    V P                   '       g   \        R 4      hV P                  4        V P                  4       # ).You need to use progress bars in a with block.)r?   RuntimeErrorrG   	generatorrH   rI   r,   __iter__ZProgressBar.__iter__x   s0    |||OPP~~r/   c                    < V ^8  d   QhRS[ /# rS   )r   r(   r+   r,   r-   r.   ~   s        !  r/   c                s*    \        \        V 4      4      # rO   )Znextr6   rH   rI   r,   __next__ZProgressBar.__next__~   s     DJr/   c                rE   r   r    NrF   r(   r+   r,   r-   r.      s      t r/   c                s    V P                   '       d   R # V P                  P                  \        4       V P                  P	                  4        R # rO   )rA   r   write	AFTER_BARflushrH   rI   r,   rP   ZProgressBar.render_finish   s,    >>>			"		r/   c                rZ   rS   floatr(   r+   r,   r-   r.      s     C CU Cr/   c                s    V P                   '       d   R # \        V P                  \        V P                  ;'       g    ^4      ;'       g    ^,          R 4      # )      ?)r=   Zminr7   ra   r   rH   rI   r,   pctZProgressBar.pct   s=    ===488uT[[%5%5A6;;!<cBBr/   c                rZ   rS   r`   r(   r+   r,   r-   r.      s     4 4E 4r/   c                s    V P                   '       g   R # \        V P                   4      \        \        V P                   4      4      ,          # )        )r8   Zsumra   ZlenrH   rI   r,   time_per_iterationZProgressBar.time_per_iteration   s.    xxx488}uS]333r/   c                rZ   rS   r`   r(   r+   r,   r-   r.      s      U r/   c                s    V P                   eA   V P                  '       g/   V P                  V P                   V P                  ,
          ,          # R# )Nrd   )r   r=   re   r7   rH   rI   r,   etaZProgressBar.eta   s5    ;;"4===**dkkDHH.DEEr/   c                rZ   rS   r%   r(   r+   r,   r-   r.      s      C r/   c                s   V P                   '       dp   \        V P                  4      pV^<,          pV^<,          pV^<,          pV^<,          pV^,          pV^,          pV^ 8  d   V RVR RVR RVR 2# VR RVR RVR 2# R# )i<   zd Z02Z:r0   )r<   r$   rf   )rC   r!   ZsecondsZminutesZhourss   &    r,   
format_etaZProgressBar.format_eta   s    >>>DHHA"fG"HA"fG"HAFE"HA1uBuRj'"QwrlCC1WRL'">>r/   c                rZ   rS   rg   r(   r+   r,   r-   r.      s      C r/   c                sx    \        V P                  4      pV P                  e   VRV P                   2,          pV# )N/)r%   r7   r   )rC   r7      & r,   
format_posZProgressBar.format_pos   s3    $((m;;"Qt{{m$$C
r/   c                rZ   rS   rg   r(   r+   r,   r-   r.      s     0 0C 0r/   c                sP    \        V P                  ^d,          4      R R2R,          # )id   z 4Z%   NN)r$   rc   rH   rI   r,   
format_pctZProgressBar.format_pct   s$    dhhn%b)+B//r/   c                rZ   rS   rg   r(   r+   r,   r-   r.      s      C r/   c                s   V P                   ef   \        V P                  V P                  ,          4      pV P                  V,          pW P
                  V P                  V,
          ,          ,          pV# V P                  '       d    V P                  V P                  ,          pV# \        V P
                  V P                  ;'       g    ^,          4      pV P                  ^ 8w  dg   V P                  V\        \        P                  ! V P                  V P                  ,          4      R,          R,           V P                  ,          4      &   RP                  V4      pV# )Ng       @g      ?r0   )r   r$   rc   r   r   r   r=   Zlistre   mathZcosr7   join)rC   Z
bar_lengthbarZchars   &   r,   
format_barZProgressBar.format_bar   s   ;;"TXX

23J..:-C??djj:&=>>C 
 ]]]..4::-C 
 DJJOO!<=E&&!+ NN $((T-D-D"DEKcQ**% ''%.C
r/   c                rZ   rS   rg   r(   r+   r,   r-   r.      s      c r/   c           	     s   V P                   p. pV P                  e   Vf   V P                  '       * pV P                  '       d    VP                  V P	                  4       4       V'       d    VP                  V P                  4       4       V P                  '       dD   V P                  '       d2   V P                  '       g    VP                  V P                  4       4       V P                  e1   V P                  V P                  4      pVe   VP                  V4       V P                  RV P                  RV P                  4       RV P                  P!                  V4      /,          P#                  4       # )Nr   rq   Zinfo)r   r   r   appendrk   rn   r   r<   r=   rh   r   r@   r   r   rs   r   rp   Zrstrip)rC   r   Z	info_bitsZ	item_inforr   r,   format_progress_lineZ ProgressBar.format_progress_line   s   ((	;;"|';#}},L===T__./T__./===T^^^DMMMT__./*++D,=,=>I$  + t(**95 &(	r/   c                rE   r\   rF   r(   r+   r,   r-   r.      s     + + +r/   c                sl   ^ RI pV P                  '       d[   V P                  V P                  8w  d>   V P                  V n        \	        V P                  V P
                  V P                  R7       R# . pV P                  '       d   V P                  p^ V n        \        V P                  4       4      p\        ^ VP                  4       P                  V,
          4      pWS8  d>   VP                  \        4       VP                  RV P                   ,          4       WPn        WPn        V P                  pV P                   e   V P                   pVP                  \        4       V P                  4       p\        V4      pV P                   e   V P                   V8  d   Wn        VP                  V4       VP                  RWh,
          ,          4       RP#                  V4      pWpP                  8w  dE   Wpn        \	        WpP
                  V P                  RR7       V P
                  P%                  4        R# R# )    N)r   r    r0   F)r   r   Znl)shutilrA   rB   r   r   r   r   r4   r   r	   ru   ZmaxZget_terminal_sizeZcolumnsrt   
BEFORE_BARr>   rp   r_   )	rC   rx   ZbufZ	old_widthZclutter_lengthZ	new_widthZclear_widthZlineZline_lens	   &        r,   rG   ZProgressBar.render_progress   s   >>> $**,"&**TZZdiitzzB>>>

IDJ%d&?&?&ABNAv779AANRSI$

:&

3/0!*"Jjj>>%..K

:((*D>>>!T^^h%>%N

4

3+012wws| ??""OIITZZEBIIOO #r/   c                $   < V ^8  d   QhRS[ RR/# )r   n_stepsr    N)r$   r(   r+   r,   r-   r.     s     1 1 1 1r/   c                sd   V ;P                   V,          un         V P                  e#   V P                   V P                  8  d   RV n        \        P                  ! 4       V P                  ,
          R8  d   R # \        P                  ! 4       V n        V P                   '       d9   \        P                  ! 4       V P
                  ,
          V P                   ,          pM&\        P                  ! 4       V P
                  ,
          pV P                  RR  V.,           V n        V P                  R JV n        R # )NTrb   i)r7   r   r=   r9   r;   r:   r8   r<   )rC   r{   Zsteps   && r,   	make_stepZProgressBar.make_step  s    G;;"txx4;;'> DMIIK$--'3.		
 888IIK$**,8D99;+D88BC=D6)D0r/   c                sN   < V ^8  d   QhRS[ RS[P                  S[,          RR/# )r   r{   r@   r    N)r$   r!   r"   r   r(   r+   r,   r-   r.   '  s*     * *c *A *$ *r/   c                s    Ve   W n         V ;P                  V,          un        V P                  V P                  8  d5   V P                  V P                  4       V P	                  4        ^ V n        R# R# )a  Update the progress bar by advancing a specified number of
steps, and optionally set the ``current_item`` for this new
position.

:param n_steps: Number of steps to advance.
:param current_item: Optional item to set as ``current_item``
    for the updated position.

.. versionchanged:: 8.0
    Added the ``current_item`` optional parameter.

.. versionchanged:: 8.0
    Only render when the number of steps meets the
    ``update_min_steps`` threshold.
N)r@   r3   r   r|   rG   )rC   r{   r@   s   &&&r,   updateZProgressBar.update'  s`      # ,!!W,!$$(=(==NN4445  "()D% >r/   c                rE   r\   rF   r(   r+   r,   r-   r.   A  s       r/   c                s0    R V n         RV n        RV n        R# )FNT)r<   r@   r=   rH   rI   r,   finishZProgressBar.finishA  s     r/   c                rR   rS   rT   r(   r+   r,   r-   r.   F  s     # #1::a= #r/   c              #  sz  "   V P                   '       g   \        R4      hV P                  '       d   V P                   Rj  xL
  R# V P                   F?  pWn        V P
                  ^ 8X  d   V P                  4        Vx  V P                  ^4       KA  	  V P                  4        V P                  4        R#  Lw5i)zReturn a generator which yields the items added to the bar
during construction, and updates the progress bar *after* the
yielded block returns.
rV   N)	r?   rW   rA   r6   r@   r3   rG   r}   r~   )rC   rvrj   r,   rX   ZProgressBar.generatorF  s      |||OPP>>>yy  ii$&!
 ,,1((*A   KKM  " !s   /B;B;B9A8B;)r3   rB   r4   r8   r   r   r@   r   r?   r<   r   r   r=   r   rA   r   r6   r   r;   r   r>   r7   r   r   r   r:   r   r   )NZ#rw   z%(bar)sz  TNFNNNNrm   i   rO   )__name__
__module____qualname____firstlineno__rD   rJ   rQ   rY   r[   rP   Zpropertyrc   re   rf   rh   rk   rn   rs   ru   rG   r|   r}   r~   rX   __static_attributes____classdictcell__r*      @r,   r   r   %   s     C0 C0J 
         C C
 4 4
  
  0 0 & 6+ +Z1 1,* *4 
# #r/   r   c                s    V ^8  d   QhR\         P                  \        ,          R\         P                  \        ,          RR/# )r   rX   r   r    Nr!   r#   r%   r"   r&   r)      "r,   r-   r-   h  s2        QZZ_  QZZ-=    r/   c                sN   \        4       pVf   \        4       p\        \        P                  4      '       d   \        V4      '       g   \        W V4      # \        P                  P                  RR4      ;'       g    RP                  4       pV'       d%   \        '       d   \        WV4      # \        WV4      # \        P                  P                  R4      R9   d   \        W V4      # \        '       g&   \        P                  P                  R4      '       d   \        V RV4      # \        \        R4      '       d)   \        P                   ! R4      ^ 8X  d   \        V R	V4      # ^ RIpVP%                  4       w  rV\        P&                  ! V4        \        \        R4      '       dC   \        P                   ! R
V R24      ^ 8X  d$   \        V RV4      \        P(                  ! V4       # \        W V4      \        P(                  ! V4       #   \        P(                  ! T4       i ; i)z2Decide what method to use for paging through text.NZPAGERr0   ZTERMZos2zmore <systemz(less) 2>/dev/nulllesszmore ""Zmore)ZdumbZemacs)r   r   r   sysstdin
_nullpagerosenvirongetZstripr
   _tempfilepager
_pipepagerplatform
startswithZhasattrr   tempfilemkstempcloseunlink)rX   r   stdoutZ	pager_cmdr   fdfilenames   &&     r,   pagerr   h  s   !#F ~#))F6NN&U33.44";;=I3!)>>)66	zz~~f!22&U33
scll%%e,,i599r8+?!@A!E)VU33##%LBHHRL2x  RYYz/C%D%Ii7 			( &U3
		(		(s   AH *H H$c                    V ^8  d   QhR\         P                  \        ,          R\        R\         P                  \        ,          RR/# r   rX   cmdr   r    Nr   r   r   r,   r-   r-     s:     / /!**S/ / /AJJt<L /QU /r/   c                s*   ^ RI p\        \        P                  4      pVP	                  R^4      R,          P                  4       pVfi   V^ ,          R8X  d[   \        P                  P                  RR4       RP                  VR,          4       2pV'       g	   RVR&   R	pMR
V9   g   RV9   d   R	pVP                  VR	VP                  VR7      p\        P                  ! \        P                  VP                  4      p\        V4      p	 V  F7  p
V'       g   \        V
4      p
VP!                  V
P#                  V	R4      4       K9  	  VP%                  4          VP+                  4        R#   \&        \(        3 d     L'i ; i  \(         d     K9  i ; i)ziPage through text by feeding it to another program.  Invoking a
pager through this might support colors.
Nri   r   ZLESSr0   rw   rl   -RTZrZR)shellr   envreplacer2   )
subprocessZdictr   r   ZrsplitZsplitr   rp   PopenZPIPEr!   r5   ZBinaryIOr   r   r   r]   encoder   OSErrorKeyboardInterruptwait)rX   r   r   r   r   Z
cmd_detailZ
less_flagscr   encodingtexts   &&&        r,   r   r     sX    
rzz
C C#B'--/J}A&0

vr23CHHZ^4L3MN
CKEJ#"3ED
SIAFF1::qww'E 'H	D!$'KKHi89	  	 	FFH ' &'   ! 		s$   =E, F ,F ?F FFc                r   r   r   r   r   r,   r-   r-     s=      zz#%(12D1A	r/   c                sN   ^ RI pVP                  4       w  rERP                  V 4      pV'       g   \        V4      p\	        \
        P                  4      p\        VR4      ^ ,          ;_uu_ 4       pVP                  VP                  V4      4       RRR4        \        P                  ! V RV R24       \        P                  ! V4       \        P                  ! V4       R#   + '       g   i     L[; i  \        P                  ! T4       \        P                  ! T4       i ; i)z<Page through text by invoking a program on a temporary file.Nr0   wb "r   )r   r   rp   r   r   r   r   r   r]   r   r   r   r   r   )	rX   r   r   r   r   r   r   r   fs	   &&&      r,   r   r     s     ##%LB779D$ ,H	Xt	$Q	'	'1	H%& 
(
		SEH:Q'(

		( 
(	'
 	
		(s   /!C#C6 #C3	6.D$c                s    V ^8  d   QhR\         P                  R\         P                  \        ,          R\         P                  \
        ,          RR/# )r   streamrX   r   r    N)r!   r'   r#   r%   r"   r&   r   r   r,   r-   r-     sA      HH!"C9:D9I	r/   c                s`    V F'  pV'       g   \        V4      pV P                  V4       K)  	  R# )z>Simply print unformatted text.  This is the ultimate fallback.N)r   r]   )r   rX   r   r   s   &&& r,   r   r     s'     d#DT r/   c                   sl   a  ] tR tRt o RV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 lR
 ltRtV t	R# )Editori  Nc          
      s   < V ^8  d   QhRS[ P                  S[,          RS[ P                  S[ P                  S[S[3,          ,          RS[RS[RR/# )r   editorr   require_save	extensionr    N)r!   r"   r%   ZMappingr&   r(   r+   r,   r-   Editor.__annotate__  s[     
# 
#

3
# ZZ		#s(+,
# 	
#
 
# 

#r/   c                s6    Wn         W n        W0n        W@n        R # rO   )r   r   r   r   )rC   r   r   r   r   s   &&&&&r,   rD   ZEditor.__init__  s     ("r/   c                rZ   rS   rg   r(   r+   r,   r-   r     s      C r/   c                s   V P                   e   V P                   # R F.  p\        P                  P                  V4      pV'       g   K,  Vu # 	  \        '       d   R# R F&  p\        P
                  ! RV R24      ^ 8X  g   K$  Vu # 	  R# )NZnotepadzwhich z >/dev/null 2>&1Zvi)ZVISUALZEDITOR)zsensible-editorZvimZnano)r   r   r   r   r
   r   )rC   Zkeyr   r   rr   r,   
get_editorZEditor.get_editor  su    ;;";;%C$Br	 & 36Fyy6&)9:;q@ 7 r/   c                rz   )r   r   r    Nrg   r(   r+   r,   r-   r     s      # $ r/   c                s   ^ RI pV P                  4       pRpV P                  '       d:   \        P                  P                  4       pVP                  V P                  4        VP                  V RV R2VRR7      pVP                  4       pV^ 8w  d%   \        \        R4      P                  VR7      4      hR#   \         d+   p\        \        R4      P                  Y7R	7      4      ThRp?ii ; i)
rv   Nr   r   T)r   r   z{editor}: Editing failed)r   z{editor}: Editing failed: {e})r   e)r   r   r   r   r   Zcopyr}   r   r   r   _r)   r   )rC   r   r   r   r   r   Z	exit_coder   s   &&      r,   	edit_fileZEditor.edit_file  s    "04888jjoo'GNN488$
	  F82hZq!9wd SAIA~$01888G    	 12999M	s   #AB: :C/%C**C/c                s   < V ^8  d   QhRS[ P                  S[ P                  ,          RS[ P                  S[ P                  ,          /# )r   r   r    )r!   r"   ZAnyStrr(   r+   r,   r-   r     s5     - -AHH- -!**QXX2F -r/   c                sD   ^ RI pV'       g   RpM\        V\        \        34      '       d   TpMgV'       d!   VP	                  R4      '       g
   VR,          p\
        '       d#   VP                  RR4      P                  R4      pMVP                  R4      pVP                  RV P                  R7      w  rE \        P                  ! VR	4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! V\        P                  P                  V4      \        P                  P!                  V4      ^,
          34       \        P                  P!                  V4      pV P#                  V4       V P$                  '       d>   \        P                  P!                  V4      V8X  d    \        P&                  ! V4       R# \)        VR
4      ;_uu_ 4       pVP+                  4       pRRR4       \        V\        \        34      '       d   X\        P&                  ! V4       # XP-                  R4      P                  RR4      \        P&                  ! V4       #   + '       g   i     EL; i  + '       g   i     L; i  \        P&                  ! T4       i ; i)rv   Nr/   r   z
z	utf-8-sigzutf-8zeditor-)ZprefixZsuffixr   Zrb)r   Z
isinstanceZbytesZ	bytearrayZendswithr
   r   r   r   r   r   Zfdopenr]   ZutimepathZgetatimeZgetmtimer   r   r   openreaddecode)	rC   r   r   Zdatar   namer   Z	timestampr   s	   &&       r,   editZEditor.edit  s   Dui011DDMM$//s||D&188E{{7+##9T^^#L	2t$$ % HHTBGG,,T2BGG4D4DT4JQ4NOP ((.INN4    RWW%5%5d%;y%H IIdO dD!!QVVX " $	 233 IIdO 99[)11&$?IIdO3 %$$" "! IIdOsO   6J I 'B#J $J J I4-%J ) J  I1	+	J 4J	?J J)r   r   r   r   )NNTz.txt)
r   r   r   r   rD   r   r   r   r   r   r   r   r,   r   r     s-     
# 
#  ,- -r/   r   c                sH    V ^8  d   QhR\         R\        R\        R\        /# )r   urlr   locater    )r%   r&   r$   r   r   r,   r-   r-   =  s(     9 9# 9T 94 9C 9r/   c                 s   ^ RI pR R lp\        P                  R8X  d   R.pV'       d   VP                  R4       V'       d   VP                  R4       VP                  V! V 4      4       \	        RR	4      p VP                  WVR
7      P                  4       VP                  4        # \        '       de   V'       d    V! V P                  RR4      4      p RV  R2pM'V P                  RR4      p V'       d   RMRpRV RV  R2p\        P                  ! V4      # \        '       d   V'       d=   \        P                  P                  V! V 4      P                  RR4      4      p RV  R2pM'V P                  RR4      p V'       d   RMRpRV RV  R2p\        P                  ! V4      #  V'       d1   \        P                  P                  V! V 4      4      ;'       g    Rp MV! V 4      p VP                  RV .4      pV'       d   VP                  4       # ^ #   TP                  4        i ; i  \         dD    T P!                  R4      '       d)   T'       g!   T'       g   ^ RIp	T	P	                  T 4        ^ #  ^# i ; i)rv   Nc                s0    V ^8  d   QhR\         R\         /# )r   r   r    rg   r   r   r,   r-   Zopen_url.<locals>.__annotate__@  s      3 3 r/   c                 s^    ^ RI Hp V P                  R4      '       d   V! V R,          4      p V # )rv   )unquotezfile://:i   NN)Zurllib.parser   r   )r   r   rj   r,   _unquote_fileZopen_url.<locals>._unquote_file@  s'    (>>)$$#b'"C
r/   Zdarwinr   z-Wr   z	/dev/nullZw)Zstderrr   r0   zexplorer /select,"z/WAITzstart z "" "z
cygstart "z-wz	cygstart r   Z.zxdg-open)zhttp://zhttps://)r   r   r   rt   r   r   r   r   r
   r   r   r   r   r   Zdirnamer   r   
webbrowser)
r   r   r   r   r   ZargsZnullZwait_strr   r   s
   &&&       r,   open_urlr   =  s    ||xxKKKKM#&'K%	##D#6;;=JJL	C 45C'uA.D++c2&C"&wBHH:U3%q1Dyy	''//-"4"<"<S""EFCuA&D++c2&C#tHxj3%q1Dyy''//-"45<<C$Cj#./668O9 JJL:  >>1226$OOC s<   9H 'H) /+H) &H) H) H&))I7I7I76I7c                sZ    V ^8  d   QhR\         R\        P                  \        ,          /# )r   chr    )r%   r!   r"   rN   r   r   r,   r-   r-   y  s#     
 
S 
QZZ%> 
r/   c                 s    V R 8X  d   \        4       hV R8X  d   \        '       g   \        4       hV R8X  d   \        '       d   \        4       hR# )ZZZN)r   r
   ZEOFError)r   rI   r,   _translate_ch_to_excr   y  s;    	V|!!	V|CCj	V|jr/   c                N    V ^8  d   QhR\         P                  \        ,          /# rS   r!   rU   r$   r   r   r,   r-   r-     s      !**S/ r/   c               #   s   "   Rx  R# 5i)rm   Nr2   rF   rF   r/   r,   raw_terminalr     s
     s   	c                0    V ^8  d   QhR\         R\        /# r   r   r    r&   r%   r   r   r,   r-   r-     s     - -d -s -r/   c                 s    V '       d   \         P                  pM\         P                  pV! 4       pVR9   d   W!! 4       ,          p\        V4       V# ) )r   t   à)msvcrtZgetwcheZgetwchr   )r   Zfuncr      &  r,   getcharr     sD    @ >>D==DV!! $&LBR 	r/   c                r   rS   r   r   r   r,   r-   r-     s      !**S/ r/   c               #   s  "   \        \        P                  4      '       g   \        R 4      p V P	                  4       pM \        P                  P	                  4       pRp  \
        P                  ! V4      p \        P                  ! V4       Vx  \
        P                  ! V\
        P                  V4       \        P                  P                  4        V e   V P                  4        R# R#   \
        P                  ! T\
        P                  T4       \        P                  P                  4        T e   T P                  4        i i ; i  \
        P                   d     R# i ; i5i)z/dev/ttyN)r   r   r   r   ZfilenotermiosZ	tcgetattrttyZsetrawZ	tcsetattrZ	TCSADRAINr   r_   r   Zerror)r   r   Zold_settingss      r,   r   r     s     
 cii  Z AB!!#BA	",,R0L

2!!"g&7&7F

  "=GGI ! !!"g&7&7F

  "=GGI !}} 		sD   AE&E
 6C, AE
 (E&,AEE
 
E#E&"E##E&c                r   r   r   r   r   r,   r-   r-     s      d s r/   c                 s   \        4       ;_uu_ 4       p\        P                  ! V^ 4      P                  \	        \
        P                  4      R4      pV '       d?   \        \
        P                  4      '       d    \
        P                  P                  V4       \        V4       VuuRRR4       #   + '       g   i     R# ; i)i    r   N)r   r   r   r   r   r   r   r   r   r]   r   )r   r   r   r   r,   r   r     sk    ^^rR''(9#))(DiPBszz**

  $ $ ^^^s   BB//C 	rO   )FF)/Z__doc__Z
contextlibro   r   r   r9   Ztypingr!   r    r   Zior   Ztypesr   Z_compatr   r   r   r   r   r   r	   r
   Z
exceptionsr   Zutilsr   ZTypeVarr   r   ry   r^   ZGenericr   r   r   r   r   r   r   r   r   Zcontextmanagerr   r   r   r   rF   r/   r,   <module>r      s  
   	 
       )  &       & IIcN77d?JIJI@#!))A, @#F
 F/d*^ ^B9x
  -`  4r/   