+
   ңf                      ^ RI t ]R8X  d!   ] P                  R,          ] P                  R&    ^ RI5 ] P                  R8X  d   ^ RI	H
t
 ]
! 4        ^ R	IHt ^ R
IHt ^ RI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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-H.t.H/t/ ^ RI0H1t1 ^ RI	H2t2 Rs3Rt4^ t5 Rt6]6]7n6        ]6]8n6        ] P                  s:R4R lt;Rs<R t=]=! R4       R]P|                  3R lt?]?]n>         ! R  R!]%4      t@ ! R" R#]'4      tA ! R$ R%]4      tB ! R& R']14      tC ! R( R)] 4      tD ! R* R+]+P                  4      tFR, tGR- tH ! R. R/]4      tI ! R0 R1])4      tJR2tKR3 tL]R8X  d   ]L! 4        ]=! R4       R#   ] d    ]! R] P                  R7       ]! ^4      hi ; i  ]9 d     Li ; i)5    N__main__zidlelib.pyshell)*zJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **filewin32)fix_win_hidpi)
messagebox)InteractiveInterpreter)TextWrapper)ColorDelegator)idleConf)	Delegatordebugger)
debugger_r)EditorWindow)FileList)OutputWindow)replace)rpc)idle_formatwarningStdInputFileStdOutputFile)UndoDelegator)fix_word_breaksFz	127.0.0.1zCtrl-D (end-of-file)c           
         Vf   \         p VP                  \        WW#VR7      4       VP                  R4       R#   \        \        3 d     R# i ; i)zShow Idle-format warning (after replacing warnings.showwarning).

The differences are the formatter called, the file=None replacement,
which can be None, the capture of the consequence AttributeError,
and the output of a hard-coded prompt.
N)linez>>> )warning_streamwriter   AttributeErrorOSError)messagecategoryfilenamelinenor   r   s   &&&&&&&/usr/lib/python3.14/idlelib/pyshell.pyidle_showwarningr'   C   sS     |

%8$@ 	A

6G$ s   .< AAc                    V '       d,   \         f"   \        P                  s \        \        n        R# R# \         e   \         \        n        Rs R# R# )z>Replace warning.showwarning with idle_showwarning, or reverse.N)_warnings_showwarningwarningsshowwarningr'   )captures   &r&   capture_warningsr-   V   sA      ($,$8$8!#3H  ) !,#8H $(! -    Tc                    \         P                  p/ p\        V4       F0  pVR,          VRR ,           R8X  g   K  VP                  V4      W4&   K2  	  V! V 4       VP	                  V4       R# )aW  Extend linecache.checkcache to preserve the <pyshell#...> entries

Rather than repeating the linecache code, patch it to save the
<pyshell#...> entries, call the original linecache.checkcache()
(skipping them), and then restore the saved entries.

orig_checkcache is bound at definition time to the original
method, allowing it to be patched.
N   NN<>)	linecachecachelistpopupdate)r$   orig_checkcacher5   savekeys   &&   r&   extended_linecache_checkcacher<   e   s\     OOEDE{r7SX%		#DI  H	LLr.   c                   z   a  ] tR t^|t o RtR t. ROtRR ltR tRR lt	RR lt
R tR	 tR
 tR tR tR tRtV tR# )PyShellEditorWindowz6Regular text edit window in IDLE, supports breakpointsc                   . V n         \        P                  ! V .VO5!   V P                  P	                  R V P
                  4       V P                  P	                  RV P                  4       V P                  P	                  RV P                  P                  4       \        P                  P                  \        P                  R4      V n        V P                  P                   V 3R lpV P                  P#                  V4       V P                  P$                  '       d   V P'                  4        V P)                  4        R# )<<set-breakpoint>><<clear-breakpoint>>z<<open-python-shell>>zbreakpoints.lstc                 4    VP                  4        V ! 4        R # N)restore_file_breaks)old_hookselfs   &&r&   filename_changed_hook;PyShellEditorWindow.__init__.<locals>.filename_changed_hook   s    $$&Jr.   N)breakpointsr   __init__textbindset_breakpoint_eventclear_breakpoint_eventflist
open_shellospathjoinr   userdirbreakpointPathiofilename_change_hookset_filename_change_hookr$   rD   color_breakpoint_text)rF   argsrG   s   &* r&   rJ   PyShellEditorWindow.__init__   s    d*T*		+T-F-FG		-t/J/JK		.

0E0EF !ggll  "35 ,077+G+G'+	 	(()>?77$$&""$r.   Nc                    V P                   f   R# V'       d.   \        P                  ! 4       p\        P                  ! VR4      pMRRRR/pV P                  P                  RV4       R# )z,Turn colorizing of breakpoint text on or offNbreak
foreground 
backgroundBREAK)rV   r   CurrentThemeGetHighlightrK   
tag_config)rF   colorthemecfgs   &&  r&   rY   )PyShellEditorWindow.color_breakpoint_text   sS    77?))+E''w7C\26C		Wc*r.   c                   V P                   pV P                  P                  pVP                  R RV,          RV^,           ,          4        V P                  P                  V4        V P                  P                  P                  P                  pVP                  W14       R#   \         d    T P                  P                  T4        Lfi ; i    R# ; i)ra   z%d.0N)rK   rV   r$   tag_addrI   index
ValueErrorappendrO   pyshellinterpr   set_breakpoint)rF   r%   rK   r$   debugs   &&   r&   rp   "PyShellEditorWindow.set_breakpoint   s    yy77##Wfvov/BC	,""6*	JJ&&--66E  2	  	,##F+	,
	s   B% (;C %&CCCc                    V P                   pV P                  P                  pV'       g   VP                  4        R # \	        \        VP                  R4      4      4      pV P                  V4       R # )Ninsert)rK   rV   r$   bellintfloatrk   rp   )rF   eventrK   r$   r%   s   &&   r&   rM   (PyShellEditorWindow.set_breakpoint_event   sO    yy77##IIKU4::h/01F#r.   c                   V P                   pV P                  P                  pV'       g   VP                  4        R # \	        \        VP                  R4      4      4      p V P                  P                  V4       TP                  RRR4        T P                  P                  P                  P                  pTP                  Y44       R #     LU; i    R # ; i)Nrt   ra   insert linestartzinsert lineend +1char)rK   rV   r$   ru   rv   rw   rk   rI   remove
tag_removerO   rn   ro   r   clear_breakpoint)rF   rx   rK   r$   r%   rq   s   &&    r&   rN   *PyShellEditorWindow.clear_breakpoint_event   s    yy77##IIKU4::h/01	##F+ 	!3/	1	JJ&&--66E""84		s   !C ;C CCc                j   V P                   '       d   V P                  pV P                  P                  pV'       g   VP	                  4        R # . V n         VP                  RR\        4        V P                  P                  P                  P                  pVP                  V4       R # R #     R # ; i)Nra   1.0)rI   rK   rV   r$   ru   r}   ENDrO   rn   ro   r   clear_file_breaks)rF   rK   r$   rq   s   &   r&   r   %PyShellEditorWindow.clear_file_breaks   s    99Dww''H		!DOOGUC0

**11::''1 s   .;B- -B2c                   V P                   pV P                  P                  p \        V P                  RRR7      ;_uu_ 4       pVP                  4       pRRR4        \        T P                  RRR7      ;_uu_ 4       pX F4  pTP                  TR,           4      '       d   K#  TP                  T4       K6  	  T P                  4        T P                   pT'       d0   TP                  TR,           \        T4      ,           R,           4       RRR4       R#   + '       g   i     L; i  \         d    . p Li ; i  + '       g   i     R# ; i  \         ds   p\        T P                  R	R
4      '       gK   RT P                  n        \        P                  ! RR\        T4      ,          T P                   R7        Rp?R#  Rp?R# Rp?ii ; i)z#Save breakpoints when file is savedutf-8r   encodingerrorsNw)r   =
breakpoint_error_displayedFTz
IDLE Errorz$Unable to update breakpoint list:
%s)titler"   parent)rI   rV   r$   openrU   	readlinesr!   
startswithr   update_breakpointsstrgetattrrootr   r	   	showerrorrK   )rF   breaksr$   fplinesnew_filer   errs   &       r&   store_file_breaks%PyShellEditorWindow.store_file_breaks   sg   $ !!77##	d))&y: :=?:
	&d))3AAX!D??8c>:: t, " '')))NN8c>CK#?$#FG BA: :  	E	 BAA  	&499&BEJJ7;		4$$<Cc(#99& & K	&sr    D) DD)  E >!D<$8D</D<E D&	!D) &D) )D98D9<E	E E GA!GGc                N   V P                   P                  4        V P                  f   R # V P                  P                  pVf   R # \        P
                  P                  V P                  4      '       d   \        V P                  RRR7      ;_uu_ 4       pVP                  4       pR R R 4       X F[  pVP                  VR,           4      '       g   K#  \        V\        V4      ^,           R  4      pV F  pV P                  V4       K  	  K]  	  R # R #   + '       g   i     Lu; i)Nr   r   r   r   )rK   r8   rV   r$   rQ   rR   isfilerU   r   r   r   evallenrp   )rF   r$   r   r   r   breakpoint_linenumbersbreakpoint_linenumbers   &      r&   rD   'PyShellEditorWindow.restore_file_breaks  s    		77?77##77>>$--..d))&y: :=?: ??8c>22-1$s8}Q7G2H-I*1G-++,AB 2H 	 /: :s   DD$	c                n    V P                   pVP                  R4      pV P                  V4      pW0n        R# )z3Retrieves all the breakpoints in the current windowra   N)rK   
tag_rangesranges_to_linenumbersrI   )rF   rK   rangeslinenumber_lists   &   r&   r   &PyShellEditorWindow.update_breakpoints  s/    yy)44V<*r.   c                &   . p\        ^ \        V4      ^4       Ft  p\        \        W,          P                  4      4      p\        \        W^,           ,          P                  4      4      pWE8  g   KZ  VP                  V4       V^,          pK$  	  V# )r   )ranger   rv   rw   stringrm   )rF   r   r   rk   r%   ends   &&    r&   r   )PyShellEditorWindow.ranges_to_linenumbers%  sq    1c&k1-Ev}3345FeF7O2234C,V$! . r.   c                R    V P                  4        \        P                  ! V 4       R# )z7Extend base method - clear breaks when module is closedN)r   r   _closerF   s   &r&   r   PyShellEditorWindow._close6  s     D!r.   )rU   rI   ))Cutz<<cut>>rmenu_check_cut)Copyz<<copy>>rmenu_check_copy)Pastez	<<paste>>rmenu_check_paste)NNN)zSet Breakpointr@   N)zClear BreakpointrA   NTrC   )__name__
__module____qualname____firstlineno____doc__rJ   rmenu_specsrY   rp   rM   rN   r   r   rD   r   r   r   __static_attributes____classdictcell____classdict__s   @r&   r>   r>   |   sM     <%(K
+$&)&VC$+"" "r.   r>   c                   6   a  ] tR tRt o Rt]tRtRR ltRt	V t
R# )PyShellFileListi<  z8Extend base class: IDLE supports a shell and breakpointsNc                &   V P                   '       d1   V P                   P                  P                  4        V P                   # \        V 4      V n         V P                   '       d#   V P                   P	                  4       '       g   R # V P                   # rC   )rn   topwakeupPyShellbeginrF   rx   s   &&r&   rP   PyShellFileList.open_shellE  sc    <<<LL##% ||	 #4=DL|||||))++||r.   )rn   rC   )r   r   r   r   r   r>   r   rn   rP   r   r   r   s   @r&   r   r   <  s     > 'LG r.   r   c                   0   a  ] tR tRt o RtR tR tRtV tR# )ModifiedColorDelegatoriP  z8Extend base class: colorizer for the shell window itselfc                ~    V P                  R RR4       V P                  RRR4       \        P                  ! V 4       R# )TODOr   iomarkSYNCN)r}   rj   r   recolorize_mainr   s   &r&   r   &ModifiedColorDelegator.recolorize_mainR  s0    x0VUH-&&t,r.   c                R    V P                    F  pV P                  VR R4       K  	  R# )r   r   N)tagdefsr}   )rF   tags   & r&   removecolors#ModifiedColorDelegator.removecolorsW  s     <<COOC51  r.    N)	r   r   r   r   r   r   r   r   r   r   s   @r&   r   r   P  s     >-
2 2r.   r   c                   J   a a ] tR tRt oRtRR ltRR ltV 3R ltRtVt	V ;t
# )ModifiedUndoDelegatori]  z;Extend base class: forbid insert/delete before the I/O markc                     V P                   P                  VR R4      '       d   V P                   P                  4        R#  \        P
                  ! WW#4       R#   \         d     L&i ; i<r   N)delegatecompareru   TclErrorr   rt   rF   rk   charstagss   &&&&r&   rt   ModifiedUndoDelegator.insert_  s^    	}}$$UC::""$ ;
 	T%6  		   "A A A)(A)c                     V P                   P                  VR R4      '       d   V P                   P                  4        R#  \        P
                  ! WV4       R#   \         d     L&i ; ir   )r   r   ru   r   r   delete)rF   index1index2s   &&&r&   r   ModifiedUndoDelegator.deleteh  s^    	}}$$VS(;;""$ <
 	T62  		r   c                   <a V P                   P                  oV3R  lV P                   n         \        SV `  V4       SV P                   n        R#   ST P                   n        i ; i)c                    < S! WR 4      # )stdinr   )rk   r   orig_inserts   &&r&   <lambda>2ModifiedUndoDelegator.undo_event.<locals>.<lambda>x  s    U7!Cr.   N)r   rt   super
undo_event)rF   rx   r   	__class__s   &&@r&   r    ModifiedUndoDelegator.undo_eventq  sN    
 mm**C 		/Gu%#.DMM ;DMM s   A A$r   rC   )r   r   r   r   r   rt   r   r   r   r   __classcell__r   r   s   @@r&   r   r   ]  s     A73/ /r.   r   c                   .   a  ] tR tRt o RtRR ltRtV tR# )UserInputTaggingDelegatori  z.Delegator used to tag user input with "stdin".Nc                J    Vf   RpV P                   P                  WV4       R # )Nr   )r   rt   r   s   &&&&r&   rt    UserInputTaggingDelegator.insert  s     <DU40r.   r   rC   )r   r   r   r   r   rt   r   r   r   s   @r&   r   r     s     81 1r.   r   c                   &   a  ] tR tRt o R tRtV tR# )MyRPCClienti  c                    \         h)z0Override the base class - just re-raise EOFError)EOFErrorr   s   &r&   
handle_EOFMyRPCClient.handle_EOF  s    r.   r   N)r   r   r   r   r  r   r   r   s   @r&   r   r     s      r.   r   c                    RT;'       g    R R2pV \        V4      8  d;   \        V \        V4      ,
          ^4      w  r4W4,           R,           V VR,           2# VRR # )zReturn width long restart line formatted with filename.

Fill line with balanced '='s, with any extras and at least one at
the beginning.  Do not end with a trailing space.
z= RESTART: Shellz =r   N)r   divmod)widthr$   r   divmods   &&   r&   restart_liner    se     ++G,B
/CC5#c(?Q/7C-c#gY//3Bxr.   c                    \         P                  P                  \         P                  P                  \        4      4      pV  Uu. uF  q"V8w  g   K  VNK  	  up# u upi )zReturn path without the idlelib directory (gh-134300).

That directory is on sys.path when idle.py is run as a script.
Otherwise user code could import idlelib submodules as top-level
modules, such as "import help".
)rQ   rR   dirnameabspath__file__)rR   idlelib_dirps   &  r&   fix_user_pathr    sB     ''//"''//(";<K0t!K/AAt000s   AAc                      a  ] tR tRt o R tRtRtRtR tR t	R t
R!R ltR tR	 tR
 tR tR"R ltRtR tRtR tR tR tR t^ tR tR#R ltR tR tR tR#R ltR tR t R t!R t"R t#R t$R t%R t&R t'V t(R# )$ModifiedInterpreteri  c                    Wn         \        P                  R ,          P                  p\        P
                  ! WR7       RV n        RV n        \        V n	        V P                  P                  P                  V n        R# )r   )localsFN)	tkconsolesysmodules__dict__r
   rJ   
restartingsubprocess_arglistPORTportcompilecompilerflagsoriginal_compiler_flags)rF   r  r  s   && r&   rJ   ModifiedInterpreter.__init__  sW    "Z(11''<"&	'+||'<'<'B'B$r.   Nc                    V P                   f   V P                  4       V n         \        \        P                  RR7      p\
        P                  ! V P                   VR7      V n        R # )Ndumb)TERM)env)r  build_subprocess_arglistdictrQ   environ
subprocessPopen
rpcsubproc)rF   r(  s   & r&   spawn_subprocess$ModifiedInterpreter.spawn_subprocess  sI    ""*&*&C&C&ED#2::F+$**4+B+BLr.   c                6   V P                   ^ 8w  g   Q R4       h\        P                   Uu. uF  pRV,           NK  	  pp\        P                  ! RRRRRR7      pR	V: R
2p\        P
                  .V,           RV\        V P                   4      .,           # u upi )r   z/Socket should have been assigned a port number.z-WmainGeneralzdelete-exitfuncFbool)defaulttypez#__import__('idlelib.run').run.main()-c)r  r  warnoptionsr   	GetOption
executabler   )rF   sr   	del_exitfcommands   &    r&   r)  ,ModifiedInterpreter.build_subprocess_arglist  s    		1 	?=	?"/!TAXX/ &&vy:K/46C	7	}AF!#tWc$))n&EEE 0s   Bc                b   \         V P                  3p\        ^4       F*  p\        P                  ! V4        \        V4      V n         M	  V P                  4        R# V P                  P                  P                  4       ^,          V n        \        ^ 8w  dD   V P                  P                  P                  \        P                  \        P                  ^4       V P!                  4        V P                  P                  P#                  ^
4        V P                  P%                  4        T P                  P+                  RT P,                  4       T P                  P+                  RT P,                  P.                  4       T P                  P+                  RT P,                  P0                  4       T P                  P+                  RT P,                  P2                  4       T P                  P+                  RT P,                  P4                  4       T P                  P+                  R\6        4       T P                  P+                  RT 4       T P9                  R	R
7       T P;                  4        T P                  #   \         d     EKm  i ; i  \&         d    T P)                  4         R# i ; i)   Nconsoler   stdoutstderrrO   r4   ro   Twith_cwd)HOSTr  r   timesleepr   rpccltr!   display_port_binding_errorlistening_sockgetsocknamer  
setsockoptsocket
SOL_SOCKETSO_REUSEADDRr/  
settimeoutacceptTimeoutErrordisplay_no_subprocess_errorregisterr  r   rC  rD  rO   r4   transfer_pathpoll_subprocess)rF   addris   &  r&   start_subprocess$ModifiedInterpreter.start_subprocess  s   dii qAJJqM)$/	  ++-KK..::<Q?	19
 KK&&11&2C2C+1+>+>C 	""--b1	KK  	Y7Wdnn&:&:;Xt~~'<'<=Xt~~'<'<=Wdnn&:&:;[)4Xt,D){{C  *  	,,.	s#   I<J <JJJ.-J.c                J   V P                   '       d   V P                  # R V n         V P                  4       pV'       d"    \        P                  ! V P                  4       V P                  P                  4        V P                  4        V P                  pRVn        V P                  4         V P                  P                  4        T P                  TR7       TP                  4        TP                  P!                  RR4       TP#                  R4       TP#                  \%        TP&                  T4      4       TP                  P)                  RR4       TP                  P+                  RR4       T'       g   TP-                  4        T'       d1   \        P.                  ! T P                  4       TP1                  4        T P2                  T P4                  P6                  n        RT n         T P                  #     EL; i  \         d    T P                  4         R# i ; i)	TFNrE  r   end-1cr   restartleft)r  rJ  getdebuggerr   close_subprocess_debuggercloseterminate_subprocessr  	executingr/  rS  rT  rU  rW  stop_readlinerK   r   r   r  r	  mark_setmark_gravity
showpromptrestart_subprocess_debuggerload_breakpointsr#  r   r!  r"  )rF   rF  r$   rq   rB  s   &&&  r&   restart_subprocess&ModifiedInterpreter.restart_subprocess  s   ???;;  "44T[[A 	!!#..!	KK  	H-Hh/dl7==(;<i2!!)V4 224;;?""$&*&B&B#{{?  	,,.	s    G; -H ;H H"!H"c                B    V P                   P                  R RR/ 4       R# )execinterrupt_the_serverNr   )rJ  
remotecallr   s   &r&   __request_interrupt'ModifiedInterpreter.__request_interrupt  s    v'=r2Fr.   c                d    \         P                  ! V P                  R 7      P                  4        R# ))targetN)	threadingThread'_ModifiedInterpreter__request_interruptstartr   s   &r&   interrupt_subprocess(ModifiedInterpreter.interrupt_subprocess!  s     8 89??Ar.   c                   V P                   e0   V P                  P                  P                  V P                   4        V P                  P
                  P                  4         V P                  P                  4        V P                  4        RV P                  n	        R V n        R #   \         d     LRi ; i  \         d     LHi ; i)NF)
_afteridr  rK   after_cancelrJ  rL  rc  r    rd  re  r   s   &r&   kill_subprocess#ModifiedInterpreter.kill_subprocess$  s    ==$NN,,T]];	KK&&,,.	KK 	!!##(   		  		s#   $B( $B9 (B65B69CCc                     V P                   P                  4         V P                   P                  4        R#   \         d     R# i ; i  \         d     R# i ; i)z"Make sure subprocess is terminatedN)r.  killwaitr!   r   s   &r&   rd  (ModifiedInterpreter.terminate_subprocess3  sQ    		OO  "
$$&   		s    A 9 AAAAc                    V'       d$   R .pVP                  \        P                  4       M\        P                  p\        V4      pV P	                  RP                  V4      4       R# )r_   zTif 1:
        import sys as _sys
        _sys.path = {!r}
        del _sys
        
N)extendr  rR   r  
runcommandformat)rF   rF  rR   s   && r&   rW  !ModifiedInterpreter.transfer_path@  sK    4DKK!88DT"  fTl		r.   c                   V P                   pVf   R #  VP                  V P                  RR7      pV'       d   V P                  P                  4        R V n        Vw  r4V P                  P                  pVR8X  d   Ve   \        \        V4      VR7       MjVR8X  d3   V P                  P                  R4      '       d   V P                  4        M1VR8X  d+   Rp\        Wd\        P                   R7       \        WdVR7        V P                  P#                  4        V P                  P                  '       gL   V P                  P&                  P)                  V P                  P*                  V P,                  4      V n        R # R #   \        \        \
        3 d6    T P                  P                  '       d    R # R pT P                  4         ELi ; i  \$         d     Li ; i)	Ng?)r  OKr   	EXCEPTION<<toggle-jit-stack-viewer>>ERRORz/pyshell.ModifiedInterpreter: Subprocess ERROR:
)rJ  pollresponse
active_seqr  r!   KeyboardInterruptr  closingrl  resetoutputrB  printreprgetvarremote_stack_viewerr  
__stderr__endexecutingr    rK   afterpollintervalrX  r}  )rF   cltresponsehowwhatrB  errmsgs   &      r&   rX  #ModifiedInterpreter.poll_subprocessP  s~   kk;	&''d'CH NN&&("DO ICnn,,Gd{#$t*73#>>(()FGG,,.Kf8f1++- ~~%%% NN//55++T-A-ACDM &9 '#45 	& ~~%%%H##%	&2 " s)   F G 1G9GGG G c                    Wn         R # rC   r   )rF   r   s   &&r&   setdebuggerModifiedInterpreter.setdebuggerx  s     r.   c                    V P                   # rC   r   r   s   &r&   ra  ModifiedInterpreter.getdebugger{  s    }}r.   c                f    V P                   P                  P                  RV P                  4       R# )ab  Initiate the remote stack viewer from a separate thread.

This method is called from the subprocess, and by returning from this
method we allow the subprocess to unblock.  After a bit the shell
requests the subprocess to open the remote stack viewer which returns a
static object looking at the last exception.  It is queried through
the RPC mechanism.

i,  N)r  rK   r  r  r   s   &r&   open_remote_stack_viewer,ModifiedInterpreter.open_remote_stack_viewer~  s'     	!!#t'?'?@r.   c                (   ^ RI Hp V P                  P                  RRR/ 4      pVf'   V P                  P
                  P                  4        R# TP                  V P                  V4      p^ RIH	pH
p \        V P                  P
                  RR7      p\        P                  ! 4       p\        P                  ! VR4      R	,          pV! Wh^ R
7      p	V	P                  P!                  ^RR7       V! V	P"                  RV4      p
V
P%                  4        R# )r   )
debugobj_rro  stackviewerN)ScrolledCanvasTreeNodeIdle)class_normalr`   )bghighlightthicknessboth)expandfill)rO   )idlelibr  rJ  remotequeuer  r   ru   StubObjectTreeItemidlelib.treer  r  Toplevelr   rb   rc   framepackcanvasr  )rF   r  oiditemr  r  r   rf   r`   scnodes   &          r&   r  'ModifiedInterpreter.remote_stack_viewer  s    &kk%%fmZL;NN$$&,,T[[#>9t~~**6:%%'**5(;LI
C1E
QV,		4.r.   c                J    V P                  V4      pV P                  W!4       R# )z1Like runsource() but assumes complete exec sourceN)stuffsourceexecfilerF   sourcer$   s   && r&   
execsourceModifiedInterpreter.execsource  s    ##F+h'r.   c                ^   Vfu   \         P                  ! V4      ;_uu_ 4       pVP                  4       p\        '       d2   R\        P
                  P                  V4       R2V,           R,           pRRR4        \        W!R4      pV P                  V4       R#   + '       g   i     L0; i  \        \        3 dp    T P                  P                  4        \        RT P                  P                  R7       \        P                   ! Y4       T P                  P#                  4         R# i ; i)zExecute an existing fileNz__file__ = r'''z'''
z
del __file__ro  zB*** Error in script or command!
Traceback (most recent call last):r   )tokenizer   readuse_subprocessrQ   rR   r  r   runcodeOverflowErrorSyntaxErrorr  r  r  rD  r
   showsyntaxerrorri  )rF   r$   r  r   codes   &&&  r&   r  ModifiedInterpreter.execfile  s    >x((B!> /0I/J%P &')9:F )

	6V4D LL )( {+ 	(NN&&( 6~~,,. #224BNN%%'	(s   AB:B, B)	,A<D,+D,c                    V P                  V4      p\        V\        4      '       g   Q h\        P                  ! WV4      # )zBExtend base class method: Stuff the source in the line cache first)r  
isinstancer   r
   	runsourcer  s   && r&   r  ModifiedInterpreter.runsource  s:    ##F+&#&&&& &//hGGr.   c                    RV P                   ,          pV P                   ^,           V n         VP                  R4      p\        V4      ^,           ^ W23\        P                  V&   V# )z"Stuff source in the filename cachez<pyshell#%d>r   )gidsplitr   r4   r5   )rF   r  r$   r   s   &&  r&   r  ModifiedInterpreter.stuffsource  sO    !DHH,88a<T"$'KM1e$E	!r.   c                F    V P                  RP                  V4      4       R# )z>Prepend sys.path with file's directory if not already includeda*  if 1:
            _filename = {!r}
            import sys as _sys
            from os.path import dirname as _dirname
            _dir = _dirname(_filename)
            if not _dir in _sys.path:
                _sys.path.insert(0, _dir)
            del _filename, _sys, _dirname, _dir
            
N)r  r  rF   r$   s   &&r&   prepend_syspath#ModifiedInterpreter.prepend_syspath  s      &"	$r.   c                >   V P                   pVP                  pVP                  RRR4       \        P                  ! 4       w  rVp\        VRR4      ;'       g    T;'       g    Rp\        VRR4      ;'       g    ^p	\        VRR4      ;'       g    ^ p
V
^ 8X  d
   V	^,          p	V	^8X  d   R	V
^,
          ,          pMR
V	^,
          V
^,
          3,          pVP                  WK4       VP                  4        V P                  RV,          4       VP                  4        R# )zOverride Interactive Interpreter method: Use Colorizing

Color the offending position instead of printing it and pointing at it
with a caret.

r  r   r   msgr_   z<no detail available>r%   offsetziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
N)
r  rK   r}   r  exc_infor   colorize_syntax_errorr  r   ri  )rF   r$   kwargsr  rK   r6  valuetbr  r%   r  poss   &&,         r&   r  #ModifiedInterpreter.showsyntaxerror  s     NN	~~.,,.ReUB'KK5KK4K"-22"-22Q;aKFQ;%2C:!8VAX&'C''2

&,-r.   c                    V P                   P                  4        V P                  4        \        P                  ! V 4       V P                   P                  R4      '       d   V P                   P                  4        R# R# )z1Extend base class method to reset output properlyr  N)r  r  checklinecacher
   showtracebackr  open_stack_viewerr   s   &r&   r  !ModifiedInterpreter.showtraceback  sX    ""$,,T2>>  !>??NN,,. @r.   c                    \         P                  p\        V4       F  pVR,          VRR ,           R8w  g   K  W K!  	  R# )z%Remove keys other than '<pyshell#n>'.r0   Nr2   r3   )r4   r5   r6   )rF   r5   r;   s   &  r&   r  "ModifiedInterpreter.checklinecache  s5    ;C2wRS!T)J r.   c                    V P                   P                  '       d   V P                  4        ^ # V P                  '       d"   V P                  P	                  RRV3/ 4       ^# \        WP                  4       ^# )z*Run the code without invoking the debuggerro  r  )r  re  display_executing_dialogrJ  r  ro  r  )rF   r  s   &&r&   r  ModifiedInterpreter.runcommand  s\     >>###))+;;;KK##FIwC  {{#r.   c                
   V P                   P                  '       d   V P                  4        V P                  4        V P                  p V P                   P                  4        V'       g4   V P                  e&   V P                  P                  RRV3/ 4      V n        M;V'       d   VP                  ! WP                  4       M\        WP                  4        \$        '       g    V P                   P+                  4        R# R#   \         df    T P                   P                  '       gH   \        P                  ! RRRT P                   P                   R7      '       d   h T P#                  4         Lh  \$        '       dN   \'        RT P                   P(                  R	7       T P#                  4        T P                   P+                  4         LT P                   P,                  '       d6   R
T P                   n        \'        RT P                   P(                  R	7        ELET P#                  4         ELX; i  \.         d     R# i ; i  \$        '       g.    T P                   P+                  4        i   \.         d     i i ; ii ; i)Override base class methodNro  r  zExit?zDo you want to exit altogether?yesr5  r   z IDLE internal error in runcode()r   Fr  )r  re  rl  r  r   beginexecutingrJ  
asyncqueuer  runr  ro  
SystemExitr  r	   askyesnorK   r  r  r  rD  r  canceledr    )rF   r  r   s   && r&   r  ModifiedInterpreter.runcode	  s   >>#####%==&	NN))+ 7"&++"8"89=#ET;;/T;;'4 ">NN//1 "3  	>>)))&&5!>>..	0 0
 &&(	)~8>>002""$++->>***.3DNN+-DNN4I4IJJ&&(
 &  ">NN//1%  "s   
AD I D 'D I D I 'H5 &H2,3H2 H21I 3H2AH2I H2*2H2I H2/I 5IIJI0/J0I>;J=I>>Jc                L    V P                   P                  P                  V4      # )r  )r  rD  r   )rF   r<  s   &&r&   r   ModifiedInterpreter.write7  s    ~~$$**1--r.   c                `    \         P                  ! R RV P                  P                  R7       R# )zPort Binding ErroraA  IDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server.  This might be because no networking is installed on this computer.  Run IDLE with the -n command line switch to start without a subprocess and refer to Help/IDLE Help 'Running without a subprocess' for further details.r   Nr	   r   r  rK   r   s   &r&   rK  .ModifiedInterpreter.display_port_binding_error;  s'     / >>&&	(r.   c                `    \         P                  ! R RV P                  P                  R7       R# )zSubprocess Connection ErrorzIDLE's subprocess didn't make connection.
See the 'Startup failure' section of the IDLE doc, online at
https://docs.python.org/3/library/idle.html#startup-failurer  Nr  r   s   &r&   rU  /ModifiedInterpreter.display_no_subprocess_errorF  s(    )J >>&&	(r.   c                `    \         P                  ! R RV P                  P                  R7       R# )zAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.r  Nr  r   s   &r&   r  ,ModifiedInterpreter.display_executing_dialogN  s%    0>>&&		(r.   )r}  r  r   r  r#  r  r  rJ  r.  r  r  )Fr_   )FrC   ))r   r   r   r   rJ   r}  rJ  r.  r/  r)  r[  rl  rx  rz  r  rd  rW  r  rX  r   r  ra  r  r  r  r  r  r  r  r  r  r  r  r  r  r   rK  rU  r  r   r   r   s   @r&   r  r    s     C HFJM
F)V)VGB J$CL H!" C(
(H
$4/
,\.	((( (r.   r  c            	       ~  a a ] tR tRt o^ RIHt Rt]t]	t
. R6Ot]P                  R7.,           t^]! ]! ]P"                  ! R ]4      4      4      ,           t]P'                  ]R84       ARtRt^ RIHt ^ RIHt R9R	 ltV 3R
 ltV 3R ltR tR tR tR9R lt Rt!Rt"Rt#Rt$Rt%Rt&R t'R t(R9R lt)R t*R9R lt+R t,R t-R t.R t/R t0R t1R t2R t3R t4Rt5R t6R  t7R! t8R" t9R9R# lt:R$ t;R% t<R& t=R' t>]?P                  ! R(4      tAR) tBR9R* ltCR9R+ ltDR9R, ltER- tFR. tGR/ tHR:R0 ltIV 3R1 ltJV 3R2 ltKR9R3 ltLR4 tMR5tNVtOV ;tP# );r   iV  )Squeezerz
IDLE Shellc                    V ^ ,          R8g  # )r   r   r   )
rmenu_items   &r&   r   PyShell.<lambda>n  s    :a=F2r.   Fr   )History)ShellSidebarc                4	   V P                   pV^,          ^ ,          R8w  d   VP                  ^R4       \        V 4      V n        Vf1   \	        4       p\        V4       VP                  4        \        V4      pRV n        \        P                  ! WRR4       RV n        ^V n        \        \        R4      '       d   \        P                  MRV n        V P                   P#                  R4      R,          V n        V P                   V n        V P(                  pVP+                  RR7       VP-                  R	V P.                  4       VP-                  R
V P0                  4       VP-                  RV P2                  4       VP-                  RV P4                  4       VP-                  RV P6                  4       VP-                  RV P8                  4       VP-                  RV P:                  4       VP-                  RV P<                  4       \>        '       d9   VP-                  RV P@                  4       VP-                  RV PB                  4       T PE                  V 4      V n#        VP-                  RV PH                  4       \        PJ                  V n&        \        PN                  V n(        \        PR                  V n*        ^ RI+H,p \[        V RVP\                  VP^                  4      V n)        \a        V RVP\                  VP^                  4      V n%        \a        V RVP\                  R4      V n'        \a        V RVP\                  VP^                  4      V n1        \>        '       g@   V PJ                  \        n%        V PN                  \        n'        V PR                  \        n)         ^ RI2pVPf                  Vn4        T Pm                  T P(                  4      T n7        ^2T n8        T Ps                  T 4      T n        T Pt                  Pv                  P                  T P(                  n        T Pt                  Py                  \{        4       4       \>        '       g)   T P}                  R^ R4       T P}                  R^R4       R# R#    \        Pj                  \        n'        h ; i)   shellNFps1z>>>
r   char)wrapz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>><<toggle-debugger>>r  <<copy-with-prompts>>z<<view-restart>>z<<restart-shell>><<squeeze-current-text>>)iomenur   rC  rD  backslashreplacerB  disabled)r  She_llr3   )?
menu_specsrt   r  ro   Tkr   withdrawr   shell_sidebarr   rJ   usetabsindentwidthhasattrr  r  sys_ps1r  prompt_last_linepromptrK   	configurerL   enter_callbacklinefeed_callbackcancel_callbackeof_callbackr  toggle_debuggertoggle_jit_stack_viewercopy_with_prompts_callbackr  view_restart_markrestart_shellr  squeezersqueeze_current_text_eventrC  save_stdoutrD  save_stderrr   
save_stdinr  r  r   r   r   r   rB  pydoc
plainpagerpagerr  r  historyr  r  perr   insertfilterr   update_menu_state)rF   rO   msr   rK   r  r7  s   &&     r&   rJ   PyShell.__init__|  sZ   __a58wIIa,-)$/=4DD!MMO#D)E!d46")#u"5"5sww7 $ 2 24 8 <llyyF#		*D,?,?@		0$2H2HI		+T-A-AB		#T%6%67		)4+A+AB		')=)=>		/1M1MN		)4+J+JK>II($*@*@AII)4+=+=>d+		,11	3 ::::))"!$"(//6==B
#D($*OOV]]D#D($*OO5GI$T9%+__fmmE~CJCJ

CI	**EK
 ||DII.!..t4
  88<<..		79:~""7Az:""7Az: !	CJs   !Q; ;Rc                x   < \         SV `  4        V P                  e   V P                  P                  4        R # R # rC   )r   	ResetFontr!  update_fontrF   r   s   &r&   rA  PyShell.ResetFont  s1    )**, *r.   c                  < \         SV `  4        \        P                  ! 4       pR RRRR/R\        P                  ! VR4      R\        P                  ! VR4      R\        P                  ! VR4      /pVP                  4        F"  w  r4V P                  P                  ! V3/ VB  K$  	  V P                  e   V P                  P                  4        R# R# )r   r`   Nr^   rC  rD  rB  r  )
r   ResetColorizerr   rb   rc   itemsrK   tag_configurer!  update_colors)rF   rf   
tag_colorsr   tag_colors_configr   s   &    r&   rF  PyShell.ResetColorizer  s     %%'
L$d;
H))%:
H))%:
X**5(;	

 '1&6&6&8"CII##C=+<= '9 ),,. *r.   c                J    \         P                   ! V P                  R R7       R# )r   )insert_tagsr]   )r   rK   r   s   &&r&   replace_eventPyShell.replace_event  s    		w7r.   c                0    \         P                  ! R R7      # )T)
shell_only)r   GetExtensionsr   s   &r&   get_standard_extension_names$PyShell.get_standard_extension_names  s    %%66r.   c                v   V P                   P                  W4      p\        \        \	        V4      4      \        \	        V4      4      4      pV Uu. uF(  pV P
                  P                  P                  V4      NK*  	  ppRP                  R \        WcP                  4       4       4       4      R,           # u upi )z6Return text between first and last with prompts added.r   c              3   @   "   T F  w  rVf   TMV RV 2x  K  	  R # 5i)N r   ).0r'  r   s   &  r&   	<genexpr>*PyShell.get_prompt_text.<locals>.<genexpr>  s-      
 ? ND6(!D6(:: ?s   )
rK   getr   rv   rw   r!  line_promptsrS   zip
splitlines)rF   firstlastrK   lineno_ranger%   promptss   &&&    r&   get_prompt_textPyShell.get_prompt_text  s    yy}}U)ed '
& ++//7& 	 
 yy 
 #G__-> ?
 
  		
s   .B6c                   V P                   pVP                  R4      pVf   R# VP                  R4      pVR,          R8w  d   VP                  R4      pVP                  4        V P                  W44      pVP	                  V4       R# )zCopy selected lines to the clipboard, with prompts.

This makes the copied text useful for doc-tests and interactive
shell code examples.

This always copies entire lines, even if only part of the first
and/or last lines is selected.
zsel.first linestartNsel.last0zsel.last+1line linestartr3   )rK   rk   clipboard_clearrd  clipboard_append)rF   rx   rK   selfirstsellastprompt_texts   &&    r&   r/  "PyShell.copy_with_prompts_callback  sx     yy::34**Z(2;#jj!;<G**8=k*r.   c                
    Vs R # rC   r   )rF   streams   &&r&   set_warning_streamPyShell.set_warning_stream  s    r.   c                    \         # rC   rp  r   s   &r&   get_warning_streamPyShell.get_warning_stream  s    r.   c                   V P                   '       d6   \        P                  ! R RV P                  R7       V P	                  4        R# V P
                  P                  4       pV'       d   V P                  4        R# V P                  4        R# )zDon't debug nowz*You can only toggle the debugger when idler  r]   N)	re  r	   r   rK   set_debugger_indicatorro   ra  close_debuggeropen_debugger)rF   rx   dbs   && r&   r-  PyShell.toggle_debugger  sd    >>>  !2<yy" '')((*B##%""$r.   c                f    V P                   P                  4       pV P                  R V'       4       R# )r  N)ro   ra  setvarrF   r{  s   & r&   rx  PyShell.set_debugger_indicator,  s%    [[$$&)2v6r.   c                    R # rC   r   r   s   &&r&   r.  PyShell.toggle_jit_stack_viewer0  s    r.   c                   V P                   P                  4       pV'       d   V P                   P                  R 4       VP                  4        V P                   P                  '       d+   \
        P                  ! V P                   P                  4       V P                  4        V P                  P                  R4       V P                  V n        V P                  4        V P                  4        R # )Nz[DEBUG OFF]
)ro   ra  r  rc  rJ  r   close_remote_debuggerr  rB  r   r%  r'  ri  rx  r  s   & r&   ry  PyShell.close_debugger3  s    [[$$&KK##D)HHJ{{!!!001C1CDLL/,,DKOO##%r.   c                   V P                   P                  '       d-   \        P                  ! V P                   P                  V 4      pM\        P
                  ! V 4      pV P                   P                  V4       VP                  4        R V P                  ,           V n	        V P                  4        V P                  4        R# )z[DEBUG ON]
N)ro   rJ  r   start_remote_debuggerr   Debuggerr  rk  r%  r'  ri  rx  )rF   dbg_guis   & r&   rz  PyShell.open_debugger@  s    ;; 66t{{7I7I;?AG ''-G(  "$t||3##%r.   c                X    V P                   '       d   R MRpV P                  RRV4       R# )r  r  rq   z*tack*iewerN)re  r=  )rF   states   & r&   debug_menu_postcommandPyShell.debug_menu_postcommandL  s#    "nnn
(wu=r.   c                4    V P                  4        RV n        R# )Helper for ModifiedInterpreterTN)r  re  r   s   &r&   r  PyShell.beginexecutingP  s    r.   c                B    RV n         RV n        V P                  4        R# )r  FN)re  r  ri  r   s   &r&   r  PyShell.endexecutingU  s    r.   c                    V P                   '       d-   \        P                  ! RRRV P                  R7      pVRJ d   R# V P	                  4        RV n        RV n        \        P                  ! V 4      # )zExtend EditorWindow.close()zKill?z7Your program is still running!
 Do you want to kill it?okr  FcancelT)	re  r	   askokcancelrK   rf  r  r  r   rc  )rF   r  s   & r&   rc  PyShell.close[  sc    >>>!--Jyy	"H
 5 !!$''r.   c                h   V P                  4        \        '       d   V P                  P                  4        V P                  \
        n        V P                  \
        n        V P                  \
        n
        RV n        RV n        RV P                  n        RV n        \        P                   ! V 4       R# )zEExtend EditorWindow._close(), shut down debugger and execution serverN)ry  r  ro   r  r4  r  rC  r5  rD  r6  r   rB  rO   rn   r:  r   r   r   s   &r&   r   PyShell._closej  sw    >KK'')%%
%%
OO	!

D!r.   c                    R# )z8Override EditorWindow method: never remove the colorizerTr   r  s   &&r&   ispythonsourcePyShell.ispythonsourcez  s    r.   c                    V P                   # rC   )shell_titler   s   &r&   short_titlePyShell.short_title~  s    r.   z>Enter "help" below or click "Help" above for more information.c           
         V P                   P                  R R4       V P                  4        \        '       d8   RpV P                  P                  4       pV'       g   V P                  4        R# MR	p\        P                  \        n        V P                  R\        P                  : R\        P                  : RV P                  : RV: 24       V P                   P                  4        V P                  4        ^ RIpRVn        RVn        R# )
r   rt   r_   FzPython z on r   NTz==== No Subprocess ====

WARNING: Running IDLE without a Subprocess is deprecated
and will be removed in a later version. See Help/IDLE Help
for details.

)rK   rg  r  r  ro   r[  rc  r   displayhookr  r   versionplatform
SPLASHLINEfocus_forceri  tkinter_support_default_root_default_root)rF   nosubclientr  s   &   r&   r   PyShell.begin  s    		8X.>E[[113F

 'E "ooCO

KKtG 	H		(,% $r.   c                p    V P                   '       g   R # RV n        V P                  P                  4        R # )NT)reading_stop_readline_flagr   quitr   s   &r&   rf  PyShell.stop_readline  s#    |||#' r.   c                   V P                   p R V n         V P                  P                  4        Wn         V P                  '       d
   RV n        R# V P                  P                  RR4      p\        V4      ^ 8X  d   RpV P                  4        V P                  '       d   RV n        \        '       g   \        hV P                  '       d
   RV n        RpV#   Yn         i ; i)TFr_   r   r^  r   )r  r   mainloopr  rK   r\  r   r  r  r  r  	endoffile)rF   r:   r   s   &  r&   readlinePyShell.readline  s    ||	 DLHHL###',D$yy}}Xx0t9>D===!DM!>''>>>"DND  Ls   !C Cc                    R # r   r   r   s   &r&   isattyPyShell.isatty  s    r.   c                    V P                   P                  R RR4      '       d   R#  T P                  '       gP   T P                  '       g>   T P	                  4        T P
                  P                  R4       T P                  4        R# RT n        RT n	        T P                  '       dr   T P
                  P                  '       dV   T P
                  P                  4       '       d   T P
                  P                  4        MT P
                  P                  4        T P                  '       d   T P                  P                  4        R#     EL%; i)	sel.firstz!=rg  NzKeyboardInterrupt
r]   FT)rK   r   re  r  r  ro   r   ri  r  r  rJ  ra  rl  rz  r   r  r   s   &&r&   r+  PyShell.cancel_callback  s    	yy  dJ?? @ $,,,KK34OONNNt{{111{{&&((..0002<<<HHMMO!	s   "E Ec                   V P                   '       d   V P                  '       g   R # V P                  P                  RRR4      '       d$   V P                  P                  RRR4      '       g   R # V P                   '       g#   V P	                  4        V P                  4        R# RV n        RV n        V P                  P                  4        R# )Nr   z==rt   r^  FTr]   )
re  r  rK   r   r  rc  r  r  r   r  r   s   &&r&   r,  PyShell.eof_callback  s    >>>$,,,		!!(D(;;		!!(D(;;~~~JJL
  "DM!DNHHMMOr.   c                    V P                   '       d:   V P                  P                  R R4       V P                  P                  R 4       R# V P	                  V4       R# )rt   r   r]   )r  rK   rt   seenewline_and_indent_eventr   s   &&r&   r*  PyShell.linefeed_callback  sG    <<<IIXt,IIMM(#  ))%0r.   c                N   V P                   '       d   V P                  '       g   R #  V P                  P                  RR4      pV'       d7   V P                  P	                  RRR4      '       d   V P                  W!4       R# T P                  P	                  RRR4      '       Ed^   T P                  P                  R	R4      pT'       Edw   T P                  P	                  RRT^,          4      '       EdL   R
T P                  P                  R4      9  Ed+   T P                  P                  R
R4      pT'       dD   T P                  P	                  T^,          RT^ ,          4      '       d   T^,          T^,          3pT P                  P                  R
R4      pT'       dd   T P                  P	                  T^ ,          RT^,          4      '       d3   T^ ,          T P                  P                  T^ ,          R,           4      3pT P                  T P                  P                  T^ ,          T^,          4      T4       R# T P                  P                  R	R4      pT'       d   T P                  P	                  RRT^ ,          4      '       d   T P                  P                  R
R4      pT'       dd   T P                  P	                  T^ ,          RT^,          4      '       d3   T^ ,          T P                  P                  T^ ,          R,           4      3pT P                  T P                  P                  T^ ,          T^,          4      T4       R# T P                  P                  R
R4      pT'       d`   T P                  P	                  T^ ,          RR4      '       d6   T P                  T P                  P                  T^,          R4      T4       R# T P                  T P                  P                  RR4      T4       R# T P                  P	                  RRR4      '       d   T P                  P                  RR4       T P                  P                  RR4      pT'       d3   TP                  4       '       g   T P                  P                  RR4       T P                  P	                  RRR4      '       d   T P                  T4       R# T P                  P                  RR4       T P                  '       d9   T P                  P                  RR4       T P                  P                  R4       MT P                  T4       T P                  P!                  4        T P                  '       d   T P"                  P%                  4        R# T P'                  4        R#     EL"; i)Nr  rg  z<=r   r]   rt   r   iomark linestartr   rB  z>=z+1czinsert lineendr{   r^  zend-1c linestartr   )re  r  rK   r\  r   recalltag_prevrange	tag_namestag_nextrangerk   rg  stripr   r  rt   r  update_idletasksr   r  runit)	rF   rx   selprev	prev_cons	next_consnextindicesr<  s	   &&       r&   r)  PyShell.enter_callback  s   >>>$,,,	))--Z8C99$$Zx@@KK+" 99Xs,>??
 99**7H=DDII%%hT!W==TYY%8%8%BB II33IxH	!2!29Q<tAw!O!O%aL$q'2D II33IxH	!2!29Q<d1g!N!N GTYY__Yq\E5I%JKDDIIMM$q'47;UC99**7H=D		))*:D$q'JJ II33I?OP	!2!29Q<d1g!N!N GTYY__Yq\E5I%JKDDIIMM$q'47;UCii--i9KLGyy  T3EFFDIIMM'!*6FGO  DIIMM*<>NOQVW 99XsH55IIx2 IIMM(H-QWWYYIIXx0 99Xs,>??))%0		8X.<<<IIXt,IIMM(#))%0		""$<<<HHMMO  JJLE	s   #V "V /V V$c                   \         P                  ! R RV4      p\         P                  ! RRV4      pVP                  R4      pV P                  P	                  4         V P                  P                  RRR4       V P                  P                  RR4       V P                  P                  R	R4      pVP                  4       P                  R
4      '       d.   V P                  V4       V P                  P                  R	R4      pV P                  P                  RV^ ,          P                  4       V P                  4       \        V4      ^8  d   \         P                  ! RV^ ,          4      P!                  ^ 4      p\         P                  ! RV4      P!                  ^ 4      pVR,           Fj  pVP#                  V4      '       d   Wg\        V4      R ,           pV P                  P                  RRVP                  4       ,           V P                  4       Kl  	  V P                  P%                  R4       V P                  P'                  4        R#   T P                  P%                  R4       T P                  P'                  4        i ; i)z^\s*\nr_   z\n\s*$r   r  r   r   rt   r^  r{   :z	^([ \t]*)r1   NNN)resubr  rK   undo_block_startr}   rg  r\  rstripendswithr  rt   r  user_input_insert_tagsr   searchgroupr   r  undo_block_stop)rF   r<  rx   r   prefixorig_base_indentnew_base_indentr   s   &&&     r&   r  PyShell.recall:  s   FF9b!$FF9b!$		""$	(II  u5IIx2YY]]#5x@F}}'',,--e4'98DIIXuQx~~'7!88:5zA~#%99\58#D#J#J1#M #%99\6#B#H#H#K!"IID'788.c:J6K6L1MMII$$Xtdkkm/C%)%@%@B	 & IIMM(#II%%' IIMM(#II%%'s   A9I EI 7Jz[ \t]*(\n[ \t]*)?\zc                   V P                   P                  R 4      pV P                   P                  RR4      pV P                  P	                  RV4      pV P
                  P                  V4      pV'       gc   V P                   P                  V4      R8X  d'   V P                   P                  V P                  V4       V P                  P                  4        R# R# )end-2cr   r^  r_   r   N)rK   rk   r\  _last_newline_rer  ro   r  r}   r  r!  update_sidebar)rF   index_beforer   input_is_completes   &   r&   r  PyShell.runitW  s    yyx0yy}}Xx0 $$((T2 KK11$7 yy}}\*d2		$$T%@%@,O--/ !r.   c                .   V P                   P                  '       d   V P                   P                  4       # ^ RIHp  V! V P
                  \        P                  V P                  4       R#    \        P                  ! RRT P                  R7        R# ; i)r   )StackBrowserzNo stack tracez:There is no stack trace yet.
(sys.last_exc is not defined)r  N)ro   rJ  r  idlelib.stackviewerr  r   r  last_excrO   r	   r   rK   )rF   rx   r  s   && r&   r  PyShell.open_stack_viewerc  ss    ;;;;22444	"CLL$**= 	"  !10yy" s   ,A, ,%Bc                r    V P                   P                  R 4       V P                   P                  R4       R# )r   r_  N)rK   r  r   s   &&r&   r0  PyShell.view_restart_markq  s"    		h		i r.   c                >    V P                   P                  RR7       R# )z&Callback for Run/Restart Shell Cntl-F6TrE  N)ro   rl  r   s   &&r&   r1  PyShell.restart_shellu  s    &&&5r.   c                   V P                  4        V P                  pV P                  '       d;   VP                  V P                  4      '       d   VR \	        V P                  4      )  pV P
                  P                  RR4       V P                  P                  V4       V P                  P                  4        V P
                  P                  RR4       V P                  4        V P                  P                  4        R # )NrB  z	iomark-1crt   r^  )r  r'  r%  r  r   rK   rj   rB  r   r!  r  rg  set_line_and_columnrV   
reset_undo)rF   r'  s   & r&   ri  PyShell.showprompty  s    <<<FOODLL99/c$,,//0F		)[16"))+		8X.  "r.   c                0   V P                   P                  P                  p\        V^RR7      pRP	                  VP                  V4      4      pVP                  R4      '       g
   VR,          pV P                  P                  P                  RVR4       R# )   T)r	  tabsizeexpand_tabsr   r  rD  N)
ro   r  r	  r   rS   r  r  r;  bottomrt   )rF   r  r	  wrapperwrapped_msgs   &&   r&   show_warningPyShell.show_warning  sr    %%++E1$GiiS 12##D))4K1;Ir.   c                   V P                   P                  R R4      pV P                  '       d   V P                  P                  V4       V P                   P                  R4      R8w  d   V P                   P	                  RR4       V P                   P                  R R4       V P                  4        V P                  P                  4        R# )r   r^  r  r   N)	rK   r\  r:  storert   rg  r  ctipremove_calltip_window)rF   r  s   & r&   r  PyShell.resetoutput  s    x2<<<LLv&99=="d*IIXt,		8X.  "		'')r.   c                
    V P                   P                  R R4       \        P                  ! WVR 4      pV P                   P                  R R4       T P                  '       d   RT n        \
        '       g   \        hT#    h ; i)r   rightr`  F)rK   rh  r   r   r  r  r  )rF   r<  r   counts   &&& r&   r   PyShell.write  so    	II""8W5 &&th?EII""8V4 ===!DM!>''	s   AA? ?Bc                   <  V P                   P                  R RR4      '       d   R#  \        ST `  4       #   \         d     R# i ; i)r  r   r   r  )rK   r   r   r   r   rC  s   &r&   r   PyShell.rmenu_check_cut  sM    	yy  c8<<! = w&((  		s   "7 AAc                j   < V P                   P                  R RR4      '       d   R# \        SV `  4       # )rt   r   r   r  )rK   r   r   r   rC  s   &r&   r   PyShell.rmenu_check_paste  s-    99Xc(33w(**r.   c                n    V P                   P                  4        V P                  P                  4        R # rC   )r2  squeeze_current_textr!  r  r   s   &&r&   r3  "PyShell.squeeze_current_text_event  s$    **,))+r.   c                :    V P                   P                  4        R # rC   )r!  r  )rF   rk   rK   r   s   &&&&r&   on_squeezed_expandPyShell.on_squeezed_expand  s    ))+r.   )r  r  r  rB  r  re  r:  r#  ro   r  r'  r&  r  r5  r6  r4  r!  r2  rD  r   rC  r%  r"  ))r   _File)edit_Edit)rq   _Debug)options_Options)window_Window)help_Help)Squeezer  )zCopy with promptsr  r   rC   )r   )Qr   r   r   r   idlelib.squeezerr  r  r   r   r   r   r  r   r   r   r6   	itertools	takewhile_idxrt   allow_line_numbersr  idlelib.historyr  idlelib.sidebarr  rJ   rA  rF  rO  rT  rd  r/  r  re  r  r  r  r  rr  ru  r-  rx  r.  ry  rz  r  r  r  rc  r   r  r  r  r   rf  r  r  r+  r,  r*  r)  r  r  r   r  r  r  r0  r1  ri  r  r  r   r   r   r3  r  r   r   r   r   s   @@r&   r   r   V  s    )K ,N)MJ **/. K s4	++2KA   D t 2 3 	$ (,P;d-/ 7"+( GIHIG %7&
&>
("   RJ4.,M^(8 zz"89
0!6J*)+
,, ,r.   r   a  
USAGE: idle  [-deins] [-t title] [file]*
       idle  [-dns] [-t title] (-c cmd | -r file) [arg]*
       idle  [-dns] [-t title] - [arg]*

  -h         print this help message and exit
  -n         run IDLE without a subprocess (DEPRECATED,
             see Help/IDLE Help for details)

The following options will override the IDLE 'settings' configuration:

  -e         open an edit window
  -i         open a shell window

The following options imply -i and will open a shell:

  -c cmd     run the command in a shell, or
  -r file    run script from file

  -d         enable the debugger
  -s         run $IDLESTARTUP or $PYTHONSTARTUP before anything else
  -t title   set title of shell window

A default edit window will be bypassed when -c, -r, or - are used.

[arg]* are passed to the command (-c) or script (-r) in sys.argv[1:].

Examples:

idle
        Open an edit window or shell depending on IDLE's configuration.

idle foo.py foobar.py
        Edit the files, also open a shell if configured to start with shell.

idle -est "Baz" foo.py
        Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
        window with the title "Baz".

idle -c "import sys; print(sys.argv)" "foo"
        Open a shell window and run the command, passing "-c" in sys.argv[0]
        and "foo" in sys.argv[1].

idle -d -s -r foo.py "Hello World"
        Open a shell window, run a startup script, enable the debugger, and
        run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
        sys.argv[1].

echo "import sys; print(sys.argv)" | idle - "foobar"
        Open a shell window, run the script piped in, passing '' in sys.argv[0]
        and "foobar" in sys.argv[1].
c            	         ^ RI p ^ RIHp ^ RIHp ^ RIHp ^ RIHpHp \        R4       Rs
RpRpRpRp	Rp
Rp V P                  \        P                  R,          R	4      w  rX EF  w  ppVR8X  d   Tp	RpVR8X  d   RpRpVR8X  d   RpVR8X  d9   \        P$                  P'                  \        4       \        P"                  ! 4        VR8X  d   RpVR8X  d   \        R\        P                   R7       Rs
VR8X  dL   Tp
\(        P*                  P-                  V
4      '       d   M!\        RV
4       \        P"                  ! 4        RpVR8X  d   RpRpVR8X  g   K  V\.        n        RpEK  	  X'       d/   V^ ,          R8X  d!   \        P2                  P5                  4       p	Rp\7        \9        \        P*                  4      4       FH  p\(        P*                  P;                  \        P*                  V,          4      \        P*                  V&   KJ  	  V'       d+   V^ ,          R8X  d   R.VR,          ,           \        n        EM&V	'       d   R.V,           \        n        EM	V
'       d   V
.V,           \        n        MV'       d   Rp. pV F1  pVP=                  \(        P*                  P?                  V4      4       K3  	  V FY  p\(        P*                  P;                  V4      pV\        P*                  9   d   K9  \        P*                  PA                  ^ V4       K[  	  MJ\(        PB                  ! 4       pV\        P*                  9  d!   \        P*                  PA                  ^ V4       \D        PF                  ! RRRRR7      pT;'       g    TpT;'       g    V'       * p\        '       d   V'       g   \I        4        \K        RR 7      s&\L        PO                  4        V! \L        4       \(        P*                  PQ                  \(        P*                  P?                  \R        4      R!4      pV! 4       R"8X  d8   \(        P*                  PQ                  VR#4      p\L        PU                  VR$7       MVPW                  4       '       g   \X        R%8  d   R&pR.pMR'pR/pV Uu. uF,  p\(        P*                  PQ                  VR(VV3,          4      NK.  	  ppV Uu. uF  p\[        \L        VR)7      NK  	  pp\L        P\                  ! R.VO5!   \_        \L        4       V! \L        4       \a        \L        4      s1VPe                  \L        \b        4       V'       dg   V	'       g_   V
'       gW   VR*,           F-  p\b        Pg                  V4      e   K  VPi                  V4       K/  	  V'       g   \b        Pk                  4        V'       df   \b        Pm                  4       pV'       g   R# VPW                  4       '       d1   \b        Pn                  '       d   VPp                  Ps                  4        M\b        Pt                  pV'       d   VPw                  4        V'       d   \(        Px                  P{                  R+4      ;'       g     \(        Px                  P{                  R,4      pV'       dA   \(        P*                  P-                  V4      '       d   VP|                  P                  V4       V	'       g	   V
'       d   VP|                  P                  R-P                  \        P                  4      4       V	'       d   VP|                  P                  V	4       MpV
'       d7   VP|                  P                  V
4       VP|                  P                  V
4       M1V'       d*   VP                  4       pV'       d   VP                  V4       \b        P                  '       d   \L        P                  4        K,  \L        P                  4        \        R4       R#   T P                   dG   p\        R
T R\         2\        P                   R7       \        P"                  ! ^4        Rp?ELRp?ii ; iu upi u upi )0r   N)system)testing)macosx)fix_scalingfix_x11_pasteTFr  zc:deihnr:st:zError: r   r   r8  z-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-t-r_   r2  r3  zeditor-on-startupr4  )r6  r  )	classNameIconsWindowszidle.ico)r5  g333333!@z.pngz.gifz	idle_%d%s)masterr   :NNNIDLESTARTUPPYTHONSTARTUPzdif 1:
            import sys as _sys
            _sys.argv = {!r}
            del _sys
            
)       0      )r3  r4  r5  )Igetoptr  r'  r  r(  r)  idlelib.utilr*  r+  r-   r  r  argverrorr  	usage_msgrD  exitrC  r   rQ   rR   r   r   r  r   r  r   r   r  rm   r  rt   getcwdr   r:  NoDefaultRootr  r   r   rS   r  wm_iconbitmapisAquaTk	TkVersion
PhotoImagewm_iconphotor   r   rO   setupAppr   r|   newrP   r*  r   lowerrn   rz  r+  r\  ro   r  r  r  r  r  preferTabsPreferenceWarningr  inversedictr  destroy)r7  r'  r(  r)  r*  r+  enable_shellenable_editrq   cmdscriptstartupoptsrZ   r  oarZ  pathxr$   dir
edit_starticondiriconfileextsizessize	iconfilesiconsr  prefer_tabs_preference_warnings                                  r&   r2  r2    s   7 TNLKE
CFG]]388B<@
 19CL9EL9K9JJY'HHJ9L9Nzz#"N9Fww~~f%%(&1
L9GL9"#GL? @ Q3iinn3sxx=!ggoochhqk2 "Q34$r(?	6D=	8d?	HLL23 C''//#&C#((?3' 
 iikchhHHOOAs###FI$7fFJ++K22{?L ~gDMMO ggll277??84g>Gx977<<48,__C%EC E!&(!& WW\\';$+DE!& 	 ( "+,!*X 4h7!* 	 ,$'' D$D!E
OOD% v GG::h'/KK) $ 		  "??
 IIOO ::>>-0 3 3::>>/2 	x00LL!!(+
f ! &"		$
 LL##C(LL((0LL!!&)	 *0)K)K)M&)=>



LLNUw << uByk*<l(,s#   )` 2a)a.a& ;a!!a&)NN)Mr  r   r  r  ImportErrorr  r  r  r  r8  r   r	   r  r
   r   r4   rQ   os.pathr  rO  r,  textwrapr   rv  rH  r  r*   idlelib.colorizerr   idlelib.configr   idlelib.delegatorr   r  r   r   idlelib.editorr   idlelib.filelistr   idlelib.outwinr   r   r   idlelib.runr   r   r   idlelib.undor   r   r  rG  r  eofr<  r  	NameErrorr   r'   r)   r-   
checkcacher<   r>   r   r   r   r   	RPCClientr   r  r  r  r   r;  r2  r   r.   r&   <module>rl     s   z%([[%<CKK!" <<7*O  '   	  	         , # '   ' % '   G G & ( 	
 CDHDH "  )  +/2;2F2F( 5	 }", }"@h (
2^ 
2/M /D1	 1#-- 1m(0 m(`c	,l c	,L4	lnb zF  {4  	 9?B~~O
Q-b  		s   F2 'G 2$GG#"G#