+
     Bi                    `   ^ RI t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RI5 ^ 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 ^ RIHt ^ RIHt ^ RI H!t! ^ RI"H#t# ^ RIH$t$ ^t%R]PL                  ! 4       ,          t']P                  R8H  t(R t) ! R R4      t*R t+]PX                  ! R4      t-R t. ! R R4      t/R t0R R!R"R#R$R%/t1R& t2R' t3R( t4]5R)8X  d"   ^ R*I6H7t7 ]7! R+^R,R-7       ^ R.I8H9t9 ]9! ]44       R# R# )/    N)*)Font)	Scrollbar)simpledialog)
messagebox)idleConf)configdialog)grep)help)
help_about)macosx)MultiCallCreator)pyparse)query)replace)search)wheel_event)py_extensions)windowz (%s)darwinc                     \         P                  w  rr#pV  V 2pWR ,          pVR8X  d   VRV 2,          pV# VR8w  d   WS^ ,           V 2,          pV# )zYFormat sys.version_info to produce the Sphinx version string used to install the chm docs	candidatercfinal)sysversion_info)majorminormicrolevelserialreleases         %/usr/lib/python3.14/idlelib/editor.py_sphinx_versionr$   &   so    ),)9)9&E%wGGRx=  N 
'	AhZx((N    c                     a  ] tR t^3t o ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHt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H t  ^ RI!H"t" ^ RI#H$t$ ]%PL                  ! 4       t'Rt(Rt)Rt*Rt+RuR lt,RvR lt-R t.R t/R t0R t1RvR lt2 . RwOt3R t4R t5R t6R t7R t8Rt9R t:Rx.t;R t<R t=R  t>R! t?RvR" lt@RvR# ltARvR$ ltBRvR% ltCR& tDR' tER( tFRvR) ltGRvR* ltHR+ tIR, tJR- tKR. tLR/ tMR0 tNR1 tOR2 tPR3 tQR4 tRR5 tSRvR6 ltTRvR7 ltURvR8 ltVR9 tWR: tXR; tYR< tZR= t[R> t\R? t]R@ t^]_P                  ]_P                  ,           RA,           tbRB tcRC tdRD teRE tfRF tgRG thRH tiRI tjRvRJ ltkRK tlRL tmRM tnRN toRO tpRP tqRQ trRR tsRyRS lttRT tuRyRU ltvRV twRW txRX tyRY tzRZ t{R[ t|R\ t}R] t~R^ tR_R`/tRa tRvRb ltRzRc ltRd tRvRe ltRvRf ltRg tRh tRi tRj tR{Rk ltRl tRm tRn tRo tRp tRq tRr tRvRs ltRttV tR# )|EditorWindow)
Percolator)ColorDelegatorcolor_config)UndoDelegator)	IOBindingencoding)mainmenu)MultiStatusBar)AutoComplete)
AutoExpand)Calltip)CodeContext)LineNumbers)FormatParagraphFormatRegionIndentsRstrip)
ParenMatch)
ZoomHeightNTc                #   ^ RI Hp \        P                  Ef0   \        P
                  P                  \        P                  RR4      p\        P                  P                  R4      '       dr   RR\        P                  R,          ,          ,           p\        P
                  P                  R	4      '       d   R
pMRp\        P
                  P                  WRR4      pM\        P                  R,          R8X  d`   ^ RIp	Rp
R\        P                   R2p V	P                  V	P                   V4      p
\        P
                  P'                  T
4      '       d   T
pMC\        P                  R8X  d/   \        P
                  P                  \        P                  R4      p\        P
                  P)                  V4      p\        P
                  P'                  V4      '       dB   V\        n        \        P                  R8X  d!   R\        P                  ,           \        n        M'R\        P                  R,          ,          \        n        Wn        T;'       g    VP,                  pW@n        \/        V4      V n        \2        P4                  ! W@P0                  R7      ;V n        pV'       d.   VP8                  V n        VP<                  V P6                  n        M/ V n        / V P6                  n        \@        PB                  ;'       d/    \        P
                  P                  \@        PB                  R4      V n"        RV n#        \I        V4      ;V n%        p\M        VRR7      ;V n'        p\@        PP                  ! RRRRR7      pRRR ^R!R"R#^ RVR$R%R&\@        PP                  ! RRR&RR7      /p\S        \T        4      ! V3/ VB ;V n+        pV PV                  V P6                  n,        V P[                  4        V P]                  4        V P6                  P_                  R'V P`                  4       V P6                  Pc                  R(V Pd                  4       \f        Ph                  ! 4       '       dV   VPc                  R(V Pd                  4       VPc                  R)V Pj                  4       VPc                  R*V Pj                  4       MVPc                  R+V Pj                  4       VPc                  R,\l        4       VPn                  R-8X  d-   VPc                  R.\l        4       VPc                  R/\l        4       VPc                  R0V Pp                  4       VPc                  R1V Pr                  4       VPc                  R2V Pt                  4       VPc                  R3V Pv                  4       VPc                  R4V Px                  4       VPc                  R5V Pz                  4       VPc                  R6V P|                  4       VPc                  R7V P~                  4       VPc                  R8V P                  4       VPc                  R9V P                  4       VPc                  R:R; 4       VPc                  R<V P                  4       VPc                  R=V P                  4       VPc                  R>V P                  4       VPc                  R?V P                  4       VPc                  R@V P                  4       VPc                  RAV P                  4       VPc                  RBV P                  4       VPc                  RCV P                  4       VPc                  RDV P                  4       VPc                  REV P                  4       VPc                  RFV P                  4       V P                  V 4      ;V nN        pVPc                  RGVP                  4       VPc                  RHVP                  4       VPc                  RIVP                  4       VPc                  RJVP                  4       VPc                  RKVP                  4       VPc                  RLVP                  4       V P                  V 4      pVPc                  RMVP                  4       VPc                  RNVP                  4       VPc                  ROV P                  ^ 4      4       VPc                  RPV P                  ^4      4       VPc                  RQV P                  4       VPc                  RRV P                  4       VPc                  RSV P                  4       V'       d   W1P<                  V &   V'       d   WP                  V&   VPc                  RTV P                  4       VPc                  RUV P*                  P                  4       VPc                  RVV P                  4       VPc                  RWV P                  4       VPc                  RXV P                  4       V P                  4        VP                  \        \        ^RY7       VP                  ^^RZ7       VP                  ^^RZ7       V P                  VR[&   VP                  ^^\        R\7       VP                  VR]&   \@        P                  ! V P,                  RR4      VR^&   VP                  ^^\        R\7       VP                  4        V P                  4        \@        PP                  ! RR_R`RaR7      pV'       * V no        ^V np        V P                  V nq        V P                  4        \        \@        Rb4      '       g   V PV                  Rc,          \@        nt        V P                  4        RV nv        V P                  V4      ;V nx        pV P                  4       ;V nz        pVP                  V4       VP                  Vn|        VP                  Vn}        VP                  V P                  4       V EP                  V 4      ;V n        pVEP                  V EP                  4       RdV n        V EP                  Rd4       RV n        RV n        RV n        V'       d   \        P
                  EP                  V4      '       dj   \        P
                  P                  V4      '       gE   VEP                  V4      '       d,   ReV n        V EP                  V4      pV EP                  V4       MVEP                  V4       ReV n        V EP                  4        V P                  4        V EP                  4        V EP                  4        V EP                   EP#                  Rf4      pV'       dc   VEP%                  Rg4      pVf   RpV^ 8  d   VEP'                  4        V^,           pVV n        \2        EP*                  ! V EP,                  4       E\.        EP0                  V n        E\2        EP4                  V n        E\2        EP6                  V n        VEP9                  RhRi4       VEP9                  RjRkRlRm4       VEP9                  RnRo4       VEP9                  RpRq4       VEP9                  RrRqRsRt4       V EP;                  W EP<                  4      pVPc                  RhVEP>                  4       VPc                  RjVEP@                  4       VPc                  RuVEPB                  4       VPc                  RvV EPE                  V 4      EPF                  4       VPc                  RwV EPI                  V 4      EPJ                  4       V EPM                  V 4      pVPc                  RxVEPN                  4       VPc                  RrVEPP                  4       V! V 4      pVPc                  RyVEPR                  4       VPc                  RzVEPT                  4       VPc                  R{VEPV                  4       VPc                  R|V EPY                  V 4      EPZ                  4       V EP]                  V 4      ;V n        pVPc                  RnVEP`                  4       VPc                  RpVEPb                  4       VPc                  R}VEPd                  4       VPc                  R~V EPg                  V 4      EPh                  4       V EPj                  '       dA   V EPm                  V 4      V n        VPc                  RV EP                  EPn                  4       MV EPq                  RRR4       V EPr                  '       dh   V EPu                  V 4      V n        \@        PP                  ! RRRRaR7      '       d   V EPw                  4        VPc                  RV EPv                  4       R# V EPq                  RRR4       R#   \"         d5     T	P                  T	P$                  T4      p
 EL  \"         d      ELi ; ii ; i)r   )ScriptBindingNDocz
index.htmllinuxzpython-docs-z%s.%s.%sN   Nz/var/www/html/python/z/var/www/html/python/index.htmlz/usr/share/doc/win zSoftware\Python\PythonCore\z\Help\Main Python Documentationr   z0Resources/English.lproj/Documentation/index.htmlzfile://zhttps://docs.python.org/%d.%d/:N   N)menuzrecent-files.lstvbar)namemainr'   widthinttyperF   textpadxwrapnonehighlightthicknesstabstylewordprocessorheightWM_DELETE_WINDOW<<close-window>>z<Control-Button-1>z<2>z<3>z<MouseWheel>x11z
<Button-4>z
<Button-5>z<Configure>z<<cut>>z<<copy>>z	<<paste>>z<<center-insert>>z<<help>>z<<python-docs>>z<<about-idle>>z<<open-config-dialog>><<open-module>>z<<do-nothing>>c                     R # break )events   &r#   <lambda>'EditorWindow.__init__.<locals>.<lambda>   s    'r%   z<<select-all>>z<<remove-selection>>z<<find>>z<<find-again>>z<<find-in-files>>z<<find-selection>>z<<replace>><<goto-line>>z<<smart-backspace>>z<<newline-and-indent>>z<<smart-indent>>z<<indent-region>>z<<dedent-region>>z<<comment-region>>z<<uncomment-region>>z<<tabify-region>>z<<untabify-region>>z<<toggle-tabs>><<change-indentwidth>>z<Left>z<Right>z<<del-word-left>>z<<del-word-right>>z<<beginning-of-line>>z<<open-new-window>>z<<close-all-windows>>z<<open-class-browser>>z<<open-path-browser>>z<<open-turtle-demo>>)sidefillexpand)weightcommand)rowcolumnstickyyscrollcommandfontIndentz
use-spacesboolblink_off_timeinsertofftimeFTr   endz<<autocomplete>>z	<Key-Tab>z<<try-open-completions>>z<KeyRelease-period>z<KeyRelease-slash>z<KeyRelease-backslash>z<<try-open-calltip>>z<KeyRelease-parenleft>z<<refresh-calltip>>z<KeyRelease-parenright>z<<paren-closed>>z<KeyRelease-bracketright>z<KeyRelease-braceright>z<<force-open-completions>>z<<expand-word>>z<<format-paragraph>>z<<flash-paren>>z<<check-module>>z<<run-module>>z<<run-custom>>z<<do-rstrip>>z<<force-open-calltip>>z<<zoom-height>>z<<toggle-code-context>>optionsz*ode*ontextdisabledzline-numbers-defaultz<<toggle-line-numbers>>*ine*umbers)2   i  i@KL )idlelib.runscriptr<   r'   help_urlospathjoinr   base_prefixplatformcountr   isdirwinregwinver
QueryValueHKEY_CURRENT_USERFileNotFoundErrorHKEY_LOCAL_MACHINEisfilenormpathflistrootMenumenubarr   ListedTopleveltopvarstkinter_varsinversedictinstance_dictr   userdirrecent_files_pathprompt_last_lineFrame
text_framer   rE   	GetOptionr   TextrL   focused_widgetcreatemenubarapply_bindingsprotocolclosebindclose_eventr   isAquaTkright_menu_eventr   _windowingsystemhandle_winconfigcutcopypastecenter_insert_eventhelp_dialogpython_docsabout_dialogconfig_dialogopen_module_event
select_allremove_selection
find_eventfind_again_eventfind_in_files_eventfind_selection_eventreplace_eventgoto_line_eventsmart_backspace_eventnewline_and_indent_eventsmart_indent_eventr6   fregionindent_region_eventdedent_region_eventcomment_region_eventuncomment_region_eventtabify_region_eventuntabify_region_eventr7   toggle_tabs_eventchange_indentwidth_eventmove_at_edge_if_selectiondel_word_leftdel_word_righthome_callbackdictnew_callbackclose_all_callbackopen_module_browseropen_path_browseropen_turtle_demoset_status_barpackLEFTBOTHrowconfigurecolumnconfigurehandle_yviewgridNSEWsetGetFont	focus_set	set_widthusetabstabwidthindentwidthset_notabs_indentwidthhasattrrm   update_cursor_blinknum_context_linesr(   perr+   undoinsertfilterundo_block_startundo_block_stopset_saved_change_hooksaved_change_hookr,   ioset_filename_change_hookfilename_change_hook	good_loadset_indentation_paramscolorcode_contextline_numbersexistsloadfileispythonsourceset_filenameResetColorizerupdate_recent_files_listload_extensionsmenudictgetindexadd_separator	wmenu_endregister_callbackpostwindowsmenur   
askintegerr   askyesno	showerror	event_addr0   user_input_insert_tagsautocomplete_eventtry_open_completions_eventforce_open_completions_eventr1   expand_word_eventr5   format_paragraph_eventr9   flash_paren_eventparen_closed_eventcheck_module_eventrun_module_eventrun_custom_eventr8   	do_rstripr2   ctiptry_open_calltip_eventrefresh_calltip_eventforce_open_calltip_eventr:   zoom_height_eventallow_code_contextr3   toggle_code_context_eventupdate_menu_stateallow_line_numbersr4   toggle_line_numbers_event)selfr   filenamekeyr   r<   dochomepyverbasepathr~   docfileKEYr   r   rE   rH   text_optionsrL   r   indents	usespacesr   r   r   	is_py_srcrD   ro   autocomplete
parenmatchscriptbindingr
  s   &&&&&                          r#   __init__EditorWindow.__init__J   s   3  (ww||COOULIG||!!'**&c6F6Fr6J)JJ77==!899?G0H ggll8+0,@Gb!U*5cjj\:;$//0H0H#NG 77>>'**%G)'',,sJLgg&&w/Gww~~g&&(/%<<8+,58M8M,ML))I+.+;+;B+?*@%
!!uzz	Dz..t,,GG3 %

D &+%6%6DHH" "D%'DHH"!)!1!1 "6 "6bggll  "476 !#',Sz1*$Zf==	D""6>7O$aO(,,uF	 ,D1*MMM	D"&)),djj9($*:*:;??II($*:*:; II*4+@+@AIIeT223 IIeD112		.+.  E)IIlK0IIlK0		-!6!67		)TXX&		*dii(		+tzz*		%t'?'?@		*d../		#T%5%56		"D$5$56		*D,>,>?		#T%;%;<		"$9:		"DOO4		($*?*?@		*doo.		"D$9$9:		%t'?'?@		&(A(AB		-!3!34		/4#7#78		'(B(BC		*4+H+HI		$T%<%<=!%!2!24!88w		%w'B'BC		%w'B'BC		&(D(DE		('*H*HI		%w'B'BC		')F)FG,,t$		#W%>%>?		*G,L,LM		(D::1=>		)T;;A>?		%t'9'9:		&(;(;<		)4+=+=>&)d#"&

3II+T->->?II-tzz/L/LMII.0H0HIII-t/E/EFII,d.C.CDTQ7!,""1Q"/++Y		a$	/!%''		6>JV		a$	/ &&vx'3&B	$}   ==##% x!122&*ii&@H#  " "2..3--//	D $ 5 5#33""4#9#9:~~d++"
##D$=$=>##E*
  ww~~h''h0G0G;;x((%)DN $ 3 3H =I//	:)!% %%'}}  ***U#C{ax""$Ag DN$$T%9%9: '11"++#-- 	);713H+-E	G-/GH,.GH)+D24M	O
 ((/J/JK		$l&E&EF		,99	;		.;;	=		#T__T%:%L%LM		(&&t,CC	E__T*
		#Z%A%AB		$j&C&CD%d+		$m&F&FG		"M$B$BC		"M$B$BC		/4;;t#4#>#>?<<--	D		($*E*EF		')C)CD		*D,I,IJ		#T__T%:%L%LM""" $ 0 0 6DII/''AAC ""9mZH""" $ 0 0 6D!!&."8vG G..0II/1O1OP""9mZHW ) "("3"3F4M4M47#9, 	s7   AF& F&AG%F2AGGAG!GAG%G AG!G!AG%c                &    V P                  4        R # N)r   r  r\   s   &&r#   r   EditorWindow.handle_winconfigm  s    r%   c           	     Z   V P                   p\        \        VP                  P                  VP                  R 4      VP                  R4      .4      4      pVP                  4       ^V,          ,
          p\        WP                  R4      R7      P                  R4      pW4,          V n	        R# )borderrM   rj   )rj   0N)
rL   summaptkgetintcgetwinfo_widthr   measurerH   )r  rL   inner_paddingpixel_widthzero_char_widths   &    r#   r   EditorWindow.set_widthp  s    yyC81D1561B1D E F&&(1}+<< IIf-.66s; 	 3
r%   c                t    V P                   P                  4       w  r#V P                  P                  V4       R # rY   )r   defaultfilenamer   new)r  r\   dirnamebasenames   &&  r#   r   EditorWindow.new_callback}  s*     GG335

wr%   c                   VP                   ^,          ^ 8w  d   VP                  R8X  d   R# V P                  P                  R4      '       d   V P                  P	                  RRR4      '       d_   V P                  P	                  RRR4      '       d<   \        V P                  P                  R4      P                  R4      ^,          4      pMQV P                  P                  RR4      p\        \        V4      4       F  pW2,          R9  g   K   M	  \        V4      p\        V P                  P                  R4      P                  R4      ^,          4      pW$8X  d   ^ pR	\        V4      ,           R
,           pVP                   ^,          ^ 8X  d    V P                  P                  RRR4       EM`V P                  P                  R4      '       g   V P                  P                  RR4       MV P                  P	                  V P                  P                  R4      RV P                  P                  R4      4      '       d   V P                  P                  RR4       MV P                  P                  RR4       V P                  P                  V4      pV P                  P                  R4      pV P                  P	                  VRV4      '       d   YvrvV P                  P                  RRR4       V P                  P                  RWg4       V P                  P                  RV4       V P                  P                  R4       R# )   HomeNiomark<=zinsert lineendinsert linestart.insertzinsert linestart+csel1.0ro   	sel.first	my_anchor<sel.last>rZ   ) 	)statekeysymrL   r   comparerI   splitr   rangelenstr
tag_removemark_settag_addsee)r  r\   insertptlinelineatdestfirstlasts   &&      r#   r   EditorWindow.home_callback  sV   KK!O!ellf&<99??8$$99Xt-=>>99/x@@499??84::3?BCH99==!35EFD!#d),>3 - TTYY__X.44S9!<=H"3x=04KKMaII  u599??;//		"";999$$TYY__[%A3%)YY__X%>@ @II&&{K@II&&{J?IIOOD)E99??;/Dyy  s400!dII  u5IIeU1		8T*		hr%   c                   V P                  V P                  4      V n        \        V P                  ^^RR7      p\        P
                  R8X  d#   V P                  P                  RR\        R7       V P                  P                  RR\        R7       V P                  P                  R	R
\        R7       V P                  P                  \        \        R7       VP                  \        \        R7       V P                  P                  RV P                  4       V P                  P                  RRR4       V P                  P                  V P                  4       R# )   grey75)rS   borderwidth
backgroundr   	_padding1z    )ra   rg   zCol: ?r[  zLn: ?)ra   rb   z<<set-line-and-column>>z<KeyRelease>z<ButtonRelease>N)r/   r   
status_barr   r   r{   	set_labelRIGHTr   BOTTOMXrL   r   set_line_and_columnr   
after_idle)r  seps   & r#   r   EditorWindow.set_status_bar  s    --dhh7DHHQA(K<<8# OO%%k6%F!!(H5!A!!&'!>&q1f1%		0$2J2JK		5*,=	?		T556r%   c                    V P                   P                  \        4      P                  R 4      w  r#V P                  P                  RRV,          4       V P                  P                  RRV,          4       R# )rC  rg   zCol: %sr[  zLn: %sN)rL   r   INSERTrR  rg  rh  )r  r\   r[  rg   s   &&  r#   rl   EditorWindow.set_line_and_column  sR    yyv.44S9!!(I,>?!!&(T/:r%   c                   V P                   p/ ;V n        pV P                   FF  w  r4\        V4      w  rT\	        W R2R4      p\        W^ VR7      ;W#&   pVP                  WGVR7       KH  	  \        P                  ! 4       '       d'   \        VR^ R7      ;VR&   pVP                  RVR	7       V P                  4        \        V P                   ^ R
7      V n
        V P                  R,          P                  ^R^ V P                  R7       V P                  R,          P                  \        4      V n        V P                  4        R# )a  Populate the menu bar widget for the editor window.

Each option on the menubar is itself a cascade-type Menu widget
with the menubar as the parent.  The names, labels, and menu
shortcuts for the menubar items are stored in menu_specs.  Each
submenu is subsequently populated in fill_menus(), except for
'Recent Files' which is added to the File menu here.

Instance variables:
menubar: Menu widget containing first level menu items.
menudict: Dictionary of {menuname: Menu instance} items.  The keys
    represent the valid menu items for this window and may be a
    subset of all the menudefs available.
recent_files_menu: Menu widget contained within the 'file' menudict.
_menu_postcommandN)rF   tearoffpostcommand)labelrD   	underlineapple)rF   ru  applicationIDLE)rw  rD   ru  filezRecent Files)rw  rx  rD   r   )r   r   
menu_specsprepstrgetattrr   add_cascader   
isCarbonTk
fill_menusrecent_files_menuinsert_cascader   ENDbase_helpmenu_lengthreset_help_menu_entries)r  mbarr   rF   rw  rx  rv  rD   s   &       r#   r   EditorWindow.createmenubar  s-     ||#%%??KD&u~I!$&0A(BDIK$(!5@%B BHNT5yI + -1$W:;.= =H]#d65!%dllA!>f,,Qn78262H2H 	- 	J %)MM&$9$?$?$D!$$&r%   c                    V P                   R,          pVP                  R4      pVf   RpW P                  8  d$   VP                  V P                  ^,           V4       \        P
                  ! V4       R# )zCCallback to register window.

Only called when Window menu exists.
r   ro   Nrt   )r   r   r   deleter   add_windows_to_menu)r  rD   ro   s   &  r#   r   EditorWindow.postwindowsmenu  sY    
 }}X&jj;CKKq(#.""4(r%   c                P    V P                   V,          pVP                  W#R7       R# )z$Update label for menu item at index.)rw  Nr   entryconfig)r  rD   r   rw  menuitems   &&&& r#   update_menu_labelEditorWindow.update_menu_label  !    ==&U0r%   c                P    V P                   V,          pVP                  W#R7       R# )z$Update state for menu item at index.rO  Nr  )r  rD   r   rO  r  s   &&&& r#   r  EditorWindow.update_menu_state  r  r%   c                    VR8X  dP   \        V^ ,          4      p\        V P                  R4      V,          4      V P                  R4      ,
          pRpVR3pV P                  P                  ! V.VO5!   R# )zHandle scrollbar.movetoro   @0,0scrollunitsrZ   )floatround	getlinenorL   yview)r  r\   argsfractionliness   &&*  r#   r   EditorWindow.handle_yview  sg    HT!W~H4>>%08;<^^F+,EE7#D		%%r%   c                ^   V P                   pVP                  R VP                   RVP                   24      p VP	                  RRV4      ;'       d    VP	                  VRR4      pV'       g&   VP                  RRR4       VP                  R	V4       V P                  '       g   V P                  4        V P                  pWn
        \        P                  R
,          R8H  pV'       d   VP                  RR7       V P                   F1  p Vw  rp
T
f   K  \!        Y
4      ! 4       pTP#                  YR7       K3  	  VP%                  VP&                  VP(                  4       V'       d   V P                   P                  RR7       R#   \
         d    Rp EL2i ; i  \         d     K  i ; i)@,rH  rA  rK  FrF  rG  ro   rD  r?   rA   arrow)cursorr  ibeamrZ   )rL   r   xyrQ  TclErrorrV  rW  rmenu
make_rmenur\   r   r{   configrmenu_specs
ValueErrorr  entryconfiguretk_popupx_rooty_root)r  r\   rL   newdexin_selectionr  iswinitemrw  	eventnameverify_staterO  s   &&          r#   r   EditorWindow.right_menu_event)  sp   yyay%''34	! LLdFC C C<<zB  OOE5%0MM(F+zzzOO


R E)KKwK'$$D15., #D/1E   4 % 	u||U\\2IIG,7  	! L	!   s)   F	 F	 F	FFF,+F,c                    \        V P                  ^ R7      pV P                   FM  pV^ ,          V^,          rCVe&   V P                  V3R lpVP                  W5R7       K=  VP	                  4        KO  	  Wn        R# )r   r|  Nc                 (    V P                  V4       R # r&  event_generaterL   r  s   &&r#   re   (EditorWindow.make_rmenu.<locals>.commandV  s    ''	2r%   rw  re   )r   rL   r  add_commandr   r  )r  r  r  rw  r  re   s   &     r#   r  EditorWindow.make_rmenuQ  si    TYY*$$D#AwQ9 !%i 3!!!?##% % 
r%   c                "    V P                  4       # r&  )rmenu_check_copyr  s   &r#   rmenu_check_cutEditorWindow.rmenu_check_cut]  s    $$&&r%   c                v     V P                   P                  R 4      pV'       d   R# R#   \         d     R# i ; i)rH  normalrq   rL   r   r  )r  indxs   & r#   r  EditorWindow.rmenu_check_copy`  s<    	499??;/D  $833  		s   ) 88c                     V P                   P                  P                  R V P                   R4       R#   \         d     R# i ; i)ztk::GetSelection	CLIPBOARDr  rq   )rL   r.  callr  r  s   &r#   rmenu_check_pasteEditorWindow.rmenu_check_pasteh  s?    	IILL0$))[I   		s   15 AAc                F    \         P                  ! V P                  4       R# )zHandle Help 'About IDLE' event.rZ   )r   AboutDialogr   r'  s   &&r#   r   EditorWindow.about_dialogp  s     	txx(r%   c                H    \         P                  ! V P                  R4       R# )z&Handle Options 'Configure IDLE' event.SettingsrZ   )r	   ConfigDialogr   r'  s   &&r#   r   EditorWindow.config_dialogv  s     	!!$((:6r%   c                    V P                   '       d   V P                   pMV P                  p\        P                  ! V4       R# )zHandle Help 'IDLE Help' event.rZ   )r   r   r   show_idlehelp)r  r\   parents   && r#   r   EditorWindow.help_dialog|  s0     999YYFXXF6"r%   c                N   \         P                  R ,          R8X  d$    \        P                  ! V P                  4       R# \        P                  ! V P                  4       R#   \
         d8   p\        P                  ! R\        T4      T P                  R7        Rp?R# Rp?ii ; i)r?   rA   Document Start Failuretitlemessager  NrZ   )r   r{   rw   	startfilerv   OSErrorr   r   rU  rL   
webbrowseropen)r  r\   whys   && r#   r   EditorWindow.python_docs  s|    <<u$8T]]+  OODMM*  8$$+CHTYY8 8 8s    A" "B$-,BB$c                <    V P                   P                  R 4       R# )z<<Cut>>rZ   rL   r  r'  s   &&r#   r   EditorWindow.cut  s    		  +r%   c                    V P                   P                  R 4      '       g   R# V P                   P                  R4       R# )rF  Nz<<Copy>>rZ   )rL   
tag_rangesr  r'  s   &&r#   r   EditorWindow.copy  s/    yy##E**		  ,r%   c                r    V P                   P                  R 4       V P                   P                  R4       R# )z	<<Paste>>rD  rZ   )rL   r  rY  r'  s   &&r#   r   EditorWindow.paste  s'    		  -		hr%   c                    V P                   P                  R RR4       V P                   P                  RR4       V P                   P                  R4       R# )rF  rG  zend-1crD  rZ   )rL   rX  rW  rY  r'  s   &&r#   r   EditorWindow.select_all  s?    		%1		8U+		hr%   c                v    V P                   P                  R RR4       V P                   P                  R4       R# )rF  rG  ro   rD  rZ   )rL   rV  rY  r'  s   &&r#   r   EditorWindow.remove_selection  s+    		UE51		hr%   c                |   aaaa V P                   P                  oV P                   P                  oRoVVVV3R lpV# )zCursor move begins at start or end of selection

When a left/right cursor key is pressed create and return to Tkinter a
function which causes a cursor move from the associated edge of the
selection.

c                    < V P                   ^,          ^ 8X  d    S! R4       S! RSS,          4       R# R#   \         d     R# i ; i)   rH  rD  N)rO  r  )r\   
edge_indexedges_tableself_text_indexself_text_mark_sets   &r#   move_at_edge<EditorWindow.move_at_edge_if_selection.<locals>.move_at_edge  sH    aA%#K0&xZ1HI &   s   7 AA)zsel.first+1czsel.last-1c)rL   r   rW  )r  r  r   r  r  r  s   &f @@@r#   r   &EditorWindow.move_at_edge_if_selection  s9     ))//!YY//5	 	 r%   c                <    V P                   P                  R 4       R# )z<Meta-Delete>rZ   r  r'  s   &&r#   r   EditorWindow.del_word_left  s    		  1r%   c                <    V P                   P                  R 4       R# )z<Meta-d>rZ   r  r'  s   &&r#   r   EditorWindow.del_word_right  s    		  ,r%   c                F    \         P                  ! V P                  4       R # rY   )r   findrL   r'  s   &&r#   r   EditorWindow.find_event  s    DIIr%   c                F    \         P                  ! V P                  4       R # rY   )r   
find_againrL   r'  s   &&r#   r   EditorWindow.find_again_event  s    $))$r%   c                F    \         P                  ! V P                  4       R # rY   )r   find_selectionrL   r'  s   &&r#   r   !EditorWindow.find_selection_event  s    dii(r%   c                r    \         P                   ! V P                  V P                  V P                  4       R # rY   )r
   rL   r   r   r'  s   &&r#   r    EditorWindow.find_in_files_event  s!    		$))TWWdjj1r%   c                F    \         P                   ! V P                  4       R # rY   )r   rL   r'  s   &&r#   r   EditorWindow.replace_event  s    		"r%   c                    V P                   p\        P                  ! VR R4      P                  pVeJ   VP	                  RRR4       VP                  RV R24       VP                  R4       V P                  4        R# )z
Go To Linez/Enter a positive integer
('big' = end of file):rF  rG  ro   rD  .0rZ   )rL   r   GotoresultrV  rW  rY  rl  )r  r\   rL   linenos   &&  r#   r   EditorWindow.goto_line_event  st    yyl) &	 	
 OOE5%0MM(vhbM2HHX$$&r%   c                x    V P                   P                  RR4      P                  4       p\        P
                  ! V P                   RRV4      P                  pVeK   V P                  '       d   V P                  P                  V4       V# V P                  P                  V4       V#   \         d    Rp Li ; i)zGet module name from user and open it.

Return module path or None for calls by open_module_browser
when latter is not invoked in named editor window.
rH  rK  rB   zOpen ModulezAEnter the name of a Python module
to search on sys.path and open:)rL   r   stripr  r   
ModuleNamer  r   r  r   r   )r  rF   	file_paths   &  r#   open_moduleEditorWindow.open_module  s    	99==j9??AD $$		=2	 f	 	
  zzz

	*    +  	D	s   *B) )B98B9c                &    V P                  4        R # rY   )r  r'  s   &&r#   r   EditorWindow.open_module_event  s    r%   c                    V P                   P                  pV P                  P                  R 8X  d	   V'       g   V P	                  4       pVf   R# ^ RIHp VP                  V P                  V4       R# )PyShellEditorWindowrZ   )browser)	r   r  	__class____name__r  idlelibr$  ModuleBrowserr   )r  r\   r  r$  s   &&  r#   r    EditorWindow.open_module_browser  sX    77##''+@@'')H#dii2r%   c                H    ^ RI Hp VP                  V P                  4       R# )r   )pathbrowserrZ   )r'  r+  PathBrowserr   )r  r\   r+  s   && r#   r   EditorWindow.open_path_browser  s    '		*r%   c                Z    ^ RI p\        P                  RR.pVP                  VRR7       R# )r   Nz-cz,from turtledemo.__main__ import main; main()F)shellrZ   )
subprocessr   
executablePopen)r  r\   r0  cmds   &&  r#   r   EditorWindow.open_turtle_demo  s1    ~~=? 	E*r%   c                    Vey   V^ 8  dp   V P                   P                  RRV,          4       V P                   P                  RRR4       V P                   P                  RRR4       V P	                  4        R # R # R # )NrD  z%d.0rF  rG  ro   z
insert +1l)rL   rW  rV  rX  center)r  r  s   &&r#   gotolineEditorWindow.gotoline  sc    &1*IIx&9II  u5IIeX|<KKM	 #-r%   c                   V'       d&   \         P                  P                  V4      '       d   R # \         P                  P                  \         P                  P	                  V4      4      w  r#\         P                  P                  V4      \        9   d   R # V P                  P                  RR4      pVP                  R4      ;'       d    RV9   # )TrG  z1.0 lineendz#!python)
rw   rx   r}   splitextr;  normcaser   rL   r   
startswith)r  r  baseextr[  s   &&   r#   r   EditorWindow.ispythonsource&  s    277==22GG$$RWW%5%5h%?@	77C M1yy}}UM2t$99T)99r%   c                r    V P                   '       d%   V P                   P                  V 4       R V n         R # R # r&  )r   unregister_maybe_terminater  s   &r#   
close_hookEditorWindow.close_hook/  s)    :::JJ11$7DJ r%   c                    Wn         R # r&  )rC  )r  rC  s   &&r#   set_close_hookEditorWindow.set_close_hook4  s    $r%   c                    V P                   '       d   V P                   P                  V 4       V P                  4        V P                  P	                  V 4       V P                  4        R # r&  )r   filename_changed_editr   r   update_windowlist_registryr   r  s   &r#   r   !EditorWindow.filename_change_hook7  sG    :::JJ,,T2 ++D1r%   c                8   V P                   '       d   R # V P                  V P                  P                  4      '       d   V P	                  4       V n         V P                   '       d4   V P
                  P                  V P                   V P                  R7       R # R # )N)filterafter)r   r   r   r  r)   r   insertfilterafterr   r  s   &r#   _addcolorizerEditorWindow._addcolorizer>  sf    :::tww//00,,.DJ:::HH&&djj		&J r%   c                    V P                   '       g   R # V P                   P                  4        V P                  P                  V P                   4       R V n         R # r&  )r   removecolorsr   removefilterr  s   &r#   _rmcolorizerEditorWindow._rmcolorizerG  s;    zzz

!djj)
r%   c                (   V P                  4        V P                  4        \        P                  V P                  4       V P
                  e   V P
                  P                  4        V P                  e   V P                  P                  4        R# R# )zUpdate the color themeN)	rU  rP  r'   r*   rL   r   update_highlight_colorsr   update_colorsr  s   &r#   r   EditorWindow.ResetColorizerN  so     	!!$)),(557(++- )r%   _c                V   VP                  R V4       VP                  V4      pV'       d+   W0P                  9   d   VP                  R VR,           V4       RVP                  V4      8X  d   VP                  RV4       MVP                  RVR,           4       VP	                  V4       R# )ERRORz
 wordstart
rD  z+1cN)rX  r   
IDENTCHARSrW  rY  )r  rL   poschars   &&& r#   colorize_syntax_error"EditorWindow.colorize_syntax_error]  sy    Wc"xx}DOO+LL#"4c:488C= MM(C(MM(C%K0r%   c                    \         P                  ! RRRRR7      pV'       g   ^ V P                  R&   R# \         P                  V P                  R&   R# )z&Update the cursor blink configuration.rG   r'   zcursor-blinkrl   rJ   rn   N)r   r   rL   rm   )r  cursorblinks   & r#   r    EditorWindow.update_cursor_blinkh  sC    ((VE)*DIIo& *2)@)@DIIo&r%   c                &   V P                   e   V P                   P                  4        V P                  e   V P                  P                  4        \        P                  ! V P
                  RR4      pWP                  R&   V P                  4        R# )z.Update the text widgets' font if it is changedNrG   r'   rj   )r   update_fontr   r   r   r   rL   r   )r  new_fonts   & r#   	ResetFontEditorWindow.ResetFontr  sp     ())+ ())+##DIIv~F$		&r%   c                   \         P                  ! 4       ;V P                  n        pVP	                  4        F#  w  r#V P
                  P                  ! V.VO5!   K%  	  V P                  4        FZ  p\         P                  ! V4      pV'       g   K#  VP	                  4        F#  w  r#V P
                  P                  ! V.VO5!   K%  	  K\  	  R# )zWRemove the virtual, configurable keybindings.

Leaves the default Tk Text keybindings.
N)	r   GetCurrentKeySetr.   default_keydefsitemsrL   event_deleteget_standard_extension_namesGetExtensionBindings)r  keydefsr\   keylistextensionNamexkeydefss   &     r#   RemoveKeybindingsEditorWindow.RemoveKeybindings  s     3;2K2K2MM%%mmoNEII""5373 .!>>@M44]CHx&.nn&6NEII**5;7; '7 Ar%   c                   \         P                  ! 4       ;V P                  n        pV P	                  4        V P                  4        F4  p\         P                  ! V4      pV'       g   K#  V P	                  V4       K6  	  / pV P                  P                   FX  p/ WE^ ,          &   V^,           F=  pV'       g   K  V^,          WE^ ,          ,          \        V^ ,          4      ^,          &   K?  	  KZ  	  V P                   F  pV P                  V,          pVP                  \        4      pVf   K1  V^,          p\        ^ V4       F  p	VP                  V	4      R8X  g   K  VP                  V	R4      p
V
'       g   K7  VP                  V	R4      pRpWt9   d   WV,          9   d   WG,          V,          pV'       g   Kw  \        W4      p
VP!                  WR7       K  	  K  	  R# )zUApply the virtual, configurable keybindings.

Also update hotkeys to current keyset.
Nre   acceleratorrw  rB   )rz  )r   rm  r.   rn  r   rq  rr  menudefsr  r   r   r  rS  rK   	entrycgetget_acceleratorr  )r  rs  ru  rv  menuEventDictrD   r  menubarItemro   r   accelitemNamer\   s   &            r#   ApplyKeybindingsEditorWindow.ApplyKeybindings  s    3;2K2K2MM%!>>@M44]CHx##H- A MM**D%'Mq'"Q4BFq'Mq'*747+;A+>?   +
  ==K==-D**S/C{1HCq#99U#y0 NN5-@Eu#'>>%#A "&7'+EE(5(B8(L 5$3G$CE ,,U,F ' )r%   c                l    V P                   '       g"   \        P                  ! RRRRR7      V n        R# R# )zCUpdate the indentwidth if changed and not using tabs in this windowrG   rk   z
num-spacesrI   rJ   N)r   r   r   r   r  s   &r#   r   #EditorWindow.set_notabs_indentwidth  s.     |||'11&(<7< >D r%   c                   \         P                  ! 4       pV P                  R,          pVP                  \        4      pW0P
                  8  d$   VP                  V P
                  ^,           V4       V'       dL   VP                  4        V F5  pV P                  V^,          4      pVP                  V^ ,          VR7       K7  	  W P                  R&   R# )z4Update the additional help entries on the Help menu.r   r  N)
r   GetAllExtraHelpSourcesListr   r   r  r  r  r   _extra_help_callbackr  )r  	help_listhelpmenuhelpmenu_lengthentryr3  s   &     r#   r  $EditorWindow.reset_help_menu_entries  s    779	==("..-666OOT66:_M""$"//a9$$58S$A # !)fr%   c                   a  V3V 3R llpV# )z9Return a callback that loads resource (file or web page).c                   < V P                  R4      '       g    \        P                  P                  V 4      p \        P
                  R,          R8X  d    \        P                  ! V 4       R# \        P                  ! V 4       R#   \         d8   p\        P                  ! R\        T4      SP                  R7        Rp?R# Rp?ii ; i)wwwr?   rA   r  r  N)r  http)r=  rw   rx   r   r   r{   r  r  r   r   rU  rL   r  r  )helpfiler  r  s   & r#   display_extra_help=EditorWindow._extra_help_callback.<locals>.display_extra_help  s    &&7777++H5||B5(<LL*
 )	  <((/G #C< <<s   B C,CCr[   )r  resourcer  s   f& r#   r  !EditorWindow._extra_help_callback  s    (0 
	* "!r%   c                T   . pV P                   pV'       dU   \        P                  P                  V4      '       d0   \	        VRRR7      ;_uu_ 4       pVP                  4       pRRR4       V'       dP   \        P                  P                  V4      R,           pW9   d   VP                  V4       VP                  ^ V4       . pV FE  pRV9   g+   \        P                  P                  V^ R 4      '       d   K4  VP                  V4       KG  	  V Uu. uF  qfV9  g   K  VNK  	  ppRpV^ \        V4       pV'       d3    \	        VRRRR7      ;_uu_ 4       pVP                  V4       RRR4       V P&                  P(                   F  p
V
P*                  pVP-                  ^ \.        4       \1        V4       FN  w  rVP3                  4       pV
P5                  V4      pVP7                  W|,          R,           V,           V^ R7       KP  	  K  	  R#   + '       g   i     EL; iu upi   + '       g   i     L; i  \         da   p	\        T P                  R	R
4      '       g9   RT P                  n        \         P"                  ! RRT	 R2T P$                  R7        Rp	?	EL0Rp	?	ii ; i)z/Load and update the recent files list and menusutf_8r   )r-   errorsNr^   1234567890ABCDEFGHIJKwrecentfiles_messageFTzIDLE Warningz)Cannot save Recent Files list to disk.
  z
Select OK to continue.r  rM  )rw  re   rx  rt   )r   rw   rx   r   r  	readlinesabspathremoverD  appendrT  
writelinesr  r  r   r  r   showwarningrL   r   r   r  r  r  	enumeraterstrip#_EditorWindow__recent_file_callbackr  )r  new_filerf_listr  rf_list_file	bad_pathsrx   ulcharsrf_fileerrinstancerD   i	file_namecallbacks   &&             r#   r   %EditorWindow.update_recent_files_list  s5    **		22i&y: :=I&002: wwx047H"x(NN1h'	Dt|277>>$q*#=#=  &  %,EGD9/D44GE)!CL)*)S#*9> >AH&&w/> ..H--DKK3 )' 2%,,.	#::9E  wzC'7)'C)1+, ! . !3 /=: : : F
> >  *tyy*?GG48DII1**!%%(E *9!9  $yy	**sO   HH$ H$H< H)*H< H!	)H9	4H< 9H< <J'AJ""J'c                   a  V3V 3R  llpV# )c                 @   < SP                   P                  V R 7       R# ))editFileN)r   r  )
fn_closurer  s   &r#   open_recent_file=EditorWindow.__recent_file_callback.<locals>.open_recent_file  s    GGLL*L-r%   r[   )r  r  r  s   f& r#   __recent_file_callback#EditorWindow.__recent_file_callback  s    (1 	.r%   c                   V P                  4       pV P                  4       pV'       d@   V'       d8   \        P                  ! 4       '       g   VR ,           V,           \        ,           pMV'       d   TpMV'       d   TpMRpT;'       g    T;'       g    TpV P                  4       '       g   RV,          pRV,          pV P                  P                  V4       V P                  P                  V4       \        P                  ! 4       '       dN   V P                  P                  RV4       V P                  P                  RV P                  4       '       * 4       R# R# )z - untitledz*%s*z*%sz
-titlepathz	-modifiedN)
short_title
long_titler   	isCocoaTk_py_version	get_savedr   wm_titlewm_iconnamewm_attributes)r  shortlongr  icons   &    r#   r   EditorWindow.saved_change_hook  s      " T&"2"2"4"4 EMD(;6EEEE%%%%~~UNE4<D% T"HH""<6 HH"";DNN4D0DE r%   c                6    V P                   P                  4       # r&  )r   r  r  s   &r#   r  EditorWindow.get_saved/  s    yy""$$r%   c                <    V P                   P                  V4       R # r&  )r   	set_saved)r  flags   &&r#   r  EditorWindow.set_saved2  s    		D!r%   c                :    V P                   P                  4        R # r&  )r   
reset_undor  s   &r#   r  EditorWindow.reset_undo5  s    		r%   c                    V P                   P                  pV'       d    \        P                  P	                  V4      # R # )r  )r   r  rw   rx   r;  )r  r  s   & r#   r  EditorWindow.short_title8  s-    77##-5rww)E:Er%   c                B    V P                   P                  ;'       g    R # )rB   )r   r  r  s   &r#   r  EditorWindow.long_title<  s    ww%%2%r%   c                &    V P                  4        R # rY   )r6  r'  s   &&r#   r    EditorWindow.center_insert_event?  s    r%   c                    V P                   pV P                  4       w  r4V P                  V4      pWC,
          p\        ^WV^,          ,
          4      pVP	                  \        V4      4       R# rb  N)rL   getwindowlinesr  maxr  r  )r  markrL   r   botr  rS   newtops   &&      r#   r6  EditorWindow.centerC  sS    yy&&(%Q*+

5=!r%   c                    V P                   pV P                  R 4      pV P                  R4      pW#8X  d7   VP                  4       ^8X  d"   \        VR,          4      pW$,           ^,
          pW#3# )r  z@0,65535rS   )rL   r  winfo_heightrI   )r  rL   r   r  rS   s   &    r#   r  EditorWindow.getwindowlinesK  s]    yynnV$nnZ(:$++-2h(F,"Cxr%   c                `    V P                   p\        \        VP                  V4      4      4      # r&  )rL   rI   r  r   )r  r  rL   s   && r#   r  EditorWindow.getlinenoU  s$    yy5D)*++r%   c                    V P                   P                  4       p\        P                  ! RV4      p\	        \        \        VP                  4       4      4      # )zReturn (width, height, x, y)z(\d+)x(\d+)\+(-?\d+)\+(-?\d+))r   wm_geometryrematchlistr-  rI   groups)r  geomms   &  r#   get_geometryEditorWindow.get_geometryY  s=    xx##%HH5t<CQXXZ())r%   c                &    V P                  4        R # rY   )r   r'  s   &&r#   r   EditorWindow.close_event_  s    

r%   c                d   V P                   '       d   V P                  4       '       gn   V P                  P                  4       R 8w  d   V P                  P	                  4        V P                  P                  4        V P                  P                  4        V P                   P                  4       # R# )r  N)r   r  r   rO  	deiconifylowerlift	maybesaver  s   &r#   r  EditorWindow.maybesavec  sn    777>>##88>>#X-HH&&( 77$$&& r%   c                     V P                  4       p\        V4      R 8w  d   V P                  4        V#   \         d     R# i ; i)cancelN)r  rU  _closeAttributeError)r  replys   & r#   r   EditorWindow.closel  s?    	NN$E5zX%L 		s   14 AAc                z   V P                   P                  '       d'   V P                  V P                   P                  R 7       \        P                  ! V P
                  4       V P                  4        V P                   P                  4        RV n         RV n        V P                  '       d"   V P                  P                  4        RV n	        RV n
        RV n        V P                  P                  4        RV n        V P                  P                  4        V P                  '       d   V P                  4        R# R# ))r  N)r   r  r   r   unregister_callbackr   unload_extensionsr   r   r   rL   r   r   r   destroyrC  r  s   &r#   r  EditorWindow._closeu  s    77))4773C3C)D""4#7#78 	:::JJDJ	 ???OO r%   c                4    / V n         V P                  4        R # r&  )
extensionsload_standard_extensionsr  s   &r#   r   EditorWindow.load_extensions  s    %%'r%   c                    \        V P                  P                  4       4       F'  p\        VR 4      '       g   K  VP	                  4        K)  	  / V n        R# )r   N)r  r  valuesr   r   )r  inss   & r#   r  EditorWindow.unload_extensions  s=    ..01CsG$$		 2 r%   c                    V P                  4        F  p V P                  V4       K  	  R#    \        R \        T4      4       \        P
                  ! 4         KJ  ; i)zFailed to load extensionN)rq  load_extensionprintrepr	traceback	print_exc)r  rF   s   & r#   r  %EditorWindow.load_standard_extensions  sJ    557D&##D) 8&0$t*=##%s	   ,,Ac                0    \         P                  ! R R7      # )T)editor_only)r   GetExtensionsr  s   &r#   rq  )EditorWindow.get_standard_extension_names  s    %%$77r%   ZzDummyzzdummyc                &   V P                   P                  W4      p  \        P                  ! R V,           \        R7      p\        Y14      p\        P                  ! T4      p\        TR4      '       d   T P                  TP                  T4       T! T 4      pY`P                  T&   T'       d   T P                  T4       T F  pTP!                  RR4      pTR,          R8X  d   TR,          pK  TRR	 R
8X  d   TR	R pK  TR,           p\        Yh4      '       g   K[  T P"                  P%                  T\        Yh4      4       K  	  R	# R	#   \
        \        3 d    \        P                  ! T4      p EL2i ; i  \
         d    \        RT4       h i ; i)rC  )packagez
Failed to import extension: r{  -r[  Nrb  NrJ  rb  NNNrL  _eventrt   )extfilesr   	importlibimport_module__package__ImportError	TypeErrorr  r  r   rr  r   r  r{  r  r   r   rL   r   )	r  rF   fnamemodclsrs  r  vevent
methodnames	   &&       r#   r  EditorWindow.load_extension  sR   !!$-	5--cEk;O c //53
##OOCLL'2$i #(!#^^C5
 n+!+BJ o,!+CRJ'(2
3++IINN673+CD "   + 5--e45 	2D9	s#   #E	 	'E40E7 3E44E7 7Fc                    Vf   V P                   P                  pV P                  pWn        VP	                  4        F#  w  r4V'       g   K  VP
                  ! V.VO5!   K%  	  R# )z"Add events with keys to self.text.N)r.   rn  rL   rs  ro  r   )r  rs  rL   r\   rt  s   &&   r#   r   EditorWindow.apply_bindings  sL    ?mm33Gyy%mmoNEwu/w/ .r%   c           
     6   Vf   V P                   P                  pVf   V P                   P                  pV P                  pV P                  pV F  w  rVVP                  V4      pV'       g   K   V F  pVf   VP                  4        K  Vw  rV	R,          R8H  pV'       d
   V	R,          p	\        V	4      w  r\        W*4      pWJ3R lpV'       d-   V P                  V
\        4      pVP                  WWVR7       K  VP                  WVVR7       K  	  K  	  R# )zFill in dropdown menus used by this window.

Items whose name begins with '!' become checkbuttons.
Other names indicate commands.  None becomes a separator.
Nr  !r  c                 (    V P                  V4       R # r&  r  r  s   &&r#   re   (EditorWindow.fill_menus.<locals>.command  s    ++I6r%   )rw  rx  re   rz  variable)rw  rx  re   rz  )r.   r{  rn  r   rL   r   r   r  r}  get_var_obj
BooleanVaradd_checkbuttonr  )r  r{  rs  r   rL   mname	entrylistrD   r  rw  r  checkbuttonrx  rz  re   vars   &&&             r#   r  EditorWindow.fill_menus  s	    }}--H?mm33G==yy (E<<&D"=&&(',$E#(9#3K" %b	'.u~$I"1'"EK%) 7""..y*E,,5$+%( - * ((u185@ ) B% #	 !)r%   c                n    V P                  V4      pV'       d   VP                  4       pV# \        V4      hr&  )r0  r   	NameError)r  rF   r6  values   &&  r#   getvarEditorWindow.getvar  s/    t$GGIELD/!r%   c                p    V P                  W4      pV'       d   VP                  V4       R # \        V4      hr&  )r0  r   r9  )r  rF   r:  vartyper6  s   &&&& r#   setvarEditorWindow.setvar  s*    t-GGEND/!r%   c                    V P                   P                  V4      pV'       g*   V'       d"   V! V P                  4      ;V P                   V&   pV# )z:Return a tkinter variable instance for the event.
        )r   r   rL   )r  r  r>  r6  s   &&& r#   r0  EditorWindow.get_var_obj  sB     ##I.w181CCDi(3
r%   c                    V P                   '       dC   V P                  P                  R V4      ;'       g    RV P                  P                  V4      9   # ^# )TODOSTRING)r   rL   tag_prevrange	tag_names)r  
text_indexs   &&r#   is_char_in_stringEditorWindow.is_char_in_string  sL    ::: 99**6:> ? ?tyy22:>>? r%   c                     V P                   P                  R 4      pV P                   P                  R4      pW3#   \         d    Ru # i ; i)rH  rK  NNr  )r  r^  r_  s   &  r#   get_selection_indices"EditorWindow.get_selection_indices  sH    	IIOOK0E99??:.D; 		s   8; A
Ac                Z    V P                   R ,          ;'       g    \        p\        V4      # tabs)rL   TK_TABWIDTH_DEFAULTrI   )r  currents   & r#   get_tk_tabwidthEditorWindow.get_tk_tabwidth&  s#    ))F#::':7|r%   c           	         V P                   pV P                  4       V8w  dM   VP                  P                  R RVR ,          RVP                  RV,          4      pVP                  VR7       R# R# )rj   r2  z
-displayofnrP  N)rL   rT  r.  r  master	configure)r  newtabwidthrL   pixelss   &&  r#   set_tk_tabwidthEditorWindow.set_tk_tabwidth,  s^    yy![0WW\\&)T&\"."%"35F NNN' 1r%   c                    V'       dS   V'       dK   V P                  4       p^Tu;8:  d   ^8:  d
   M MW0n        V P                  V P                  8w  d   RV n        V P	                  V P                  4       R# )rC   FN)guess_indentr   r   r   r\  )r  r  guessr  s   &&& r#   r   #EditorWindow.set_indentation_params7  sQ    !!#AA{{#$ 4==0$T]]+r%   c                   V P                   pV P                  4       w  r4V'       d.   V'       d&   VP                  W44       VP                  R V4       R# VP	                  RR 4      pVR8X  d?   VP                  R RR4      '       d   VP                  R4       R# VP                  4        R# VR,          R9  d   VP                  R4       R# V P                  p\        VP                  V4      4      pV^ 8  g   Q hV^,
          V P                  ,          V P                  ,          p^ p	 VRR pV	^,           p	\        VP                  V4      4      pWx8:  g   VR,          R9  g   K?   TP                  4        TP                  R	T	,          R 4       Yx8  d+   TP                  R R
Y,
          ,          T P                  4       TP                  4        R# )rD  rZ   rB  rB   rL  rG  z	insert-1c 	Nz
insert-%dcrM  rt   )rL   rM  r  rW  r   rQ  bellr   rT  
expandtabsr   r   rD  r   r   )
r  r\   rL   r^  r_  charsr   havewantncharsdeleteds
   &&        r#   r   "EditorWindow.smart_backspace_event@  s   yy002TKK$MM(E* +X6B;||Hc511K(  		"IU"KK$ ==5##H-.axxd...$2B2BB#2JE)A-Mu''12D|uRy5L=0(;;KK#"5335r%   c                d   V P                   pV P                  4       w  r4VP                  4         V'       dp   V'       dh   \        V4      \        V4      8w  d,   V P                  P                  V4      VP                  4        # VP                  W44       VP                  R V4       VP                  RR 4      p\        WPP                  4      w  rgV\        V4      8X  d#   V P                  WpP                  ,           4       MwV P                  '       d   RpMF\        VP!                  V P                  4      4      pV P                  p	RWV	,          ,
          ,          pVP#                  R WP$                  4       VP'                  R 4        VP                  4        R#   TP                  4        i ; i)rD  rB  rN  rM  rZ   )rL   rM  r   
index2liner   r   r   r  rW  r   get_line_indentr   rT  reindent_tor   r   re  rD  r   rY  )
r  r\   rL   r^  r_  prefixraw	effectivepadrW  s
   &&        r#   r   EditorWindow.smart_indent_eventk  sF    yy002	#e$
4(88<<;;EB(   "' E(h.XX0(;F,V]]CNCc&k!  -=-=!=> <<<C #F$5$5dmm$D EI((A]!23CHc+F+FGHHX  "D  "s   F  3F BF A6F F/c                	   V P                   pV P                  4       w  r4VP                  4         V'       d,   V'       d$   VP                  W44       VP	                  RV4       VP                  RR4      p^ \        V4      rvWg8  d   WV,          R9   d   V^,          pK  Wg8X  dB   VP                  RRV P                  4        VP                  R4       VP                  4        R# VRV p^ pV'       d   VR,          R9   d   VRR pV^,          pK&  V'       d   VP                  RV,          R4       VP                  R4      R9   d   VP                  R4       K)  VP                  RRV P                  4       \        VP                  R4      4      p	\        P                  ! V P                  V P                   4      p
V P"                  '       g   V P$                   Fw  p\'        W,
          ^4      p\)        V4      R,           pVP                  VR4      pV
P+                  V4       V
P-                  V P/                  V4      4      pVf
   V^8X  g   Kw   M	  T
P1                  X;'       g    ^ 4       MZVP3                  R	R4      pV'       d   V^,          pMR
pVP                  VR4      pV
P+                  V4       V
P1                  ^ 4       V
P5                  4       pV\        P6                  8w  Ed   V\        P8                  8X  d   MV\        P:                  8X  d   VP                  RWP                  4       MV\        P<                  8X  d!   V P?                  V
PA                  4       4       MsV\        PB                  8X  dT   V
PE                  4       ^8  d   VP                  RVV P                  4       M+V P?                  V
PG                  4       4       MQ RT: 24       h VP                  R4       VP                  4        R# V
PI                  4       pVP                  RWP                  4       V
PK                  4       '       d   V PM                  V4       M/V'       d(   V
PO                  4       '       d   V PQ                  V4        VP                  R4       VP                  4        R#   TP                  R4       TP                  4        i ; i)aU  Insert a newline and indentation after Enter keypress event.

Properly position the cursor on the new line based on information
from the current line.  This takes into account if the current line
is a shell prompt, is empty, has selected text, contains a block
opener, contains a block closer, is a continuation line, or
is inside a string.
rD  rB  rc  r^  rZ   Nzinsert - %d charsr  consolerG  zbogus continuation type rt   ))rL   rM  r   r  rW  r   rT  rD  r   rY  r   rl  r   r   Parserr   r   r   r   r  r  set_codefind_good_parse_start_build_char_in_string_funcset_lorF  get_continuation_typeC_NONEC_STRING_FIRST_LINEC_STRING_NEXT_LINES	C_BRACKETrn  compute_bracket_indentC_BACKSLASHget_num_lines_in_stmtcompute_backslash_indentget_base_indent_stringis_block_openerr   is_block_closerr   )r  r\   rL   r^  r_  r[  r  rW  indentlnor  contextstartatstartatindexrawtextbodrrE  s   &&                r#   r   %EditorWindow.newline_and_indent_event  s    yy002e	#E(h.88.9D c$iq%DGu,Qv . 779j HHX  "k "1XF A48u,CRyQ/!3X> ((8$-H% KK$(C(CD TZZ12Ct//?A(((#55G!#-3G#'=4#7L"hh|X>GJJw'11 ;;LIKC'Q,  6 "&&y(;#$Q4L#(L((<:

7#'')AGNN"333'555 KK&2M2MN'+++
 $$Q%=%=%?@'--- ..014Hf$($?$?A (()C)C)EF> 8>>1 HHX  " --/FKK&*E*EF  ""''.A--//**51HHX  " HHX  "sK   R/  BR/ &R/ 5%R/ D4R/ R/ ,!R/ ER/ AR/ $R/ :R/ /#Sc                (    VV P                   3R  lpV# )c                 .    V! VR V ,          ,           4      # )z+%dcr[   )offset_startindex_iciss   &&&r#   inner6EditorWindow._build_char_in_string_func.<locals>.inner  s    v677r%   )rI  )r  
startindexr  s   && r#   ry  'EditorWindow._build_char_in_string_func  s    &0..	8 r%   c                    V P                   '       d/   \        WP                  4      w  r#R V,          RV,          ,           # RV,          # )rN  rM  )r   divmodr   )r  rW  ntabsnspacess   &&  r#   _make_blanksEditorWindow._make_blanks  s7    <<<#A}}5NE%<#-//7Nr%   c                   V P                   pVP                  4        VP                  R RR4      '       d   VP                  R R4       V'       d-   VP	                  RV P                  V4      V P                  4       VP                  4        R# )rB  z!=rD  N)rL   r   rQ  r  rD  r  r   r   )r  rg   rL   s   && r#   rn  EditorWindow.reindent_to   sm    yy<<*D(;;KK*H5KK$"3"3F";335r%   c                    \        V P                  4      P                  4       w  rV'       d?   V'       d7   \        WP                  4      w  r4\        W P                  4      w  r5WT,
          # ^ ;rEWT,
          # )r   )IndentSearcherrL   runrm  r   )r  openerindentedrp  indentsmallindentlarges   &     r#   r_  EditorWindow.guess_indent/  sa    )$))488:h.v}}EC.xGC (( )*)K((r%   c                    V P                   f   R # V P                   P                  '       d   V P                   P                  4        RpMV P                   P                  4        RpV P	                  RRV R2R7       R # )NShowHiderp   rr   z Line Numbers)rD   r   rw  )r   is_shownhide_sidebarshow_sidebarr  )r  r\   
menu_labels   && r#   r  &EditorWindow.toggle_line_numbers_event8  ss    $%%%**,J**,JI](2|=%A 	 	Cr%   )$r   r   r  rC  r   r   r
  r\   r  r   r   r   r   r   r   r   r   r   r   r   r  r   r  r   r   rg  r   rL   r   r   r   r   r   rE   rH   r   )NNNNr&  ))r}  _File)edit_Edit)formatF_ormat)r  _Run)rp   _Options)r   _Window)r   _Help)CloserU   N)rD  rL  )T)r&  
__module____qualname____firstlineno__idlelib.percolatorr(   idlelib.colorizerr)   r*   idlelib.undor+   idlelib.iomenur,   r-   r'  r.   idlelib.statusbarr/   idlelib.autocompleter0   idlelib.autoexpandr1   idlelib.calltipr2   idlelib.codecontextr3   idlelib.sidebarr4   idlelib.formatr5   r6   r7   r8   idlelib.parenmatchr9   idlelib.zoomheightr:   r   getfilesystemencodingfilesystemencodingrv   r  r  r   r#  r   r   r   r   r   rl  r~  r   r   r  r  r   r  r   r  r  r  r  r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r7  r   rC  rF  r   rP  rU  r   stringascii_lettersdigitsr_  rb  r   rj  rw  r  r   r  r  r   r  r   r  r  r  r  r  r   r6  r  r  r  r   r  r   r  r   r  r  rq  r  r  r   r  r;  r?  r0  rI  rM  rT  r\  r   r   r   r   ry  r  rn  r_  r  __static_attributes____classdictcell____classdict__s   @r#   r'   r'   3   s    ->*2 01-'/+MM--224H!aIF	4
)V7 ;&J#'J)1
1
	 E!J 	,K

'4	

(0	
:
%K. %%5;J	A"<&GP>)"",.\ 
F6%"F&",*'((&8 	9
HE80$BL""$(,)V!#Fq#p )C Cr%   r'   c                 *    \        \        V 4      4      # r&  )rI   r  )r   s   &r#   rl  rl  F  s    uU|r%   z[ \t]*c                    \         P                  V 4      pVP                  4       \        VP	                  4       P                  V4      4      3# )zReturn a line's indentation as (# chars, effective # of spaces).

The effective # of spaces is the length after properly "expanding"
the tabs into spaces, as done by str.expandtabs(tabwidth).
)_line_indent_rer  ro   rT  groupre  )r[  r   r  s   && r#   rm  rm  K  s;     	d#A557C	,,X6777r%   c                   n   a  ] tR tRt o RtR tR t]P                  ]P                  R	3R lt
R tRtV tR# )
r  iU  z4Manage initial indent guess, returned by run method.c                J    Wn         ^ ;V n        V n        R;V n        V n        R# )r   N)rL   r  finishedblkopenlineindentedline)r  rL   s   &&r#   r#  IndentSearcher.__init__X  s%    	!""/334,r%   c                   V P                   '       d   R # V P                  ^,           ;qn        \        V4      R,           pV P                  P	                  VRR4      '       d   R # V P                  P                  W"R,           4      # )rB   r  z>=ro   z lineend+1c)r  r  r  rL   rQ  r   )r  r  r  s   &  r#   readlineIndentSearcher.readline]  sa    ===VVaZFAw~99T4//yy}}T-#788r%   c	                    V P                   '       d   R# W8X  d   W(9   d	   WPn        R# W8X  d$   V P                  '       d   WPn        ^V n         R# R# R# r  )r  r  r  )	r  rK   tokenstartro   r[  INDENTNAMEOPENERSs	   &&&&&&&&&r#   
tokeneaterIndentSearcher.tokeneaterf  sD    
 ===\e.#^ 0 0 0 $DM !1^r%   c                     \         P                  ! V P                  4      pV F  pV P                  ! V!   K  	  V P                  V P                  3#   \         P                  \
        3 d     L5i ; i)z`Return 2 lines containing block opener and indent.

Either the indent line or both may be None.
)tokenizegenerate_tokensr  r  
TokenErrorSyntaxErrorr  r  )r  tokensr  s   &  r#   r  IndentSearcher.runs  si    
	--dmm<F'  
 !2!222 ##[1 		s   9A A10A1)r  r  r  r  rL   N)classdefforifr  trywhilewith)r&  r  r  r  __doc__r#  r  r  r  r  r  r  r  r  r  s   @r#   r  r  U  s6     :4
9 #// -3 3r%   r  c                b    V P                  R4      pV^ 8  d   V RV W^,           R ,           p W3# )zExtract the underscore from a string.

For example, prepstr("Co_py") returns (2, "Copy").

Args:
    s: String with underscore.

Returns:
    Tuple of (position of underscore, string without underscore).
r[  N)r  )sr  s   & r#   r  r    s6     	
sAAvbqEAcdGO4Kr%   bracketleft[bracketright]slash/c                F   V P                  V4      pV'       d#   \        P                  ! 4       '       d
   VR9   d   R# V^ ,          p\        P                  ! RR V4      p\        P                  ! RR V4      p\        P                  ! RRV4      p\        P                  ! RRV4      p\        P                  ! R	R
V4      p\        P                  ! RRV4      p\        P                  ! RRV4      p\        P                  ! RRV4      p\        P                  ! RRV4      pV# )aK  Return a formatted string for the keybinding of an event.

Convert the first keybinding for a given event to a form that
can be displayed as an accelerator on the menu.

Args:
    keydefs: Dictionary of valid events to keybindings.
    eventname: Event to retrieve keybinding for.

Returns:
    Formatted string of the keybinding.
rB   z-[a-z]\bc                 >    V P                  4       P                  4       # r&  )r  upperr  s   &r#   r]   !get_accelerator.<locals>.<lambda>  s    aggioo&7r%   z\b\w+\bc                 f    \         P                  V P                  4       V P                  4       4      # r&  )keynamesr   r  r  s   &r#   r]   r    s    X\\!'')QWWY%Gr%   zKey-Cancelz
Ctrl-BreakzControl-zCtrl-r  +z><rM  rJ  rL  >   r_   rW   r`   )r   r   r  r  sub)rs  r  rt  r  s   &&  r#   r}  r}    s     kk)$G ))++	 >6 16 
A
{7;A
zGKA
vr1A
xq)A
z7A&A
sCA
tS!A
sBA
sBAHr%   c                     V P                   pVP                  R R^ 4       VP                  RRR4       VP                  RRR4       R# )tcl_wordBreakAfterza br   tcl_wordcharsz\wtcl_nonwordcharsz\WN)r.  r  )r   r.  s   & r#   fixwordbreaksr    s?     
BGG %+GGE?E*GGE%u-r%   c                 z   T p\        V4       \        P                  R ,          '       d   \        P                  ^,          pMRp\        P                  ! VR4       \        WR7      pVP                  p^
VR&   \        ^4       F3  pVP                  RRV,          \        V4      ,           R,           4       K5  	  R# )r  N)r   r  rS   rD  z  r^  )
r  r   argvr   setupAppr'   rL   rS  rD  rU  )r  r   r  r  rL   r  s   &     r#   _editor_windowr    s    D$
xx||88A;
OOD$T5D99DDN2YHd1fs1vo45 r%   __main__)rG   zidlelib.idle_test.test_editorF)	verbosityexit)r  ):importlib.abcr  importlib.utilrw   r{   r  r  r   r  r  r  tkintertkinter.fontr   tkinter.ttkr   r   r   idlelib.configr   r'  r	   r
   r   r   r   idlelib.multicallr   r   r   r   r   idlelib.treer   idlelib.utilr   r   rR  python_versionr  r   r$   r'   rl  compiler  rm  r  r  r  r}  r  r  r&  unittestrG   idlelib.idle_test.htestr  r[   r%   r#   <module>r#     s     	  	  
      !    #       .     $ &   //11		!
PC PCf0 **Y'8*3 *3^$ #(V.6& z	(AEB+ r%   