/opt/alt/python37/lib64/python3.7/idlelib/__pycache__
NameSizeModeActions
autocomplete.cpython-37.opt-1.pyc67960644editdlrm
autocomplete.cpython-37.opt-2.pyc53980644editdlrm
autocomplete.cpython-37.pyc67960644editdlrm
autocomplete_w.cpython-37.opt-1.pyc110320644editdlrm
autocomplete_w.cpython-37.opt-2.pyc102740644editdlrm
autocomplete_w.cpython-37.pyc110900644editdlrm
autoexpand.cpython-37.opt-1.pyc28260644editdlrm
autoexpand.cpython-37.opt-2.pyc20760644editdlrm
autoexpand.cpython-37.pyc28260644editdlrm
browser.cpython-37.opt-1.pyc94900644editdlrm
browser.cpython-37.opt-2.pyc68230644editdlrm
browser.cpython-37.pyc94900644editdlrm
calltip.cpython-37.opt-1.pyc55720644editdlrm
calltip.cpython-37.opt-2.pyc39510644editdlrm
calltip.cpython-37.pyc55720644editdlrm
calltip_w.cpython-37.opt-1.pyc61680644editdlrm
calltip_w.cpython-37.opt-2.pyc52350644editdlrm
calltip_w.cpython-37.pyc61680644editdlrm
codecontext.cpython-37.opt-1.pyc86950644editdlrm
codecontext.cpython-37.opt-2.pyc57000644editdlrm
codecontext.cpython-37.pyc87300644editdlrm
colorizer.cpython-37.opt-1.pyc102660644editdlrm
colorizer.cpython-37.opt-2.pyc81720644editdlrm
colorizer.cpython-37.pyc102660644editdlrm
config.cpython-37.opt-1.pyc298720644editdlrm
config.cpython-37.opt-2.pyc199520644editdlrm
config.cpython-37.pyc298720644editdlrm
configdialog.cpython-37.opt-1.pyc786130644editdlrm
configdialog.cpython-37.opt-2.pyc484560644editdlrm
configdialog.cpython-37.pyc786130644editdlrm
config_key.cpython-37.opt-1.pyc113390644editdlrm
config_key.cpython-37.opt-2.pyc99190644editdlrm
config_key.cpython-37.pyc113390644editdlrm
debugger.cpython-37.opt-1.pyc142190644editdlrm
debugger.cpython-37.opt-2.pyc140680644editdlrm
debugger.cpython-37.pyc142190644editdlrm
debugger_r.cpython-37.opt-1.pyc137710644editdlrm
debugger_r.cpython-37.opt-2.pyc113800644editdlrm
debugger_r.cpython-37.pyc138970644editdlrm
debugobj.cpython-37.opt-1.pyc51770644editdlrm
debugobj.cpython-37.opt-2.pyc51770644editdlrm
debugobj.cpython-37.pyc51770644editdlrm
debugobj_r.cpython-37.opt-1.pyc20180644editdlrm
debugobj_r.cpython-37.opt-2.pyc20180644editdlrm
debugobj_r.cpython-37.pyc20180644editdlrm
delegator.cpython-37.opt-1.pyc12800644editdlrm
delegator.cpython-37.opt-2.pyc11800644editdlrm
delegator.cpython-37.pyc12800644editdlrm
dynoption.cpython-37.opt-1.pyc22910644editdlrm
dynoption.cpython-37.opt-2.pyc19110644editdlrm
dynoption.cpython-37.pyc22910644editdlrm
editor.cpython-37.opt-1.pyc466050644editdlrm
editor.cpython-37.opt-2.pyc447050644editdlrm
editor.cpython-37.pyc466920644editdlrm
filelist.cpython-37.opt-1.pyc33760644editdlrm
filelist.cpython-37.opt-2.pyc33430644editdlrm
filelist.cpython-37.pyc34020644editdlrm
format.cpython-37.opt-1.pyc134400644editdlrm
format.cpython-37.opt-2.pyc97170644editdlrm
format.cpython-37.pyc134400644editdlrm
grep.cpython-37.opt-1.pyc77910644editdlrm
grep.cpython-37.opt-2.pyc50960644editdlrm
grep.cpython-37.pyc77910644editdlrm
help.cpython-37.opt-1.pyc103760644editdlrm
help.cpython-37.opt-2.pyc76070644editdlrm
help.cpython-37.pyc104180644editdlrm
help_about.cpython-37.opt-1.pyc73370644editdlrm
help_about.cpython-37.opt-2.pyc62150644editdlrm
help_about.cpython-37.pyc73370644editdlrm
history.cpython-37.opt-1.pyc33940644editdlrm
history.cpython-37.opt-2.pyc21690644editdlrm
history.cpython-37.pyc33940644editdlrm
hyperparser.cpython-37.opt-1.pyc67490644editdlrm
hyperparser.cpython-37.opt-2.pyc54420644editdlrm
hyperparser.cpython-37.pyc67490644editdlrm
idle.cpython-37.opt-1.pyc3390644editdlrm
idle.cpython-37.opt-2.pyc3390644editdlrm
idle.cpython-37.pyc3390644editdlrm
iomenu.cpython-37.opt-1.pyc137800644editdlrm
iomenu.cpython-37.opt-2.pyc133120644editdlrm
iomenu.cpython-37.pyc137800644editdlrm
macosx.cpython-37.opt-1.pyc75940644editdlrm
macosx.cpython-37.opt-2.pyc54120644editdlrm
macosx.cpython-37.pyc75940644editdlrm
mainmenu.cpython-37.opt-1.pyc34610644editdlrm
mainmenu.cpython-37.opt-2.pyc29900644editdlrm
mainmenu.cpython-37.pyc34610644editdlrm
multicall.cpython-37.opt-1.pyc149370644editdlrm
multicall.cpython-37.opt-2.pyc125720644editdlrm
multicall.cpython-37.pyc149940644editdlrm
outwin.cpython-37.opt-1.pyc60620644editdlrm
outwin.cpython-37.opt-2.pyc43780644editdlrm
outwin.cpython-37.pyc60620644editdlrm
parenmatch.cpython-37.opt-1.pyc63340644editdlrm
parenmatch.cpython-37.opt-2.pyc47880644editdlrm
parenmatch.cpython-37.pyc63340644editdlrm
pathbrowser.cpython-37.opt-1.pyc37430644editdlrm
pathbrowser.cpython-37.opt-2.pyc36020644editdlrm
pathbrowser.cpython-37.pyc37430644editdlrm
percolator.cpython-37.opt-1.pyc35160644editdlrm
percolator.cpython-37.opt-2.pyc35160644editdlrm
percolator.cpython-37.pyc36540644editdlrm
pyparse.cpython-37.opt-1.pyc116390644editdlrm
pyparse.cpython-37.opt-2.pyc80600644editdlrm
pyparse.cpython-37.pyc119880644editdlrm
pyshell.cpython-37.opt-1.pyc422510644editdlrm
pyshell.cpython-37.opt-2.pyc395230644editdlrm
pyshell.cpython-37.pyc423810644editdlrm
query.cpython-37.opt-1.pyc128150644editdlrm
query.cpython-37.opt-2.pyc100930644editdlrm
query.cpython-37.pyc128150644editdlrm
redirector.cpython-37.opt-1.pyc67630644editdlrm
redirector.cpython-37.opt-2.pyc33310644editdlrm
redirector.cpython-37.pyc67630644editdlrm
replace.cpython-37.opt-1.pyc93580644editdlrm
replace.cpython-37.opt-2.pyc65160644editdlrm
replace.cpython-37.pyc93580644editdlrm
rpc.cpython-37.opt-1.pyc196040644editdlrm
rpc.cpython-37.opt-2.pyc160580644editdlrm
rpc.cpython-37.pyc196910644editdlrm
run.cpython-37.opt-1.pyc176770644editdlrm
run.cpython-37.opt-2.pyc152020644editdlrm
run.cpython-37.pyc177250644editdlrm
runscript.cpython-37.opt-1.pyc70700644editdlrm
runscript.cpython-37.opt-2.pyc58360644editdlrm
runscript.cpython-37.pyc70700644editdlrm
scrolledlist.cpython-37.opt-1.pyc54030644editdlrm
scrolledlist.cpython-37.opt-2.pyc54030644editdlrm
scrolledlist.cpython-37.pyc54030644editdlrm
search.cpython-37.opt-1.pyc59310644editdlrm
search.cpython-37.opt-2.pyc34390644editdlrm
search.cpython-37.pyc59310644editdlrm
searchbase.cpython-37.opt-1.pyc80370644editdlrm
searchbase.cpython-37.opt-2.pyc52770644editdlrm
searchbase.cpython-37.pyc80370644editdlrm
searchengine.cpython-37.opt-1.pyc68410644editdlrm
searchengine.cpython-37.opt-2.pyc51910644editdlrm
searchengine.cpython-37.pyc68410644editdlrm
sidebar.cpython-37.opt-1.pyc109870644editdlrm
sidebar.cpython-37.opt-2.pyc95390644editdlrm
sidebar.cpython-37.pyc109870644editdlrm
squeezer.cpython-37.opt-1.pyc95200644editdlrm
squeezer.cpython-37.opt-2.pyc63330644editdlrm
squeezer.cpython-37.pyc95570644editdlrm
stackviewer.cpython-37.opt-1.pyc50540644editdlrm
stackviewer.cpython-37.opt-2.pyc50540644editdlrm
stackviewer.cpython-37.pyc50540644editdlrm
statusbar.cpython-37.opt-1.pyc19490644editdlrm
statusbar.cpython-37.opt-2.pyc19490644editdlrm
statusbar.cpython-37.pyc19490644editdlrm
textview.cpython-37.opt-1.pyc70650644editdlrm
textview.cpython-37.opt-2.pyc49090644editdlrm
textview.cpython-37.pyc70650644editdlrm
tooltip.cpython-37.opt-1.pyc65700644editdlrm
tooltip.cpython-37.opt-2.pyc49480644editdlrm
tooltip.cpython-37.pyc65700644editdlrm
tree.cpython-37.opt-1.pyc156960644editdlrm
tree.cpython-37.opt-2.pyc143520644editdlrm
tree.cpython-37.pyc156960644editdlrm
undo.cpython-37.opt-1.pyc107690644editdlrm
undo.cpython-37.opt-2.pyc107690644editdlrm
undo.cpython-37.pyc107690644editdlrm
window.cpython-37.opt-1.pyc31950644editdlrm
window.cpython-37.opt-2.pyc31950644editdlrm
window.cpython-37.pyc31950644editdlrm
zoomheight.cpython-37.opt-1.pyc27980644editdlrm
zoomheight.cpython-37.opt-2.pyc27490644editdlrm
zoomheight.cpython-37.pyc27980644editdlrm
zzdummy.cpython-37.opt-1.pyc12100644editdlrm
zzdummy.cpython-37.opt-2.pyc11420644editdlrm
zzdummy.cpython-37.pyc12100644editdlrm
__init__.cpython-37.opt-1.pyc5130644editdlrm
__init__.cpython-37.opt-2.pyc1510644editdlrm
__init__.cpython-37.pyc5130644editdlrm
__main__.cpython-37.opt-1.pyc2740644editdlrm
__main__.cpython-37.opt-2.pyc2030644editdlrm
__main__.cpython-37.pyc2740644editdlrm
Edit: /opt/alt/python37/lib64/python3.7/idlelib/__pycache__/editor.cpython-37.opt-1.pyc (46605B)
B  fNã@sèddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Tddl m Z ddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lm Z dd lm!Z!ddlm"Z"ddlm#Z#ddl$m%Z%ddlm&Z&dZ'de (¡Z)ejdkZ*dd„Z+Gdd„de,ƒZ-dd„Z.e /d¡Z0dd„Z1Gdd„de,ƒZ2d d!„Z3d"d#d$d%œZ4d&d'„Z5d(d)„Z6d*d+„Z7e8d,krädd-l9m:Z:e:d.d/d0d1dd2l;md;d<„Z?dâd=d>„Z@dãd?d@„ZAdädAdB„ZBdådCdD„ZCdEdF„ZDdGdH„ZEdIdJ„ZFdædKdL„ZGdçdMdN„ZHdOdP„ZIdQdR„ZJdSdT„ZKdUdV„ZLdWdX„ZMdYdZ„ZNd[d\„ZOd]d^„ZPd_d`„ZQdadb„ZRdcdd„ZSdèdedf„ZTdédgdh„ZUdêdidj„ZVdkdl„ZWdmdn„ZXdodp„ZYdqdr„ZZdsdt„Z[dudv„Z\dwdx„Z]dydz„Z^e_j`e_jad{Zbd|d}„Zcd~d„Zdd€d„Zed‚dƒ„Zfd„d…„Zgd†d‡„Zhdˆd‰„ZidŠd‹„ZjdëdŒd„ZkdŽd„Zldd‘„Zmd’d“„Znd”d•„Zod–d—„Zpd˜d™„Zqdšd›„Zrdœd„ZsdìdŸd „Ztd¡d¢„Zudíd£d¤„Zvd¥d¦„Zwd§d¨„Zxd©dª„Zyd«d¬„Zzd­d®„Z{d¯d°„Z|d±d²„Z}d³d´„Z~dµd¶„Zd·d¸iZ€d¹dº„Zdîd»d¼„Z‚dïd½d¾„Zƒd¿dÀ„Z„dðdÁd„Z…dñdÃdÄ„Z†dÅdÆ„Z‡dÇdÈ„ZˆdÉdÊ„Z‰dËdÌ„ZŠdòdÍd΄Z‹dÏdЄZŒdÑdÒ„ZdÓdÔ„ZŽdÕdÖ„Zd×dØ„ZdÙdÚ„Z‘dÛdÜ„Z’dódÝdÞ„Z“dS)ôÚ EditorWindowr)Ú Percolator)ÚColorDelegatorÚ color_config)Ú UndoDelegator)Ú IOBindingÚencoding)Úmainmenu)ÚMultiStatusBar)Ú AutoComplete)Ú AutoExpand)ÚCalltip)Ú CodeContext)Ú LineNumbers)ÚFormatParagraphÚ FormatRegionÚIndentsÚRstrip)Ú ParenMatch)ÚSqueezer)Ú ZoomHeightNTc CsH ddlm}tjdkrtj tjdd¡}tj   d¡rvddtj dd…}tj  d ¡r^d }qÌd }tj ||dd¡}nVtj dd…d kr²tj tjdd t ƒ¡} tj | ¡rÌ| }ntj dkrÌtj tjd¡}tj |¡}tj |¡r|t_tj dkrdtjt_ndtj dd…t_||_|p*|j}||_t|ƒ|_tj||jd|_} |rl|j|_|j|j_ni|_i|j_tjotj tjd¡|_d|_t| ƒ|_ } t!| dd|_"} tj#ddddd} dddd| d tj#ddd!ddd"œ}t$t%ƒ| f|Ž|_&}|j&|j_'| (¡| )¡|j *d#|j+¡|j ,d$|j-¡t. /¡rt| ,d$|j-¡| ,d%|j0¡| ,d&|j0¡n| ,d'|j0¡| ,d(t1¡| ,d)t1¡| ,d*t1¡| ,d+|j2¡| ,d,|j3¡| ,d-|j4¡| ,d.|j5¡| ,d/|j6¡| ,d0|j7¡| ,d1|j8¡| ,d2|j9¡| ,d3|j:¡| ,d4|j;¡| ,d5d6d7„¡| ,d8|j<¡| ,d9|j=¡| ,d:|j>¡| ,d;|j?¡| ,d<|j@¡| ,d=|jA¡| ,d>|jB¡| ,d?|jC¡| ,d@|jD¡| ,dA|jE¡| ,dB|jF¡| G|¡|_H}| ,dC|jI¡| ,dD|jJ¡| ,dE|jK¡| ,dF|jL¡| ,dG|jM¡| ,dH|jN¡| O|¡}| ,dI|jP¡| ,dJ|jQ¡| ,dK| Rd¡¡| ,dL| RdM¡¡| ,dN|jS¡| ,dO|jT¡| ,dP|jU¡|r||j|<|rÔ||jV|<| ,dQ|jW¡| ,dR|jjX¡| ,dS|jY¡| ,dT|jZ¡| ,dU|j[¡| \¡| j]t^t_dMdV| j`dMdMdW| jadMdMdW|jb| dX<| jcdMdtddY| je|dZ<t f|jdd¡|d[<|jcdMdMtddY| g¡| h¡tj#dd\d]d^d}| |_id_|_j|jj|_k| l¡tmtd`ƒsð|j&dat_n| o¡db|_p| q|¡|_r}| s¡|_t}| u|¡|jv|_v|jw|_w| x|jy¡| z|¡|_{}| ||j}¡dc|_~| dc¡d|_€d|_d|_‚|rÚtj ƒ|¡rÊtj  |¡sÊ| „|¡rÚdd|_~| …|¡}| |¡n| †|¡dd|_~| ‡¡| y¡| ˆ¡| ‰¡|jŠ ‹de¡}|rP| Œdf¡}|dkr$dg}|dkr>| ¡|dM}||_Žt |j¡t‘j’|_’t“j”|_”t‘j•|_•| –dhdi¡| –djdkdldm¡| –dndo¡| –dpdq¡| –drdqdsdt¡| —|¡}| ,dh|j˜¡| ,dj|j™¡| ,du|jš¡| ,dv| ›|¡jœ¡| ,dw| |¡jž¡| Ÿ|¡}| ,dx|j ¡| ,dr|j¡¡||ƒ}| ,dy|j¢¡| ,dz|j£¡| ,d{|j¤¡| ,d|| ¥|¡j¦¡| §|¡|_¨}| ,dn|j©¡| ,dp|jª¡| ,d}|j«¡| ,d~| ¬|¡j­¡|j®rè| ¯|¡|_| ,d|jj°¡n| ±d€dd‚¡|j² r6| ³|¡|_‚tj#dddƒd^d r&| ´¡| ,d„|j´¡n| ±d€d…d‚¡dS)†Nr)Ú ScriptBindingZDocz index.htmlZlinuxz python-docs-z%s.%s.%séz/var/www/html/python/z/var/www/html/python/index.htmlz/usr/share/doc/Úwinz Python%s.chmrz0Resources/English.lproj/Documentation/index.htmlzfile://zhttps://docs.python.org/%d.%d/é)Úmenuzrecent-files.lstÚÚvbar)ÚnameÚmainr!ÚwidthÚint)ÚtypeÚtextéZnoneZ wordprocessorÚheight)r=ÚpadxZwrapZhighlightthicknessr?ZtabstylerDZWM_DELETE_WINDOWz<>zz<2>z<3>z z z z z<>z<>z <>z<>z<>z<>z<>z<>z<>z<>cSsdS)NÚbreakr)ÚeventrrrÚ©óz'EditorWindow.__init__..z<>z<>z<>z<>z<>z<>z <>z <>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>zzéz<>z<>z<>z<>z<>z<>z<>z<>)ÚsideÚfillÚexpand)ZweightÚcommand)ÚrowÚcolumnZstickyZyscrollcommandÚfontÚIndentz use-spacesÚboolrÚblink_off_timeÚ insertofftime)é2iôi@KLFTrÚendéÿÿÿÿz<>z z<>zzzz<>zz<>zz<>zzz<>z<>z<>z<>z<>z<>z<>z <>z<>z<>z<>Úoptionsz *Code ContextÚdisabledzline-numbers-defaultz<>z *Line Numbers)µZidlelib.runscriptr6r!Úhelp_urlÚosÚpathÚjoinrÚ base_prefixÚplatformÚcountrÚisdirr ÚisfileÚnormpathÚflistÚrootÚMenuÚmenubarrZListedToplevelÚtopÚvarsÚ tkinter_varsZ inversedictÚ instance_dictrZuserdirÚrecent_files_pathÚprompt_last_lineÚFrameÚ text_framerr<Ú GetOptionr ZTextrBZfocused_widgetÚ createmenubarÚapply_bindingsZprotocolÚcloseÚbindÚ close_eventr ZisAquaTkÚright_menu_eventrÚ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_eventr0ÚfregionÚindent_region_eventZdedent_region_eventZcomment_region_eventZuncomment_region_eventZtabify_region_eventZuntabify_region_eventr1Ztoggle_tabs_eventZchange_indentwidth_eventÚmove_at_edge_if_selectionÚ del_word_leftÚdel_word_rightÚ home_callbackÚdictÚ new_callbackZclose_all_callbackÚopen_module_browserÚopen_path_browserÚopen_turtle_demoÚset_status_barÚpackZLEFTZBOTHZ rowconfigureZcolumnconfigureÚ handle_yviewZgridZNSEWÚsetÚGetFontZ focus_setÚ set_widthÚusetabsÚtabwidthÚ indentwidthÚset_notabs_indentwidthÚhasattrrTÚupdate_cursor_blinkÚnum_context_linesr"Úperr%ÚundoÚ insertfilterÚundo_block_startÚundo_block_stopZset_saved_change_hookÚsaved_change_hookr&ÚioZset_filename_change_hookÚfilename_change_hookZ good_loadÚset_indentation_paramsÚcolorÚ code_contextÚ line_numbersÚexistsÚloadfileÚispythonsourceZ set_filenameÚResetColorizerÚupdate_recent_files_listÚload_extensionsÚmenudictÚgetÚindexÚ add_separatorÚ wmenu_endZregister_callbackÚpostwindowsmenuÚ tkMessageBoxZaskyesnoÚtkSimpleDialogZ askintegerÚ showerrorÚ event_addr*Zautocomplete_eventZtry_open_completions_eventZforce_open_completions_eventr+Zexpand_word_eventr/Zformat_paragraph_eventr3Zflash_paren_eventZparen_closed_eventZcheck_module_eventZrun_module_eventZrun_custom_eventr2Z do_rstripr,ÚctipZtry_open_calltip_eventZrefresh_calltip_eventZforce_open_calltip_eventr5Zzoom_height_eventÚallow_code_contextr-Ztoggle_code_context_eventÚupdate_menu_stateÚallow_line_numbersr.Útoggle_line_numbers_event)ÚselfreÚfilenameÚkeyrfr6ZdochomeZpyverZbasepathZchmfilerirpr<r?Z text_optionsrBrÚindentsZ usespacesr¥r¦r«Ú is_py_srcr:rWZ autocompleteZ parenmatchZ scriptbindingrÁrrrÚ__init__Hs¢                                                     zEditorWindow.__init__cCs | ¡dS)N)r)rÆrGrrrrx`szEditorWindow.handle_winconfigcCs^|j}tt|jj| d¡| d¡gƒƒ}| ¡d|}t|| d¡d d¡}|||_ dS)NZborderrEr9rQ)rQÚ0) rBÚsumÚmapÚtkZgetintZcgetZ winfo_widthrÚmeasurer?)rÆrBZ inner_paddingZ pixel_widthZzero_char_widthrrrrcs zEditorWindow.set_widthcCs|j ¡\}}|j |¡dS)NrF)r«ZdefaultfilenamereÚnew)rÆrGÚdirnameÚbasenamerrrr”ps zEditorWindow.new_callbackcCsÄ|jd@dkr|jdkrdS|j d¡rd|j ddd¡rd|j ddd¡rdt|j d¡ d¡d ƒ}n:|j dd¡}x*tt |ƒƒD]}||d kr€Pq€Wt |ƒ}t|j d ¡ d¡d ƒ}||krÄd}d t |ƒd }|jd @dkrô|j  ddd¡n²|j d¡s|j  dd ¡n@|j |j d¡d|j d ¡¡rD|j  dd¡n|j  dd¡|j |¡}|j d¡}|j |d|¡r†||}}|j  ddd¡|j  d||¡|j  d |¡|j d ¡dS)NérZHomeZiomarkz<=zinsert lineendzinsert linestartÚ.rJ)ú ú Úinsertzinsert linestart+ÚcÚselz1.0rWz sel.firstZ my_anchorúrF)ÚstateZkeysymrBr¹Úcomparer@Úsplitr¸ÚrangeÚlenÚstrÚ tag_removeÚmark_setÚtag_addÚsee)rÆrGZinsertptÚlineZlineatÚdestÚfirstÚlastrrrr’us@      zEditorWindow.home_callbackcCs°| |j¡|_t|jdddd}tjdkr<|jjddtd|jjdd td|jjd d td|jjt t d |jt t d |j   d |j ¡|j  d dd¡|j  |j ¡dS)NrJZgrey75)rDZ borderwidthZ backgroundrZ _padding1z )rKrPzCol: ?rçzLn: ?)rKrLz<>z z)r)riÚ status_barrorr`Ú set_labelZRIGHTr™ZBOTTOMÚXrBruÚset_line_and_columnrÀZ after_idle)rÆÚseprrrr˜ s zEditorWindow.set_status_barcCs>|j t¡ d¡\}}|j dd|¡|j dd|¡dS)NrÕrPzCol: %srçzLn: %s)rBr¹ZINSERTrßrërì)rÆrGrçrPrrrrî°sz EditorWindow.set_line_and_column)ÚfileZ_File)ÚeditZ_Edit)ÚformatZF_ormat)ÚrunZ_Run)rYZ_Options)rZ_Window)rZ_HelpcCsÒ|j}i|_}xD|jD]:\}}t|ƒ\}}t||dd||<}|j|||dqWt ¡r‚t|ddd|d<}|jd|d| ¡t|jdd|_ |jd j d d d|j d |jd   t ¡|_ | ¡dS)Nr)r=Útearoff)Úlabelr:Ú underlineZappleZ applicationZIDLE)rõr:)rôrðr7z Recent Files)rõrör:r)rhr·Ú menu_specsÚprepstrrgZ add_cascader Z isCarbonTkÚ fill_menusÚrecent_files_menuZinsert_cascader¹ÚENDÚbase_helpmenu_lengthÚreset_help_menu_entries)rÆZmbarr·r=rõrör:rrrrrÀs"   zEditorWindow.createmenubarcCsJ|jd}| d¡}|dkr d}||jkr<| |jd|¡t |¡dS)NrrWrXrJ)r·r¹r»ÚdeleterZadd_windows_to_menu)rÆr:rWrrrr¼Ôs   zEditorWindow.postwindowsmenucCs|j|}|j||ddS)z$Update label for menu item at index.)rõN)r·Ú entryconfig)rÆr:r¹rõÚmenuitemrrrÚupdate_menu_labelÞs zEditorWindow.update_menu_labelcCs|j|}|j||ddS)z$Update state for menu item at index.)rÝN)r·rÿ)rÆr:r¹rÝrrrrrÃãs zEditorWindow.update_menu_statecGsR|dkr>NcCsjt|jdd}xP|jD]F}|d|d}}|dk rT|j|fdd„}|j||dq| ¡qW||_dS)Nr)rôrJcSs| |¡dS)N)Úevent_generate)rBrrrrrN"sz(EditorWindow.make_rmenu..command)rõrN)rgrBrÚ add_commandrºr )rÆr rrõrrNrrrrs  zEditorWindow.make_rmenucCs| ¡S)N)Úrmenu_check_copy)rÆrrrÚrmenu_check_cut)szEditorWindow.rmenu_check_cutcCs6y|j d¡}Wntk r$dSX|r.dSdSdS)Nz sel.firstrZÚnormal)rBr¹r )rÆZindxrrrr,s zEditorWindow.rmenu_check_copycCs6y|jj d|jd¡Wntk r,dSXdSdS)Nztk::GetSelectionZ CLIPBOARDrZr)rBrÏÚcallr )rÆrrrÚrmenu_check_paste4s zEditorWindow.rmenu_check_pastecCst |j¡dS)zHandle Help 'About IDLE' event.rF)r Z AboutDialogri)rÆrGrrrr<s zEditorWindow.about_dialogcCst |jd¡dS)z&Handle Options 'Configure IDLE' event.ZSettingsrF)rZ ConfigDialogri)rÆrGrrrr€BszEditorWindow.config_dialogcCs"|jr|j}n|j}t |¡dS)zHandle Help 'IDLE Help' event.rF)rfrirZ show_idlehelp)rÆrGÚparentrrrr}Hs  zEditorWindow.help_dialogc Csntjdd…dkr^yt |j¡Wqjtk rZ}ztjdt|ƒ|j dWdd}~XYqjXn t   |j¡dS)Nr7r8zDocument Start Failure)ÚtitleÚmessagerrF) rr`r\Ú startfiler[ÚOSErrorr½r¿rârBÚ webbrowserÚopen)rÆrGÚwhyrrrr~Rs$ zEditorWindow.python_docscCs|j d¡dS)Nz<>rF)rBr)rÆrGrrrry]s zEditorWindow.cutcCs |j d¡sdS|j d¡dS)NrÚz<>rF)rBZ tag_rangesr)rÆrGrrrrzas  zEditorWindow.copycCs|j d¡|j d¡dS)Nz <>rØrF)rBrræ)rÆrGrrrr{hs  zEditorWindow.pastecCs.|j ddd¡|j dd¡|j d¡dS)NrÚz1.0zend-1crØrF)rBråräræ)rÆrGrrrr‚ms zEditorWindow.select_allcCs |j ddd¡|j d¡dS)NrÚz1.0rWrØrF)rBrãræ)rÆrGrrrrƒss zEditorWindow.remove_selectioncs*|jj‰|jj‰d‰‡‡‡‡fdd„}|S)zèCursor 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. )z sel.first+1cz sel.last-1ccsB|jd@dkr>yˆdƒˆdˆˆƒWntk r<YnXdS)NrCrz sel.firstrØ)rÝr )rG)Ú edge_indexÚ edges_tableÚself_text_indexÚself_text_mark_setrrÚ move_at_edgeƒs z.move_at_edge)rBr¹rä)rÆr#r'r)r#r$r%r&rrxs z&EditorWindow.move_at_edge_if_selectioncCs|j d¡dS)Nz rF)rBr)rÆrGrrrrŒs zEditorWindow.del_word_leftcCs|j d¡dS)NzrF)rBr)rÆrGrrrr‘s zEditorWindow.del_word_rightcCst |j¡dS)NrF)rÚfindrB)rÆrGrrrr„”s zEditorWindow.find_eventcCst |j¡dS)NrF)rZ find_againrB)rÆrGrrrr…˜s zEditorWindow.find_again_eventcCst |j¡dS)NrF)rZfind_selectionrB)rÆrGrrrr‡œs z!EditorWindow.find_selection_eventcCst |j|j|j¡dS)NrF)rrBr«re)rÆrGrrrr† sz EditorWindow.find_in_files_eventcCst |j¡dS)NrF)rrB)rÆrGrrrrˆ¤s zEditorWindow.replace_eventcCsT|j}t |dd¡j}|dk rP| ddd¡| d|›d¡| d¡| ¡dS) Nz Go To Linez/Enter a positive integer ('big' = end of file):rÚz1.0rWrØz.0rF)rBr ZGotoÚresultrãrärærî)rÆrGrBÚlinenorrrr‰¨s zEditorWindow.goto_line_eventcCspy|j dd¡ ¡}Wntk r.d}YnXt |jdd|¡j}|dk rl|jr`|j |¡n |j   |¡|S)z¯Get 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. z sel.firstzsel.lastr;z Open ModulezAEnter the name of a Python module to search on sys.path and open:N) rBr¸Ústripr r Z ModuleNamer)rer!r«r²)rÆr=Ú file_pathrrrÚ open_module¶s  zEditorWindow.open_modulecCs | ¡dS)NrF)r-)rÆrGrrrrÎszEditorWindow.open_module_eventcCsJ|jj}|jjdkr|s,| ¡}|dkr,dSddlm}| |j|¡dS)NZPyShellEditorWindowrFr)Úbrowser) r«rÇÚ __class__Ú__name__r-Úidlelibr.Z ModuleBrowserrf)rÆrGrÇr.rrrr•Òs  z EditorWindow.open_module_browsercCsddlm}| |j¡dS)Nr)Ú pathbrowserrF)r1r2Z PathBrowserrf)rÆrGr2rrrr–Ýs  zEditorWindow.open_path_browsercCs&ddl}tjddg}|j|dddS)Nrz-cz,from turtledemo.__main__ import main; main()F)ÚshellrF)Ú subprocessrÚ executableÚPopen)rÆrGr4Úcmdrrrr—âs zEditorWindow.open_turtle_democCsN|dk rJ|dkrJ|j dd|¡|j ddd¡|j ddd¡| ¡dS)NrrØz%d.0rÚz1.0rWz insert +1l)rBrärãråÚcenter)rÆr*rrrÚgotolineës zEditorWindow.gotolinecCs`|rtj |¡rdStj tj |¡¡\}}tj |¡dkr@dS|j dd¡}| d¡o^d|kS)NT)z.pyz.pywz1.0z 1.0 lineendz#!Úpython) r\r]rbÚsplitextrÓÚnormcaserBr¸Ú startswith)rÆrÇÚbaseZextrçrrrr³òszEditorWindow.ispythonsourcecCs|jr|j |¡d|_dS)N)reZunregister_maybe_terminate)rÆrrrÚ close_hookûs zEditorWindow.close_hookcCs ||_dS)N)r?)rÆr?rrrÚset_close_hookszEditorWindow.set_close_hookcCs2|jr|j |¡| ¡|j |¡| ¡dS)N)reZfilename_changed_editrªriZupdate_windowlist_registryr´)rÆrrrr¬s   z!EditorWindow.filename_change_hookcCsV|jr dS| |jj¡r"| ¡|_|jrR|j |j¡|j |j¡|j |j¡dS)N) r®r³r«rÇr#r¥Ú removefilterr¦r§)rÆrrrÚ _addcolorizer s zEditorWindow._addcolorizercCs,|js dS|j ¡|j |j¡d|_dS)N)r®Z removecolorsr¥rA)rÆrrrÚ _rmcolorizers  zEditorWindow._rmcolorizercCsH| ¡| ¡t |j¡|jdk r0|j ¡|jdk rD|j ¡dS)zUpdate the color themeN) rCrBr!r$rBr¯Zupdate_highlight_colorsr°Z update_colors)rÆrrrr´s    zEditorWindow.ResetColorizerÚ_cCsp| d|¡| |¡}|r6||jkr6| d|d|¡d| |¡krR| d|¡n| d|d¡| |¡dS)NZERRORz wordstartÚ rØz+1c)rår¸Ú IDENTCHARSräræ)rÆrBÚposÚcharrrrÚcolorize_syntax_error+s  z"EditorWindow.colorize_syntax_errorcCs2tjddddd}|s"d|jd<n tj|jd<dS) z&Update the cursor blink configuration.r>r!z cursor-blinkrS)rArrUN)rrqrBrT)rÆZ cursorblinkrrrr£6s  z EditorWindow.update_cursor_blinkcCsN|jdk r|j ¡|jdk r(|j ¡t |jdd¡}||jd<| ¡dS)z.Update the text widgets' font if it is changedNr>r!rQ)r¯Z update_fontr°rrœrfrBr)rÆZnew_fontrrrÚ ResetFont@s     zEditorWindow.ResetFontcCs„t ¡|j_}x&| ¡D]\}}|jj|f|žŽqWxF| ¡D]:}t |¡}|rBx&| ¡D]\}}|jj|f|žŽq^WqBWdS)z/Remove the keybindings before they are changed.N) rÚGetCurrentKeySetr(Údefault_keydefsÚitemsrBZ event_deleteÚget_standard_extension_namesÚGetExtensionBindings)rÆÚkeydefsrGÚkeylistÚ extensionNameÚxkeydefsrrrÚRemoveKeybindingsQs zEditorWindow.RemoveKeybindingsc CsVt ¡|j_}| ¡x(| ¡D]}t |¡}|r"| |¡q"Wi}xR|jjD]F}i||d<x4|dD](}|rj|d||dt|dƒd<qjWqPWx¶|j D]¬}|j |}|  t ¡}|dkrÄq¢|d7}x€t d|ƒD]r} |  | ¡dkrØ| | d¡} | rØ| | d¡} d} ||kr.| ||kr.||| } | rØt|| ƒ} |j| | dqØWq¢WdS) z-Update the keybindings after they are changedrrJNrNÚ acceleratorrõr;)rU)rrKr(rLrsrNrOÚmenudefsrør·r¹rûràrAZ entrycgetÚget_acceleratorrÿ) rÆrPrRrSZ menuEventDictr:rZ menubarItemrWr¹ZaccelZitemNamerGrrrÚApplyKeybindings]s<  (        zEditorWindow.ApplyKeybindingscCs|jstjddddd|_dS)zCUpdate the indentwidth if changed and not using tabs in this windowr>rRz num-spacesr@)rAN)ržrrqr )rÆrrrr¡s z#EditorWindow.set_notabs_indentwidthcCs€t ¡}|jd}| t¡}||jkr8| |jd|¡|rr| ¡x,|D]$}| |d¡}|j |d|dqJW||jd<dS)z3Update the additional help entries on the Help menurrJr)rõrNN) rZGetAllExtraHelpSourcesListr·r¹rûrürþrºÚ"_EditorWindow__extra_help_callbackr)rÆZ help_listZhelpmenuZhelpmenu_lengthÚentryr7rrrrýˆs    z$EditorWindow.reset_help_menu_entriescs|f‡fdd„ }|S)zCCreate a callback with the helpfile value frozen at definition timec s€| d¡stj |¡}tjdd…dkrryt |¡Wq|tk rn}ztj dt |ƒˆj dWdd}~XYq|Xn t   |¡dS)N)ZwwwZhttpr7r8zDocument Start Failure)rrr)r=r\r]rdrr`rrr½r¿rârBr r!)Úhelpfiler")rÆrrÚdisplay_extra_help›s  $z>EditorWindow.__extra_help_callback..display_extra_helpr)rÆr[r\r)rÆrZ__extra_help_callback™s z"EditorWindow.__extra_help_callbackc sÆg}|j}|r>tj |¡r>t|dddd}| ¡}WdQRX|rptj |¡d}||krd| |¡| d|¡g‰x2|D]*}d|ksštj |dd …¡szˆ  |¡qzW‡fd d „|Dƒ}d }|dt |ƒ…}|rVy*t|d ddd}|  |¡WdQRXWnVt k rT}z6t |jddƒsDd|j_tjdd|›d|jdWdd}~XYnXxj|jjD]^} | j} |  dt¡xDt|ƒD]8\} } |  ¡} |  | ¡} | j|| d| | ddq€Wq`WdS)z/Load and update the recent files list and menusÚrÚutf_8r)r'ÚerrorsNrErúrXcsg|]}|ˆkr|‘qSrr)Ú.0r])Ú bad_pathsrrú »sz9EditorWindow.update_recent_files_list..Z1234567890ABCDEFGHIJKÚwÚrecentfiles_messageFTz IDLE Warningz)Cannot save Recent Files list to disk. z Select OK to continue.)rrrrÖ)rõrNrö)rmr\r]r±r!Ú readlinesÚabspathÚremoverØÚappendráÚ writelinesrrrfrer½Ú showwarningrBrirlrúrþrûÚ enumerateÚrstripÚ#_EditorWindow__recent_file_callbackr)rÆÚnew_fileZrf_listr,Z rf_list_filer]ZulcharsZrf_fileÚerrÚinstancer:ÚiÚ file_nameÚcallbackr)rbrrµ¨sL        z%EditorWindow.update_recent_files_listcs|f‡fdd„ }|S)Ncsˆjj|ddS)N)ZeditFile)r«r!)Z fn_closure)rÆrrÚopen_recent_file×sz=EditorWindow.__recent_file_callback..open_recent_filer)rÆrsrur)rÆrZ__recent_file_callbackÖsz#EditorWindow.__recent_file_callbackcCs‚| ¡}| ¡}|r*|r*|d|t}n|r4|}n|r>|}nd}|pL|pL|}| ¡sfd|}d|}|j |¡|j |¡dS)Nz - Úuntitledz*%s*z*%s)Ú short_titleÚ long_titleÚ _py_versionÚ get_savedriZwm_titleZ wm_iconname)rÆZshortZlongrZiconrrrrªÛs  zEditorWindow.saved_change_hookcCs |j ¡S)N)r¦rz)rÆrrrrzíszEditorWindow.get_savedcCs|j |¡dS)N)r¦Ú set_saved)rÆÚflagrrrr{ðszEditorWindow.set_savedcCs|j ¡dS)N)r¦Ú reset_undo)rÆrrrr}ószEditorWindow.reset_undocCs|jj}|rtj |¡SdS)Nrv)r«rÇr\r]rÓ)rÆrÇrrrrwöszEditorWindow.short_titlecCs |jjp dS)Nr;)r«rÇ)rÆrrrrxúszEditorWindow.long_titlecCs | ¡dS)NrF)r8)rÆrGrrrr|ýsz EditorWindow.center_insert_eventrØcCsH|j}| ¡\}}| |¡}||}td||dƒ}| t|ƒ¡dS)NrJr9)rBÚgetwindowlinesrÚmaxrr)rÆÚmarkrBriÚbotr*rDZnewtoprrrr8s   zEditorWindow.centercCsN|j}| d¡}| d¡}||krF| ¡dkrFt|dƒ}||d}||fS)Nz@0,0z@0,65535rJrD)rBrZ winfo_heightr@)rÆrBrirrDrrrr~ s    zEditorWindow.getwindowlinescCs|j}tt| |¡ƒƒS)N)rBr@rr¹)rÆr€rBrrrrszEditorWindow.getlinenocCs(|j ¡}t d|¡}ttt| ¡ƒƒS)zReturn (width, height, x, y)z(\d+)x(\d+)\+(-?\d+)\+(-?\d+))riZ wm_geometryÚreÚmatchÚlistrÎr@Úgroups)rÆZgeomÚmrrrÚ get_geometrys  zEditorWindow.get_geometrycCs | ¡dS)NrF)rt)rÆrGrrrrvszEditorWindow.close_eventcCsH|jrD| ¡s:|j ¡dkr&|j ¡|j ¡|j ¡|j ¡SdS)Nr)r«rzrirÝZ deiconifyÚlowerZliftÚ maybesave)rÆrrrr‰!s   zEditorWindow.maybesavecCs:y | ¡}t|ƒdkr| ¡|Stk r4YnXdS)NZcancel)r‰râÚ_closeÚAttributeError)rÆZreplyrrrrt*s zEditorWindow.closecCs|jjr|j|jjdt |j¡| ¡|j ¡d|_d|_|j rX|j  ¡d|_ d|_ d|_ |j  ¡d|_ |j  ¡|jrŒ| ¡dS)N)ro)r«rÇrµrZunregister_callbackr¼Úunload_extensionsrtr¦r®rBrkr¥riZdestroyr?)rÆrrrrŠ3s"     zEditorWindow._closecCsi|_| ¡dS)N)Ú extensionsÚload_standard_extensions)rÆrrrr¶GszEditorWindow.load_extensionscCs4x(t|j ¡ƒD]}t|dƒr| ¡qWi|_dS)Nrt)r„rÚvaluesr¢rt)rÆÚinsrrrrŒKs  zEditorWindow.unload_extensionscCsHxB| ¡D]6}y| |¡Wq tdt|ƒƒt ¡Yq Xq WdS)NzFailed to load extension)rNÚload_extensionÚprintÚreprÚ tracebackÚ print_exc)rÆr=rrrrŽQs z%EditorWindow.load_standard_extensionscCs tjddS)NT)Z editor_only)rZ GetExtensions)rÆrrrrNYsz)EditorWindow.get_standard_extension_namesZZzDummyZzzdummyc CsF|j ||¡}y>ytjd|td}Wn"ttfk rHt |¡}YnXWn tk rltd|ƒ‚YnXt||ƒ}t   |¡}t |dƒrš|  |j |¡||ƒ}||j|<|rB| |¡x„|D]|}| dd¡}x |dd…dkrò|dd…}qÔWx"|d d…d kr|dd …}qöW|d }t ||ƒrÂ|j |t||ƒ¡qÂWdS) NrÕ)Úpackagez Failed to import extension: rVú-rDrJrÛrXrÜZ_event)Úextfilesr¸Ú importlibÚ import_moduleÚ __package__Ú ImportErrorÚ TypeErrorr’rrrOr¢rùrVrrsrrBru) rÆr=ZfnameÚmodÚclsrPrZveventZ methodnamerrrr‘`s4         zEditorWindow.load_extensioncCsJ|dkr|jj}|j}||_x(| ¡D]\}}|r&|j|f|žŽq&WdS)N)r(rLrBrPrMrÀ)rÆrPrBrGrQrrrrs|szEditorWindow.apply_bindingsc Csò|dkr|jj}|dkr |jj}|j}|j}xÀ|D]¸\}}| |¡}|sJq2xž|D]–}|sb| ¡qP|\} } | dd…dk} | rŠ| dd…} t| ƒ\} } t|| ƒ} || fdd„}| rÔ|  | t ¡}|j | | || |dqP|j | | || dqPWq2WdS)zAdd appropriate entries to the menus and submenus Menus that are absent or None in self.menudict are ignored. NrJú!cSs| |¡dS)N)r)rBrrrrrNžsz(EditorWindow.fill_menus..command)rõrörNrUZvariable)rõrörNrU) r(rVrLr·rBr¸rºrørWÚ get_var_objZ BooleanVarZadd_checkbuttonr)rÆrVrPr·rBZmnameZ entrylistr:rZrõrZ checkbuttonrörUrNÚvarrrrrù…s8        zEditorWindow.fill_menuscCs&| |¡}|r| ¡}|St|ƒ‚dS)N)r¡r¸Ú NameError)rÆr=r¢ÚvaluerrrÚgetvarªs  zEditorWindow.getvarcCs(| ||¡}|r| |¡nt|ƒ‚dS)N)r¡r›r£)rÆr=r¤Úvartyper¢rrrÚsetvar²s  zEditorWindow.setvarcCs,|j |¡}|s(|r(||jƒ|j|<}|S)N)rkr¸rB)rÆr=r¦r¢rrrr¡¹s zEditorWindow.get_var_objcCs,|jr$|j d|¡p"d|j |¡kSdSdS)NZTODOÚSTRINGrJ)r®rBÚ tag_prevrangeZ tag_names)rÆZ text_indexrrrÚis_char_in_stringÉszEditorWindow.is_char_in_stringcCs:y |j d¡}|j d¡}||fStk r4dSXdS)Nz sel.firstzsel.last)NN)rBr¹r )rÆrérêrrrÚget_selection_indicesÕs   z"EditorWindow.get_selection_indicescCs|jdp t}t|ƒS)NÚtabs)rBÚTK_TABWIDTH_DEFAULTr@)rÆZcurrentrrrÚget_tk_tabwidthàszEditorWindow.get_tk_tabwidthc CsB|j}| ¡|kr>|j dd|dd|jd|¡}|j|ddS)NrQrÐz -displayofÚn)r¬)rBr®rÏrZmasterZ configure)rÆZ newtabwidthrBZpixelsrrrÚset_tk_tabwidthæs   zEditorWindow.set_tk_tabwidthcCsP|r@|r@| ¡}d|kr$dkr.nn||_|j|jkr@d|_| |j¡dS)Nr9rF)Ú guess_indentr rŸržr°)rÆrÊZguessrrrrrr­ñs z#EditorWindow.set_indentation_paramsc CsB|j}| ¡\}}|r6|r6| ||¡| d|¡dS| dd¡}|dkrp| ddd¡rd| d¡n| ¡dS|dd krŠ| d¡dS|j}t|  |¡ƒ}|d |j |j }d } xH||j krÄP|dd…}| d } t|  |¡ƒ}||ksú|dd kr¸Pq¸W|  ¡| d | d¡||kr6|  dd ||¡| ¡dS)NrØrFzinsert linestartr;rÜz1.0z insert-1crXz rJrz insert-%dcrÖ)rBr«rþrär¸rÞZbellrŸráÚ expandtabsr rnr¨rØr©) rÆrGrBrérêÚcharsrŸZhaveZwantZ ncharsdeletedrrrrŠúsB          z"EditorWindow.smart_backspace_eventc Csì|j}| ¡\}}| ¡zÂ|rX|rXt|ƒt|ƒkr@|j |¡S| ||¡| d|¡| dd¡}t ||j ƒ\}}|t |ƒkr’|  ||j ¡n>|jržd}n&t | |j ¡ƒ}|j } d| || }| d|¡| d¡dS| ¡XdS)NrØzinsert linestartr×rÖrF)rBr«r¨Ú index2linerrŽrþrär¸Úget_line_indentrŸráÚ reindent_tor ržr²rØrær©) rÆrGrBrérêÚprefixÚrawZ effectiveZpadr¯rrrrŒ&s,        zEditorWindow.smart_indent_eventc Csê|j}| ¡\}}| ¡z´|r>|r>| ||¡| d|¡| dd¡}dt|ƒ}}x ||krx||dkrx|d7}qZW||kr’| dd¡dS|d|…}d}x2|rÔ|d dkrÔ||jkrÔ|dd …}|d7}q¤W|rê| d |d¡x| d¡dkr| d¡qìW| dd¡t |  d¡ƒ} t   |j |j¡} |js¶xf|jD]\} t| | dƒ} t| ƒd } | | d¡}|  |¡|  | | ¡¡}|dk sœ| dkrDPqDW|  |p°d¡n@| d d¡}|rÒ|d} nd } | | d¡}|  |¡|  d¡|  ¡}|t jkrŠ|t jkrnn|t jkr2| d|¡nT|t jkrN| |  ¡¡n8|t jkr†|  ¡dkrv| d|¡n| |   ¡¡ndS|  !¡}| d|¡|  "¡r´| #|¡n|rÎ|  $¡rÎ| %|¡dS| &d¡| '¡XdS)a…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. rØzinsert linestartrz rJrErFNrXzinsert - %d charsz.0Zconsolez1.0)(rBr«r¨rþrär¸rárØrnr´r¹r ZParserr rŸr¤rr“Zset_codeZfind_good_parse_startÚ_build_char_in_string_funcZset_lor©Zget_continuation_typeZC_NONEZC_STRING_FIRST_LINEZC_STRING_NEXT_LINESZ C_BRACKETr¶Zcompute_bracket_indentZ C_BACKSLASHZget_num_lines_in_stmtZcompute_backslash_indentZget_base_indent_stringZis_block_openerrŒZis_block_closerrŠrær©)rÆrGrBrérêrçrrr¯ÚindentZlnor ÚcontextZstartatZ startatindexZrawtextZbodr]rÙrrrr‹Is„                               z%EditorWindow.newline_and_indent_eventcCs||jfdd„}|S)NcSs||d|ƒS)Nz+%dcr)ÚoffsetZ _startindexZ_icisrrrÚinnerÀsz6EditorWindow._build_char_in_string_func..inner)rª)rÆZ startindexr½rrrr¹¿sz'EditorWindow._build_char_in_string_funccCs2|jr&t||jƒ\}}d|d|Sd|SdS)Nr×rÖ)ržÚdivmodrŸ)rÆr¯ZntabsZnspacesrrrÚ _make_blanksÏszEditorWindow._make_blankscCsJ|j}| ¡| ddd¡r(| dd¡|r>| d| |¡¡| ¡dS)Nzinsert linestartz!=rØ)rBr¨rÞrþrØr¿r©)rÆrPrBrrrr¶Ùs zEditorWindow.reindent_tocCsPt|j|jƒ ¡\}}|r@|r@t||jƒ\}}t||jƒ\}}nd}}||S)Nr)ÚIndentSearcherrBrŸrórµ)rÆÚopenerZindentedr¸Z indentsmallZ indentlargerrrr±çs zEditorWindow.guess_indentcCsN|jdkrdS|jjr&|j ¡d}n|j ¡d}|jdd|›dddS)NZShowZHiderYz *Line Numbersz Line Numbers)r:r¹rõ)r°Zis_shownZ hide_sidebarZ show_sidebarr)rÆrGZ menu_labelrrrrÅðs   z&EditorWindow.toggle_line_numbers_event)NNNN)N)N)N)N)N)N)N)N)N)N)N)N)rØ)rØ)N)NN)N)N)T)N)”r0Ú __module__Ú __qualname__Zidlelib.percolatorr"Zidlelib.colorizerr#r$Z idlelib.undor%Zidlelib.iomenur&r'r1r(Zidlelib.statusbarr)Zidlelib.autocompleter*Zidlelib.autoexpandr+Zidlelib.calltipr,Zidlelib.codecontextr-Zidlelib.sidebarr.Zidlelib.formatr/r0r1r2Zidlelib.parenmatchr3Zidlelib.squeezerr4Zidlelib.zoomheightr5rÚgetfilesystemencodingZfilesystemencodingr[rÂrÄrËrxrr”r’r˜rîr÷rrr¼rrÃršr rwrrrrrrr€r}r~ryrzr{r‚rƒrrr‘r„r…r‡r†rˆr‰r-rr•r–r—r9r³r?r@r¬rBrCr´ÚstringZ ascii_lettersZdigitsrFrIr£rJrTrXr¡rýrYrµrnrªrzr{r}rwrxr|r8r~rr‡rvr‰rtrŠr¶rŒrŽrNr˜r‘rsrùr¥r§r¡rªr«r®r°r­rŠrŒr‹r¹r¿r¶r±rÅrrrrr!1s               +   %              $ .     %     ,#v  r!cCs tt|ƒƒS)N)r@r)r¹rrrr´þsr´z[ \t]*cCs$t |¡}| ¡t| ¡ |¡ƒfS)zÌReturn 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ƒrWráÚgroupr²)rçrŸr†rrrrµs rµc@s8eZdZdd„Zdd„Zejejdfdd„Zdd „Z d S) rÀcCs(||_||_d|_|_d|_|_dS)Nr)rBrŸrrÚfinishedÚ blkopenlineÚ indentedline)rÆrBrŸrrrrËs zIndentSearcher.__init__cCsL|jr dS|jd}|_t|ƒd}|j |dd¡r:dS|j ||d¡S)Nr;rJz.0z>=rWz lineend+1c)rÈrrr“rBrÞr¸)rÆrrr€rrrÚreadlines zIndentSearcher.readline)ÚclassÚdefÚforÚifÚtryÚwhilec Cs>|jrn2||kr ||kr ||_n||kr:|jr:||_d|_dS)NrJ)rÈrÉrÊ) rÆrAÚtokenÚstartrWrçÚINDENTÚNAMEZOPENERSrrrÚ tokeneater#szIndentSearcher.tokeneaterc Csltj}|jt_zHy(t |j¡}x|D]}|j|Žq$WWntjtfk rRYnXWd|t_X|j|j fS)N) ÚtokenizeÚtabsizerŸÚgenerate_tokensrËrÖÚ TokenErrorÚ SyntaxErrorrÉrÊ)rÆZ save_tabsizeÚtokensrÒrrrró/s   zIndentSearcher.runN) r0rÂrÃrËrËr×rÔrÕrÖrórrrrrÀ s   rÀcCs6| d¡}|dkr.|d|…||dd…}||fS)NrDrrJ)r()ÚsrrrrrrøAs røú[ú]ú/)Z bracketleftZ bracketrightZslashcCs´| |¡}|rt ¡r"|dkr"dS|d}t ddd„|¡}t ddd„|¡}t d d|¡}t d d |¡}t d d |¡}t dd|¡}t dd|¡}t dd|¡}t dd|¡}|S)N>ú<>ú <>ú<>r;rz-[a-z]\bcSs | ¡ ¡S)N)rÇÚupper)r†rrrrHZrIz!get_accelerator..z\b\w+\bcSst | ¡| ¡¡S)N)Úkeynamesr¸rÇ)r†rrrrH[rIzKey-ZCancelz Ctrl-BreakzControl-zCtrl-r—ú+z>zidlelib.idle_test.test_editorr9F)Ú verbosityÚexit)ró)=Z importlib.abcr™Úimportlib.utilr\r`r‚rÅrr×r”r ZtkinterZ tkinter.fontrZ tkinter.ttkrZtkinter.simpledialogZ simpledialogr¾Ztkinter.messageboxZ messageboxr½Zidlelib.configrr1rrrr r Zidlelib.multicallr r r rrZ idlelib.treerrr­Zpython_versionryrr Úobjectr!r´ÚcompilerÆrµrÀrørårWrèrìr0Zunittestr>Zidlelib.idle_test.htestrórrrrÚsv                    X  4