403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.66
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python313/Lib/idlelib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python313/Lib/idlelib/__pycache__/editor.cpython-313.pyc
�

��i�
��&�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSK7 SSKJ
r
 SSKJr SSKJr SSKJr SSKJr SSKJr SS	KJr SS
KJr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJr SSK J!r! SSK"J#r# SSKJ$r$ SSK%J&r& Sr'\RS:Hr("SS5r)Sr*\RV"S5r,Sr-"SS5r.Sr/S S!S"S#.r0S$r1S%r2S&r3\4S':XaSS(K5J6r6 \6"S)S*S+S,9 SS-K7J8r8 \8"\35 gg).�N)�*)�Font)�	Scrollbar)�simpledialog)�
messagebox)�idleConf)�configdialog)�grep)�help)�
help_about)�macosx)�MultiCallCreator)�pyparse)�query)�replace)�search)�wheel_event)�
py_extensions)�window)�_get_dochome��darwinc���\rSrSrSSKJr SSKJrJr SSK	J
r
 SSKJrJ
r
 SSKJr SSKJr SS	KJr SS
KJr SSKJr SSKJr SS
KJr SSKJrJrJrJ r  SSK!J"r" SSK#J$r$ \%RL"5r'Sr(Sr)Sr*Sr+SySjr,SzSjr-Sr.Sr/Sr0Sr1SzSjr2/SQr3Sr4Sr5Sr6Sr7Sr8Sr9S r:S!/r;S"r<S#r=S$r>S%r?SzS&jr@SzS'jrASzS(jrBSzS)jrCS*rDS+rES,rFSzS-jrGSzS.jrHS/rIS0rJS1rKS2rLS3rMS4rNS5rOS6rPS7rQS8rRS9rSSzS:jrTSzS;jrUSzS<jrVS=rWS>rXS?rYS@rZSAr[SBr\SCr]SDr^\_R�\_R�-SE-rbSFrcSGrdSHreSIrfSJrgSKrhSLriSMrjSzSNjrkSOrlSPrmSQrnSRroSSrpSTrqSUrrSVrsS{SWjrtSXruS{SYjrvSZrwS[rxS\ryS]rzS^r{S_r|S`r}Sar~SbrScSd0r�Ser�SzSfjr�S|Sgjr�Shr�SzSijr�SzSjjr�Skr�Slr�Smr�Snr�S}Sojr�Spr�Sqr�Srr�Ssr�Str�Sur�Svr�SzSwjr�Sxr�g)~�EditorWindow�&r)�
Percolator)�ColorDelegator�color_config)�
UndoDelegator)�	IOBinding�encoding)�mainmenu)�MultiStatusBar)�AutoComplete)�
AutoExpand)�Calltip)�CodeContext)�LineNumbers)�FormatParagraph�FormatRegion�Indents�Rstrip)�
ParenMatch)�
ZoomHeightNTc
�x�SSKJn [Rc[	5[lXlU=(d URnX@l[U5Ul[R"X@RS9=UlnU(a-URUl
URURlO0Ul
0URl[ R"=(a. [$R&R)[ R"S5UlSUl[/U5=Uln[3USS9=Uln[ R6"SS	S
SS9n	S
SSSU	S[ R6"SS	SSS9S.n
[9[:5"U40U
D6=UlnUR<URlURA5 URC5 URRESURF5 URRISURJ5 [LRN"5(aUURISURJ5 URISURP5 URISURP5 OURISURP5 URIS[R5 URTS:Xa,URIS[R5 URIS5 URISURV5 URISURX5 URISURZ5 URISUR\5 URIS UR^5 URIS!UR`5 URIS"URb5 URIS#URd5 URIS$URf5 URIS%URh5 URIS&S'5 URIS(URj5 URIS)URl5 URIS*URn5 URIS+URp5 URIS,URr5 URIS-URt5 URIS.URv5 URIS/URx5 URIS0URz5 URIS1UR|5 URIS2UR~5 UR�U5=UlAnURIS3UR�5 URIS4UR�5 URIS5UR�5 URIS6UR�5 URIS7UR�5 URIS8UR�5 UR�U5n
URIS9U
R�5 URIS:U
R�5 URIS;UR�S55 URIS<UR�S=55 URIS>UR�5 URIS?UR�5 URIS@UR�5 U(a�X1RU'U(aXR�U'URISAUR�5 URISBUR
R�5 URISCUR�5 URISDUR�5 URISEUR�5 UR�5 UR�[�[�S=SF9 UR�S=S=SG9 UR�S=S=SG9 UR�USH'UR�S=SI[�SJ9 UR�USK'[ R�"URSS	5USL'UR�S=S=[�SJ9 UR�5 UR�5 [ R6"SSMSNSOS9nU(+UlbSPUlcUR�UldUR�5 [�[ SQ5(dUR<SR[ lgUR�5 SSUliUR�U5=UlknUR�5=UlmnUR�U5 UR�UloUR�UlpUR�UR�5 UR�U5=UltnUR�UR�5 STUlwUR�ST5 SUlySUlzSUl{U(a�[$R&R�U5(ad[$R&R�U5(d@UR�U5(a)SUUlwUR�U5nUR�U5 OUGRU5 SUUlwUGR5 UR�5 UGR5 UGR5 UGRGRSV5nU(a\UGR
SW5nUcSXnUS:�aUGR5 US=-nUUl�[GR"UGR5 G[GRUl�G[GRUl�G[GRUl�UGR!SYSZ5 UGR!S[S\S]S^5 UGR!S_S`5 UGR!SaSb5 UGR!ScSbSdSe5 UGR#XGR$5nURISYUGR&5 URIS[UGR(5 URISfUGR*5 URISgUGR-U5GR.5 URIShUGR1U5GR25 UGR5U5nURISiUGR65 URIScUGR85 U"U5nURISjUGR:5 URISkUGR<5 URISlUGR>5 URISmUGRAU5GRB5 UGREU5=Ul�nURIS_UGRH5 URISaUGRJ5 URISnUGRL5 URISoUGROU5GRP5 UGRR(a?UGRUU5UlzURISpUR�GRV5 OUGRYSqSrSs5 UGRZ(abUGR]U5Ul{[ R6"SS	StSOS9(aUGR_5 URISuUGR^5 gUGRYSqSvSs5 g)wNr)�
ScriptBinding)�menuzrecent-files.lst��vbar)�name�mainr�width�int��type�text��none�
wordprocessor�height)r4�padx�wrap�highlightthicknessr6�tabstyler>�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��g�N�break�)�events �#C:\Python313\\Lib\idlelib\editor.py�<lambda>�'EditorWindow.__init__.<locals>.<lambda>�s��'�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�boolr�blink_off_time�
insertofftime)�2i�i@KLFTr�end���z<<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�disabledzline-numbers-defaultz<<toggle-line-numbers>>�*ine*umbers)��idlelib.runscriptr0r�help_urlr�flist�root�Menu�menubarr�ListedToplevel�top�vars�tkinter_vars�inversedict�
instance_dictr�userdir�os�path�join�recent_files_path�prompt_last_line�Frame�
text_framerr3�	GetOptionr�Textr:�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_eventr*�fregion�indent_region_event�dedent_region_event�comment_region_event�uncomment_region_event�tabify_region_event�untabify_region_eventr+�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�hasattrr`�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�isdir�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_addr$�user_input_insert_tags�autocomplete_event�try_open_completions_event�force_open_completions_eventr%�expand_word_eventr)�format_paragraph_eventr-�flash_paren_event�paren_closed_event�check_module_event�run_module_event�run_custom_eventr,�	do_rstripr&�ctip�try_open_calltip_event�refresh_calltip_event�force_open_calltip_eventr.�zoom_height_event�allow_code_contextr'�toggle_code_context_event�update_menu_state�allow_line_numbersr(�toggle_line_numbers_event)�selfrj�filename�keyrkr0ror{r3r6�text_optionsr:r��indents�	usespacesr�r�r��	is_py_srcr1rc�autocomplete�
parenmatch�
scriptbindingr�s                         rL�__init__�EditorWindow.__init__=s���3�� � �(�$0�N�L�!��
��!�u�z�z���	��D�z����.�.�t�,�,�G�G���3�� %�
�
�D��&+�%6�%6�D�H�H�"� "�D��%'�D�H�H�"�!)�!1�!1�"6�b�g�g�l�l�� � �"4�76���!#���',�S�z�1���*�$�Z�f�=�=��	�D��"�"�6�>�7��O�����&'��+�"�,�,����u�F�	��,�D�1�*�M��M�M��	�D�"&�)�)������������������,�d�j�j�9����
�
�(�$�*:�*:�;��?�?����I�I�(�$�*:�*:�;�
�I�I�*�4�+@�+@�A��I�I�e�T�2�2�3�
�I�I�e�D�1�1�2��	�	�.�+�.�� � �E�)��I�I�l�K�0��I�I�l�K�0��	�	�-��!6�!6�7��	�	�)�T�X�X�&��	�	�*�d�i�i�(��	�	�+�t�z�z�*��	�	�%�t�'?�'?�@��	�	�*�d�.�.�/��	�	�#�T�%5�%5�6��	�	�"�D�$5�$5�6��	�	�*�D�,>�,>�?��	�	�#�T�%;�%;�<��	�	�"�$9�:��	�	�"�D�O�O�4��	�	�(�$�*?�*?�@��	�	�*�d�o�o�.��	�	�"�D�$9�$9�:��	�	�%�t�'?�'?�@��	�	�&��(A�(A�B��	�	�-��!3�!3�4��	�	�/�4�#7�#7�8��	�	�'��(B�(B�C��	�	�*�4�+H�+H�I��	�	�$�T�%<�%<�=�!%�!2�!2�4�!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���I�I�+�T�->�->�?��I�I�-�t�z�z�/L�/L�M��I�I�.��0H�0H�I��I�I�-�t�/E�/E�F��I�I�,�d�.C�.C�D��������T��Q��7�����!��,��"�"�1�Q�"�/��+�+��Y���	�	�a��$�	�/�!%����
���'�'��	�	�6�>�J��V���	�	�a��$�	�/����������&�&�v�x�'3�&�B�	�$�}�����
� �=�=����#�#�%��x�!1�2�2�&*�i�i��&@�H�#�� � �"�"2�������.�.���3��-�-�/�/��	�D������ $� 5� 5���#�3�3����"�"�4�#9�#9�:��~�~�d�+�+���"�
�#�#�D�$=�$=�>�����#�#�E�*���
� ��� �����w�w�~�~�h�'�'����
�
�h�0G�0G��;�;�x�(�(�%)�D�N� $� 3� 3�H� =�I��/�/�	�:������)�!%���������� ��%�%�'������}�}� � ��*����*�*�U�#�C��{����a�x��"�"�$��A�g�� �D�N��$�$�T�%9�%9�:�'�1�1���"�+�+��
�#�-�-���	
���)�;�7����1�3H�+�-E�	G����-�/G�H����,�.G�H����)�+D�2�4M�	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�� 6�D���I�I�/��'�'�A�A�
C�
�"�"�9�m�Z�H��"�"�"� $� 0� 0�� 6�D���!�!�&�.�"8�v�G��.�.�0��I�I�/��1O�1O�P��"�"�9�m�Z�HrOc�$�UR5 g�N)r��r�rKs  rLr��EditorWindow.handle_winconfig;s�����rOc	�:�URn[[URRURS5URS5/55nUR
5SU--
n[XRS5S9RS5nX4-Ul	g)N�borderr?rXr])r]�0)
r:�sum�map�tk�getint�cget�winfo_widthr�measurer6)r�r:�
inner_padding�pixel_width�zero_char_widths     rLr��EditorWindow.set_width>s����y�y���C���������8�1D�15���6�1B�1D�E�F�
��&�&�(�1�}�+<�<��
��I�I�f�-�.�6�6�s�;�	� �3��
rOc�r�URR5up#URRU5 grH)r��defaultfilenamerj�new)r�rK�dirname�basenames    rLr��EditorWindow.new_callbackKs*�� �G�G�3�3�5����
�
���w��rOc�B�URS-S:waURS:XagURRS5(a{URR	SSS5(aYURR	SSS5(a7[URRS5R
S5S	5nOLURRSS5n[[U55H
nX2S
;dM
 O
 [U5n[URRS5R
S5S	5nX$:XaSnS[U5-S
-nURS	-S:XaURRSSS5 GO]URRS5(dURRSS5 O�URR	URRS5SURRS55(aURRSS5 OURRSS5 URRU5nURRS5nURR	USU5(aXvpvURRSSS5 URRSXg5 URRSU5 URRS5 g)N�r�Home�iomark�<=zinsert lineend�insert linestart�.rR)� �	�insertzinsert linestart+�c�sel�1.0rc�	sel.first�	my_anchor�<�sel.last�>rI)�state�keysymr:r��comparer7�splitr��range�len�str�
tag_remove�mark_set�tag_add�see)r�rK�insertpt�line�lineat�dest�first�lasts        rLr��EditorWindow.home_callbackPsV���K�K�!�O��!�e�l�l�f�&<���9�9�?�?�8�$�$��9�9���X�t�-=�>�>��9�9���/��x�@�@��4�9�9�?�?�8�4�:�:�3�?��B�C�H��9�9�=�=�!3�5E�F�D�!�#�d�)�,���>��3��-��T����T�Y�Y�_�_�X�.�4�4�S�9�!�<�=�����H�"�3�x�=�0��4���K�K��M�a���I�I� � ���u�5��9�9�?�?�;�/�/��	�	�"�"�;��9��9�9�$�$�T�Y�Y�_�_�[�%A�3�%)�Y�Y�_�_�X�%>�@�@��I�I�&�&�{�K�@��I�I�&�&�{�J�?��I�I�O�O�D�)�E��9�9�?�?�;�/�D��y�y� � ��s�4�0�0�!�d��I�I� � ���u�5��I�I���e�U�1��	�	���8�T�*��	�	�
�
�h��rOc��URUR5Ul[URSSSS9n[R
S:XaURR
SS[S9 URR
SS	[S9 URR
S
S[S9 URR[[S9 UR[[S9 URRS
UR5 URRS
SS5 URRUR5 g)NrR�grey75)r>�borderwidth�
backgroundr�	_padding1z    )rSrZzCol: ?r>zLn: ?)rSrTz<<set-line-and-column>>z<KeyRelease>z<ButtonRelease>)r#ro�
status_barrz�sys�platform�	set_label�RIGHTr��BOTTOM�Xr:r��set_line_and_columnr��
after_idle)r��seps  rLr��EditorWindow.set_status_bar{s����-�-�d�h�h�7����D�H�H�Q�A�(�K���<�<�8�#�
�O�O�%�%�k�6��%�F����!�!�(�H�5�!�A����!�!�&�'��!�>������&�q��1����f�1��%��	�	���0�$�2J�2J�K��	�	���5�*�,=�	?��	�	���T�5�5�6rOc���URR[5RS5up#URRSSU-5 URRSSU-5 g)Nr&rZzCol: %sr>zLn: %s)r:r��INSERTr5rIrL)r�rKr>rZs    rLrP� EditorWindow.set_line_and_column�sR���y�y���v�.�4�4�S�9������!�!�(�I��,>�?����!�!�&�(�T�/�:rO))�file�_File)�edit�_Edit)�format�F_ormat)�run�_Run)re�_Options)r�_Window)r�_Helpc�T�URn0=UlnURH@up4[U5upT[	XS3S5n[XSUS9=X#'nUR
XGUS9 MB [R"5(a [USSS9=US'nUR
S	US
9 UR5 [URSS9Ul
URSRS
SSURS9 URSR[5UlUR5 g)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_postcommandNr)r4�tearoff�postcommand)�labelr1�	underline�apple)r4rd�application�IDLE)rfr1�rdrW�zRecent Files)rfrgr1r)rmr��
menu_specs�prepstr�getattrrl�add_cascader
�
isCarbonTk�
fill_menus�recent_files_menu�insert_cascader��END�base_helpmenu_length�reset_help_menu_entries)r��mbarr�r4rfrgrer1s        rLr�EditorWindow.createmenubar�s-�� �|�|��#%�%��
���?�?�K�D�&�u�~��I�!�$�&�0A�(B�D�I�K�$(��!�5@�%B�
B�H�N�T����5�y��I�+������-1�$�W�:;�.=�
=�H�]�#�d����6���5�����!%�d�l�l�A�!>����
�
�f��,�,�Q�n�78�26�2H�2H�	-�	J�%)�M�M�&�$9�$?�$?��$D��!��$�$�&rOc���URSnURS5nUcSnX R:�aURURS-U5 [R
"U5 g)zCCallback to register window.

Only called when Window menu exists.
rrcNrdrR)r�r�r��deleter�add_windows_to_menu)r�r1rcs   rLr��EditorWindow.postwindowsmenu�sY��
�}�}�X�&���j�j�����;��C������K�K����q�(�#�.��"�"�4�(rOc�@�URUnURX#S9 g)z$Update label for menu item at index.)rfN�r��entryconfig)r�r1r�rf�menuitems     rL�update_menu_label�EditorWindow.update_menu_label��!���=�=��&�����U��0rOc�@�URUnURX#S9 g)z$Update state for menu item at index.�r2Nr)r�r1r�r2r�s     rLr��EditorWindow.update_menu_state�r�rOc���US:XaC[US5n[URS5U-5URS5-
nSnUS4nURR"U/UQ76 g)zHandle scrollbar.�movetorrc�@0,0�scroll�unitsrI)�float�round�	getlinenor:�yview)r�rK�args�fraction�liness     rLr��EditorWindow.handle_yview�sg���H���T�!�W�~�H��4�>�>�%�0�8�;�<��^�^�F�+�,�E��E��7�#�D��	�	����%��%�rOc�2�URnURSURSUR35nUR	SSU5=(a UR	USS5nU(d%UR
SSS	5 URS
U5 UR(dUR5 URnXl
[RSSS:HnU(aURS
S9 URH-nUup�n
U
cM[!X
5"5nUR#X�S9 M/ UR%UR&UR(5 U(aURRSS9 g![
a SnGNf=f![a M�f=f)N�@�,r-r$r0Fr+r,rcr)rl�win�arrow)�cursorr��ibeamrI)r:r��x�yr4�TclErrorr9r:�rmenu�
make_rmenurKrJrK�config�rmenu_specs�
ValueErrorro�entryconfigure�tk_popup�x_root�y_root)r�rKr:�newdex�in_selectionr��iswin�itemrf�	eventname�verify_stater2s            rLr��EditorWindow.right_menu_event�sj���y�y�����a����y��%�'�'��3�4��	!� �L�L��d�F�C�C��<�<���z�B�
���O�O�E�5�%�0��M�M�(�F�+��z�z��O�O���
�
���
����R�a� �E�)����K�K�w�K�'��$�$�D�
�15�.��,��#���D�/�1�E�� � �� �4�%�	���u�|�|�U�\�\�2���I�I���G��,���7�	!� �L�	!�� �
��
�s#�-E5�F�5F�F�
F�F)�CloserDNc���[URSS9nURHAnUSUSpCUb"URU4SjnURX5S9 M1UR	5 MC Xlg)NrrkrRc�&�URU5 gr	��event_generate�r:r�s  rLrW�(EditorWindow.make_rmenu.<locals>.command$s���'�'�	�2rO�rfrW)rlr:r��add_commandr�r�)r�r�r�rfr�rWs      rLr��EditorWindow.make_rmenusi���T�Y�Y��*���$�$�D�#�A�w��Q��9�� �!%���i�3��!�!��!�?��#�#�%�%��
rOc�"�UR5$r	)�rmenu_check_copy�r�s rL�rmenu_check_cut�EditorWindow.rmenu_check_cut+s���$�$�&�&rOc�p�URRS5nU(aS$S$![a gf=f)Nr-�normalrf�r:r�r�)r��indxs  rLr��EditorWindow.rmenu_check_copy.s<��	4��9�9�?�?�;�/�D� $�8�3��3���	��	�s�(�
5�5c��URRRSURS5 g![a gf=f)Nztk::GetSelection�	CLIPBOARDr�rf)r:r�callr�r�s rL�rmenu_check_paste�EditorWindow.rmenu_check_paste6s?��	��I�I�L�L���0�$�)�)�[�I����	��	�s�14�
A�Ac�D�[R"UR5 g)zHandle Help 'About IDLE' event.rI)r�AboutDialogror
s  rLr��EditorWindow.about_dialog>s��	���t�x�x�(�rOc�F�[R"URS5 g)z&Handle Options 'Configure IDLE' event.�SettingsrI)r	�ConfigDialogror
s  rLr��EditorWindow.config_dialogDs��	�!�!�$�(�(�:�6�rOc��UR(a
URnOURn[R"U5 g)zHandle Help 'IDLE Help' event.rI)rkror�
show_idlehelp)r�rK�parents   rLr��EditorWindow.help_dialogJs.���9�9��Y�Y�F��X�X�F����6�"�rOc�6�[RSSS:Xa"[R"UR5 g[R"UR5 g![
a3n[R"S[U5URS9 SnAgSnAff=f)Nrlr��Document Start Failure��title�messager�rI)rJrKru�	startfileri�OSErrorrr�r8r:�
webbrowser�open)r�rK�whys   rLr��EditorWindow.python_docsTsy���<�<����u�$�
8����T�]�]�+��
�O�O�D�M�M�*����
8��$�$�+C���H�T�Y�Y�8���
8�s� A�
B�%)B�Bc�:�URRS5 g)Nz<<Cut>>rI�r:r�r
s  rLr��EditorWindow.cut_s���	�	� � ��+�rOc�|�URRS5(dgURRS5 g)Nr+z<<Copy>>rI)r:�
tag_rangesr�r
s  rLr��EditorWindow.copycs/���y�y�#�#�E�*�*���	�	� � ��,�rOc�p�URRS5 URRS5 g)Nz	<<Paste>>r)rI)r:r�r<r
s  rLr��EditorWindow.pastejs'���	�	� � ��-��	�	�
�
�h��rOc��URRSSS5 URRSS5 URRS5 g)Nr+r,zend-1cr)rI)r:r;r:r<r
s  rLr��EditorWindow.select_allos?���	�	���%���1��	�	���8�U�+��	�	�
�
�h��rOc�t�URRSSS5 URRS5 g)Nr+r,rcr)rI)r:r9r<r
s  rLr��EditorWindow.remove_selectionus+���	�	���U�E�5�1��	�	�
�
�h��rOc�|^^^^�URRmURRmSmUUUU4SjnU$)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+1czsel.last-1cc�x>�URS-S:XaT"S5 T"STT5 gg![a gf=f)Nr;rr-r))r2r�)rK�
edge_index�edges_table�self_text_index�self_text_mark_sets ����rL�move_at_edge�<EditorWindow.move_at_edge_if_selection.<locals>.move_at_edge�sH������a��A�%��#�K�0�&�x��Z�1H�I�&�� ����s�,�
9�9)r:r�r:)r�r�r�r�r�r�s ` @@@rLr��&EditorWindow.move_at_edge_if_selectionzs9����)�)�/�/��!�Y�Y�/�/��5��	�	��rOc�:�URRS5 g)Nz
<Meta-Delete>rIr�r
s  rLr��EditorWindow.del_word_left�s���	�	� � ��1�rOc�:�URRS5 g)Nz<Meta-d>rIr�r
s  rLr��EditorWindow.del_word_right�s���	�	� � ��,�rOc�D�[R"UR5 grH)r�findr:r
s  rLr��EditorWindow.find_event�s�����D�I�I��rOc�D�[R"UR5 grH)r�
find_againr:r
s  rLr��EditorWindow.find_again_event�s�����$�)�)�$�rOc�D�[R"UR5 grH)r�find_selectionr:r
s  rLr��!EditorWindow.find_selection_event�s�����d�i�i�(�rOc�p�[R"URURUR5 grH)r
r:r�rjr
s  rLr�� EditorWindow.find_in_files_event�s!���	�	�$�)�)�T�W�W�d�j�j�1�rOc�D�[R"UR5 grH)rr:r
s  rLr��EditorWindow.replace_event�s������	�	�"�rOc��URn[R"USS5RnUbIUR	SSS5 URSUS35 UR
S5 UR5 g)	Nz
Go To Linez/Enter a positive integer
('big' = end of file):r+r,rcr)�.0rI)r:r�Goto�resultr9r:r<rP)r�rKr:�linenos    rLr��EditorWindow.goto_line_event�st���y�y������l�)���&�		�
���O�O�E�5�%�0��M�M�(�v�h�b�M�2��H�H�X���$�$�&�rOc�r�URRSS5R5n[R
"URSSU5RnUbIUR(aURRU5 U$URRU5 U$![a SnN�f=f)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.
r-r0r2zOpen ModulezAEnter the name of a Python module
to search on sys.path and open:)r:r��stripr�r�
ModuleNamerrjr�r�r�)r�r4�	file_paths   rL�open_module�EditorWindow.open_module�s���	��9�9�=�=��j�9�?�?�A�D��$�$��	�	�=�2��	��f�		�
� ��z�z��
�
���	�*������ � ��+�����	��D�	�s�*B'�'B6�5B6c�$�UR5 grH)rr
s  rLr��EditorWindow.open_module_event�s������rOc���URRnURRS:XaU(dUR	5nUcgSSKJn URURU5 g)N�PyShellEditorWindowrIr)�browser)	r�r��	__class__�__name__r�idlelibr�
ModuleBrowserrk)r�rKr�rs    rLr�� EditorWindow.open_module_browser�sX���7�7�#�#�����'�'�+@�@���'�'�)�H����#����d�i�i��2�rOc�F�SSKJn URUR5 g)Nr)�pathbrowserrI)rr�PathBrowserrk)r�rKrs   rLr��EditorWindow.open_path_browser�s��'�����	�	�*�rOc�R�SSKn[RSS/nURUSS9 g)Nrz-cz,from turtledemo.__main__ import main; main()F)�shellrI)�
subprocessrJ�
executable�Popen)r�rKr �cmds    rLr��EditorWindow.open_turtle_demo�s1����~�~��=�?��	����E��*�rOc���UbqUS:�ajURRSSU-5 URRSSS5 URRSSS5 UR	5 ggg)Nrr)z%d.0r+r,rcz
insert +1l)r:r:r9r;�center)r�rs  rL�gotoline�EditorWindow.gotoline�sc����&�1�*��I�I���x��&��9��I�I� � ���u�5��I�I���e�X�|�<��K�K�M�	#-�rOc��U(a$[RRU5(ag[RR[RR	U55up#[RRU5[;agURRSS5nURS5=(a SU;$)NTr,z1.0 lineendz#!�python)
rurvr��splitextr�normcaserr:r��
startswith)r�r��base�extr>s     rLr��EditorWindow.ispythonsource�s����2�7�7�=�=��2�2���G�G�$�$�R�W�W�%5�%5�h�%?�@�	��
�7�7���C� �M�1���y�y�}�}�U�M�2�����t�$�9��T�)9�9rOc�l�UR(a#URRU5 SUlggr	)rj�unregister_maybe_terminater�s rL�
close_hook�EditorWindow.close_hook�s'���:�:��J�J�1�1�$�7��D�J�rOc��Xlgr	)r3)r�r3s  rL�set_close_hook�EditorWindow.set_close_hooks��$�rOc���UR(aURRU5 UR5 URR	U5 UR5 gr	)rj�filename_changed_editr�ro�update_windowlist_registryr�r�s rLr��!EditorWindow.filename_change_hooksE���:�:��J�J�,�,�T�2���� ����+�+�D�1����rOc�&�UR(agURURR5(aUR	5UlUR(a/UR
R
URURS9 gg)N)�filter�after)r�r�r�r�rr��insertfilterafterr�r�s rL�
_addcolorizer�EditorWindow._addcolorizersb���:�:�����t�w�w�/�/�0�0��,�,�.�D�J��:�:��H�H�&�&�d�j�j��	�	�&�J�rOc��UR(dgURR5 URRUR5 SUlgr	)r��removecolorsr��removefilterr�s rL�_rmcolorizer�EditorWindow._rmcolorizers9���z�z���
�
���!������d�j�j�)���
rOc� �UR5 UR5 [RUR5 UR
bUR
R
5 URbURR5 gg)zUpdate the color themeN)	rEr@rrr:r��update_highlight_colorsr��
update_colorsr�s rLr��EditorWindow.ResetColorizerso��	
���������!�!�$�)�)�,����(����5�5�7����(����+�+�-�)rO�_c�>�URSU5 URU5nU(a%X0R;aURSUS-U5 SURU5:XaURSU5 OURSUS-5 UR	U5 g)N�ERRORz
 wordstart�
r)z+1c)r;r��
IDENTCHARSr:r<)r�r:�pos�chars    rL�colorize_syntax_error�"EditorWindow.colorize_syntax_error+sy�����W�c�"��x�x��}���D�O�O�+��L�L��#��"4�c�:��4�8�8�C�=� ��M�M�(�C�(��M�M�(�C�%�K�0�����
rOc��[R"SSSSS9nU(dSURS'g[RURS'g)	z&Update the cursor blink configuration.r5rzcursor-blinkr_r8rraN)rr|r:r`)r��cursorblinks  rLr�� EditorWindow.update_cursor_blink6sC���(�(����V�E���)*�D�I�I�o�&�*2�)@�)@�D�I�I�o�&rOc� �URbURR5 URbURR5 [R"UR
SS5nXRS'UR5 g)z.Update the text widgets' font if it is changedNr5rr])r��update_fontr�rr�rkr:r�)r��new_fonts  rL�	ResetFont�EditorWindow.ResetFont@sp�����(����)�)�+����(����)�)�+��#�#�D�I�I�v�~�F��$�	�	�&�����rOc��[R"5=URlnUR	5H"up#UR
R"U/UQ76 M$ UR5HXn[R"U5nU(dM"UR	5H"up#UR
R"U/UQ76 M$ MZ g)zWRemove the virtual, configurable keybindings.

Leaves the default Tk Text keybindings.
N)	r�GetCurrentKeySetr"�default_keydefs�itemsr:�event_delete�get_standard_extension_names�GetExtensionBindings)r��keydefsrK�keylist�
extensionName�xkeydefss      rL�RemoveKeybindings�EditorWindow.RemoveKeybindingsQs���3;�2K�2K�2M�M��
�
�%��%�m�m�o�N�E��I�I�"�"�5�3�7�3�.�!�>�>�@�M��4�4�]�C�H��x�&.�n�n�&6�N�E��I�I�*�*�5�;�7�;�'7�ArOc�N�[R"5=URlnUR	5 UR5H3n[R"U5nU(dM"UR	U5 M5 0nURRH;n0XES'USH(nU(dMUSXES[US5S'M* M= URH�nURUnUR[5nUcM,US-
n[SU5H�n	URU	5S:XdMURU	S5n
U
(dM5URU	S5nSnXt;aX�U;aXGUnU(dMf[X5n
UR!X�S9 M� M� g)	zUApply the virtual, configurable keybindings.

Also update hotkeys to current keyset.
rrRNrW�acceleratorrfr2)rj)rr]r"r^r�rarb�menudefsrnr�r�rur6r9�	entrycget�get_acceleratorr�)
r�rcrerf�
menuEventDictr1r��menubarItemrcr��accel�itemNamerKs
             rL�ApplyKeybindings�EditorWindow.ApplyKeybindings`s���3;�2K�2K�2M�M��
�
�%������!�>�>�@�M��4�4�]�C�H��x��#�#�H�-�A��
��M�M�*�*�D�%'�M�q�'�"��Q����4�BF�q�'�M�q�'�*�7�4��7�+;�A�+>�?� �+�
 �=�=�K��=�=��-�D��*�*�S�/�C��{���1�H�C��q�#����9�9�U�#�y�0� �N�N�5�-�@�E��u�#'�>�>�%��#A�� "��&�7�'��+E�E�(5�(B�8�(L�� �5�$3�G�$C�E� �,�,�U�,�F�'�)rOc�`�UR(d[R"SSSSS9Ulgg)zCUpdate the indentwidth if changed and not using tabs in this windowr5r^z
num-spacesr7r8N)r�rr|r�r�s rLr��#EditorWindow.set_notabs_indentwidth�s,���|�|�'�1�1�&�(�<�7<� >�D��rOc�|�[R"5nURSnUR[5nX0R
:�aUR
UR
S-U5 U(a@UR5 UH*nURUS5nURUSUS9 M, X RS'g)z4Update the additional help entries on the Help menu.rrRrr�N)
r�GetAllExtraHelpSourcesListr�r�rurvr{r��_extra_help_callbackr�)r��	help_list�helpmenu�helpmenu_length�entryr#s      rLrw�$EditorWindow.reset_help_menu_entries�s����7�7�9�	��=�=��(��"�.�.��-���6�6�6��O�O�T�6�6��:�_�M���"�"�$�"���/�/��a��9���$�$�5��8�S�$�A�#�!)�
�
�f�rOc�^�U4U4SjjnU$)z9Return a callback that loads resource (file or web page).c�z>�URS5(d[RRU5n[R
SSS:Xa[R"U5 g[R"U5 g![a3n[R"S[U5TRS9 SnAgSnAff=f)N)�www�httprlr�r�r�)r-rurv�normpathrJrKr�r�rr�r8r:r�r�)�helpfiler�r�s  �rL�display_extra_help�=EditorWindow._extra_help_callback.<locals>.display_extra_help�s�����&�&��7�7��7�7�+�+�H�5���|�|�B�Q��5�(�<��L�L��*�
����)��	�<��(�(�/G� #�C�����<��<�s�A=�=
B:�)B5�5B:rJ)r��resourcer�s`  rLrx�!EditorWindow._extra_help_callback�s���(0�
	*�"�!rOc���/nURnU(aH[RRU5(a$[	USSS9nUR5nSSS5 U(aJ[RR
U5S-nX;aURU5 URSU5 /nUHCnSU;d)[RRUSS5(aM2URU5 ME UVs/sHofU;dM
UPM nnS	nUS[U5nU(a'[	US
SSS9nURU5 SSS5 UR&R(Hsn
U
R*nUR-S[.5 [1U5H?up�U
R35n
U
R5U
5nUR7X|S-U
-USS9 MA Mu g!,(df   GN�=fs snf!,(df   N�=f![a\n	[URSS5(d5S
URl[ R""SSU	S3UR$S9 Sn	A	GNSn	A	ff=f)z/Load and update the recent files list and menus�utf_8r)r!�errorsNrNr�rd�1234567890ABCDEFGHIJK�w�recentfiles_messageFTzIDLE Warningz)Cannot save Recent Files list to disk.
  z
Select OK to continue.r�r')rfrWrg)rxrurvr�r��	readlines�abspath�remover)�appendr7�
writelinesr�rorkr�r�showwarningr:rorsrsr{ru�	enumerate�rstrip�#_EditorWindow__recent_file_callbackr�)r��new_file�rf_listr
�rf_list_file�	bad_pathsrv�ulchars�rf_file�err�instancer1�i�	file_name�callbacks               rLr��%EditorWindow.update_recent_files_list�s$�����*�*�	�������	�2�2��i�&�y�:�=I�&�0�0�2��:���w�w���x�0�4�7�H��"����x�(��N�N�1�h�'��	��D��t�|�2�7�7�>�>�$�q��*�#=�#=�� � ��&��%,�E�G�D�9�/D�4�G��E�)���!�C��L�)���
*��)�S�#*�9�>�AH��&�&�w�/�>����.�.�H��-�-�D��K�K��3�� )�'� 2���%�,�,�.�	�#�:�:�9�E��� � �w�z�C�'7�)�'C�)1�+,�!�.�!3�/�=:�:��F�
>�>���
*��t�y�y�*?��G�G�48�D�I�I�1��*�*��!%�%(�E�*9�!9� $�y�y�	*���
*�sO�G�>	G1�G1�+H�7G6�	H�
G.�6
H�H�H�
I-�AI(�(I-c�^�U4U4SjjnU$)Nc�8>�TRRUS9 g)N)�editFile)r�r�)�
fn_closurer�s �rL�open_recent_file�=EditorWindow.__recent_file_callback.<locals>.open_recent_file�s����G�G�L�L�*�L�-rOrJ)r�r�r�s`  rL�__recent_file_callback�#EditorWindow.__recent_file_callback�s���(1�	.��rOc���UR5nUR5nS[R"5-nU(a-U(a&[R
"5(dUS-U-U-nO:U(a'US:XaUS-[R"5-nOX-nOU(aUnOSnU=(d U=(d UnUR
5(d
SU-nSU-nURRU5 URRU5 [R
"5(aLURRSU5 URRS	UR
5(+5 gg)
Nz (%s)z - z
IDLE Shellr'�untitledz*%s*z*%sz
-titlepathz	-modified)�short_title�
long_titlerK�python_versionr
�	isCocoaTk�	get_savedro�wm_title�wm_iconname�
wm_attributes)r��short�long�_py_versionr��icons      rLr��EditorWindow.saved_change_hook�s(��� � �"����� ���� 7� 7� 9�9���T�&�"2�"2�"4�"4��E�M�D�(�;�6�E�
���$����x�'>�'>�'@�@���+��
��E��E��%��%����~�~����U�N�E��4�<�D������%� ������T�"�������H�H�"�"�<��6�
�H�H�"�"�;�D�N�N�4D�0D�E�rOc�6�URR5$r	)r�r�r�s rLr��EditorWindow.get_saveds���y�y�"�"�$�$rOc�:�URRU5 gr	)r��	set_saved)r��flags  rLr��EditorWindow.set_saveds���	�	���D�!rOc�8�URR5 gr	)r��
reset_undor�s rLr��EditorWindow.reset_undos���	�	���rOc�~�URRnU(a[RR	U5$S$)Nr�)r�r�rurvr)r�r�s  rLr��EditorWindow.short_title
s-���7�7�#�#��-5�r�w�w����)�E�:�ErOc�@�URR=(d S$)Nr2)r�r�r�s rLr��EditorWindow.long_titles���w�w���%�2�%rOc�$�UR5 grH)r&r
s  rLr�� EditorWindow.center_insert_events�����
�rOc��URnUR5up4URU5nXC-
n[SXVS--
5nUR	[U55 g)NrRrX)r:�getwindowlinesr��maxr�r�)r��markr:ro�botrr>�newtops        rLr&�EditorWindow.centersS���y�y���&�&�(�������%������Q����*�+���
�
�5��=�!rOc��URnURS5nURS5nX#:Xa)UR5S:Xa[US5nX$-S-
nX#4$)Nr�z@0,65535rRr>)r:r��winfo_heightr7)r�r:ror�r>s     rLr��EditorWindow.getwindowliness]���y�y���n�n�V�$���n�n�Z�(���:�$�+�+�-��2���h��(�F��,��"�C��x�rOc�`�URn[[URU555$r	)r:r7r�r�)r�r�r:s   rLr��EditorWindow.getlineno's$���y�y���5����D�)�*�+�+rOc��URR5n[R"SU5n[	[[UR555$)zReturn (width, height, x, y)z(\d+)x(\d+)\+(-?\d+)\+(-?\d+))ro�wm_geometry�re�match�listrr7�groups)r��geom�ms   rL�get_geometry�EditorWindow.get_geometry+s=���x�x�#�#�%���H�H�5�t�<���C��Q�X�X�Z�(�)�)rOc�$�UR5 grH)r�r
s  rLr��EditorWindow.close_event1s���
�
��rOc�\�UR(a�UR5(dlURR5S:waURR	5 URR5 URR
5 URR5$g)Nr�)r�r�ror2�	deiconify�lower�lift�	maybesaver�s rLr��EditorWindow.maybesave5sl���7�7��>�>�#�#��8�8�>�>�#�X�-��H�H�&�&�(������ ����
�
���7�7�$�$�&�&�
rOc��UR5n[U5S:waUR5 U$![a gf=f)N�cancel)r�r8�_close�AttributeError)r��replys  rLr��EditorWindow.close>s?��	��N�N�$�E��5�z�X�%����
��L���	��	�s�03�
A�Ac�j�URR(a#URURRS9 [R"UR
5 UR
5 URR5 SUlSUlUR(a!URR5 SUl	SUl
SUlURR5 SUlURR5 UR(aUR5 gg)N)r�)r�r�r�r�unregister_callbackr��unload_extensionsr�r�r�r:rqr�ro�destroyr3r�s rLr��EditorWindow._closeGs����7�7����)�)�4�7�7�3C�3C�)�D��"�"�4�#7�#7�8���� ����
�
�������	��:�:��J�J�����D�J���	� �������������������?�?��O�O��rOc�2�0UlUR5 gr	)�
extensions�load_standard_extensionsr�s rLr��EditorWindow.load_extensions[s������%�%�'rOc��[URR55H&n[US5(dMUR	5 M( 0Ulg)Nr�)r�r��valuesr�r�)r��inss  rLr��EditorWindow.unload_extensions_s=������.�.�0�1�C��s�G�$�$��	�	��2���rOc��UR5HnURU5 M g! [S[U55 [R
"5 MI=f)NzFailed to load extension)ra�load_extension�print�repr�	traceback�	print_exc)r�r4s  rLr��%EditorWindow.load_standard_extensionsesJ���5�5�7�D�
&��#�#�D�)�8��
&��0�$�t�*�=��#�#�%�s	�+�,Ac�*�[R"SS9$)NT)�editor_only)r�
GetExtensionsr�s rLra�)EditorWindow.get_standard_extension_namesms���%�%�$�7�7rO�ZzDummy�zzdummyc��URRX5n[R"SU-[S9n[X15n[R"U5n[US5(aURURU5 U"U5nX`RU'U(a�URU5 UH�nUR!SS5nUSSS:XaUSSnUSSS:XaMUS	SS
:XaUSS	nUS	SS
:XaMUS-n[Xh5(dM^UR"R%U[Xh55 M� gg![
[4a [R"U5nGN0f=f![
a [SU5 ef=f)Nr&)�packagez
Failed to import extension: rk�-rKrRr/rdr1�_event)�extfilesr��	importlib�
import_module�__package__�ImportError�	TypeErrorr�rorrbr�rrrkr�r�rr:r�)	r�r4�fname�mod�clsrcr��vevent�
methodnames	         rLr��EditorWindow.load_extensiontsv���
�
�!�!�$�-��	�
5��-�-�c�E�k�;�O���c� ���/�/��5���3�
�#�#��O�O�C�L�L�'�2��$�i�� #����������(�!��#�^�^�C��5�
� ��!�n��+�!+�A�B��J�!��!�n��+� ���o��,�!+�C�R��J�!���o��,�'�(�2�
��3�+�+��I�I�N�N�6�7�3�+C�D�"��� ��+�
5��-�-�e�4��
5���	��2�D�9��	�s#�E�&E+�'E.�*E+�+E.�.Fc���UcURRnURnXlUR	5H!up4U(dMUR
"U/UQ76 M# g)z"Add events with keys to self.text.N)r"r^r:rcr_r�)r�rcr:rKrds     rLr��EditorWindow.apply_bindings�sL���?��m�m�3�3�G��y�y����%�m�m�o�N�E��w����u�/�w�/�.rOc
��UcURRnUcURRnURnURnUH�upVURU5nU(dMUH�nUcUR
5 MUup�U	SSS:HnU(aU	SSn	[U	5up�[X*5n
XJ4SjnU(a)URU
[5nURX�X�US9 M~URX�UU
S9 M� M� g)z�Fill in dropdown menus used by this window.

Items whose name begins with '!' become checkbuttons.
Other names indicate commands.  None becomes a separator.
NrR�!c�&�URU5 gr	r�r�s  rLrW�(EditorWindow.fill_menus.<locals>.command�s���+�+�I�6rO)rfrgrWrj�variable)rfrgrWrj)
r"rkr^r�r:r�r�rnrm�get_var_obj�
BooleanVar�add_checkbuttonr�)r�rkrcr�r:�mname�	entrylistr1r|rfr��checkbuttonrgrjrW�vars                rLrr�EditorWindow.fill_menus�s
�����}�}�-�-�H��?��m�m�3�3�G��=�=���y�y�� (��E��<�<��&�D���"���=��&�&�(�',�$�E�#(��!�9��#3�K�"� %�a�b�	��'.�u�~�$�I�"1�'�"E�K�%)�7�"�"�.�.�y�*�E���,�,�5�$+�%(�-�*��(�(�u�18�5@�)�B�%#�	!)rOc�l�URU5nU(aUR5nU$[U5er	)rr��	NameError)r�r4r%�values    rL�getvar�EditorWindow.getvar�s/�����t�$����G�G�I�E��L��D�/�!rOc�l�URX5nU(aURU5 g[U5er	)rr�r()r�r4r)�vartyper%s     rL�setvar�EditorWindow.setvar�s*�����t�-����G�G�E�N��D�/�!rOc��URRU5nU(d(U(a!U"UR5=URU'nU$)z:Return a tkinter variable instance for the event.
        )rqr�r:)r�r�r-r%s    rLr�EditorWindow.get_var_obj�sB�����#�#�I�.���w�18����1C�C�D���i�(�3��
rOc��UR(aAURRSU5=(d SURRU5;$g)N�TODO�STRINGrR)r�r:�
tag_prevrange�	tag_names)r��
text_indexs  rL�is_char_in_string�EditorWindow.is_char_in_string�sE���:�:��9�9�*�*�6�:�>�?��t�y�y�2�2�:�>�>�
?�rOc��URRS5nURRS5nX4$![a gf=f)Nr-r0�NNr�)r�rArBs   rL�get_selection_indices�"EditorWindow.get_selection_indices�sE��	��I�I�O�O�K�0�E��9�9�?�?�:�.�D��;����	��	�s�8;�
A�Ac�P�URS=(d [n[U5$)N�tabs)r:�TK_TABWIDTH_DEFAULTr7)r��currents  rL�get_tk_tabwidth�EditorWindow.get_tk_tabwidth�s ���)�)�F�#�:�':���7�|�rOc	���URnUR5U:wa@URRSSUSSURSU-5nURUS9 gg)Nr]rz
-displayof�n)r?)r:rBrr��master�	configure)r��newtabwidthr:�pixelss    rL�set_tk_tabwidth�EditorWindow.set_tk_tabwidth�s^���y�y�����!�[�0��W�W�\�\�&�)�T�&�\�".����"%��"3�5�F�
�N�N��N�'�1rOc���U(aNU(aGUR5nSUs=::aS::a	O OX0lURUR:waSUlUR	UR5 g)NrXrF)�guess_indentr�r�r�rJ)r�r�guessr�s    rLr��#EditorWindow.set_indentation_params	sQ�����!�!�#�A��A�{��{�#$� ����4�=�=�0�$������T�]�]�+rOc�B�URnUR5up4U(a+U(a$URX45 URSU5 gUR	SS5nUS:Xa;URSSS5(aURS5 gUR
5 gUSS	;aURS5 gURn[URU55nUS
:�deUS-
UR-UR-nS
n	USSnU	S-n	[URU55nXx::d	USS	;aOM5UR5 URSU	-S5 Xx:a"URSS
X�-
-UR5 UR5 g)Nr)rIr%r2r1r,z	insert-1crd� 	rrRz
insert-%dcr')r:r<r{r:r�r4�bellr�r7�
expandtabsr�r�r)r�r�)
r�rKr:rArB�charsr��have�want�
ncharsdeleteds
          rLr��"EditorWindow.smart_backspace_events����y�y���0�0�2����T��K�K��$��M�M�(�E�*�����+�X�6���B�;��|�|�H�c�5�1�1����K�(���	�	����"�I�U�"��K�K��$���=�=���5�#�#�H�-�.���a�x��x����d�.�.�.�$�2B�2B�B���
���#�2�J�E�)�A�-�M��u�'�'��1�2�D��|�u�R�y��5���	
�������L�=�0�(�;��;��K�K��#���"5��3�3�
5�����rOc�8�URnUR5up4UR5 U(amU(af[U5[U5:wa+URRU5UR
5 $URX45 URSU5 URSS5n[XPR5upgU[U5:XaURXpR-5 OjUR(aSnO:[UR!UR55nURn	SX�U	--
-nUR#SX�R$5 UR'S5 UR
5 g!UR
5 f=f)Nr)r%r(r'rI)r:r<r��
index2liner�r�r�r{r:r��get_line_indentr�r7�reindent_tor�r�rSr)r�r<)
r�rKr:rArB�prefix�raw�	effective�padrEs
          rLr��EditorWindow.smart_indent_event=sD���y�y���0�0�2�������	#����e�$�
�4�(8�8��<�<�;�;�E�B�(
� � �"�'���E�(��
�
�h��.��X�X�0�(�;�F�,�V�]�]�C�N�C��c�&�k�!�� � ��-=�-=�!=�>��<�<��C� #�F�$5�$5�d�m�m�$D� E�I��(�(�A����]�!2�3�C����H�c�+F�+F�G��H�H�X���� � �"��D� � �"�s�AF�C4F�Fc�	�URnUR5up4UR5 U(a*U(a#URX45 UR	SU5 URSS5nS[
U5pvXg:aXVS;aUS-
nXg:a
XVS;aMXg:Xa@URSSUR5 URS5 UR5 gUSUnSnU(a%US	S;aUSS	nUS-
nU(aUS	S;aMU(aURS
U-S5 URS5S;a(URS5 URS5S;aM(URSSUR5 [URS55n	[R"URUR 5n
UR"(d�UR$Hmn['X�-
S5n[)U5S-n
URU
S5nU
R+U5 U
R-UR/U
55nUcUS:XdMm O U
R1W=(d S5 OUUR3SS5nU(aUSn
OS
n
URU
S5nU
R+U5 U
R1S5 U
R55nU[R6:wGaU[R8:XaO�U[R::XaURSX�R5 O�U[R<:Xa UR?U
RA55 OqU[RB:XaRU
RE5S:�aURSUUR5 O+UR?U
RG55 OSU<35eURS5 UR5 gU
RI5nURSX�R5 U
RK5(aURMU5 O-U(a&U
RO5(aURQU5 URS5 UR5 g!URS5 UR5 f=f)aUInsert 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)r%rrQrRrNrINrdzinsert - %d charsr�consoler,zbogus continuation type ))r:r<r�r{r:r�r7r)r�r<r�rZr�r�Parserr�r�ryr�r�r��set_code�find_good_parse_start�_build_char_in_string_func�set_lor5�get_continuation_type�C_NONE�C_STRING_FIRST_LINE�C_STRING_NEXT_LINES�	C_BRACKETr\�compute_bracket_indent�C_BACKSLASH�get_num_lines_in_stmt�compute_backslash_indent�get_base_indent_string�is_block_openerr��is_block_closerr�)r�rKr:rArBr>r�rE�indent�lnor��context�startat�startatindex�rawtext�bod�rr*s                  rLr��%EditorWindow.newline_and_indent_event`s���y�y���0�0�2�������e	#������E�(��
�
�h��.��8�8�.��9�D��c�$�i�q��%�D�G�u�,��Q����%�D�G�u�,��v����.�� �7�7�9��j
�H�H�X��� � �"�k�"�1�X�F��A��4��8�u�,��C�R�y���Q����4��8�u�,�����/�!�3�X�>��(�(�8�$��-����H�%��(�(�8�$��-�
�K�K��$��(C�(C�D��T�Z�Z��1�2�C����t�/�/����?�A��(�(�#�5�5�G�!�#�-��3�G�#'��=�4�#7�L�"�h�h�|�X�>�G��J�J�w�'��1�1� �;�;�L�I�K�C���'�Q�,�� 6�������"��&�&�y�(�;���#$�Q�4�L�#(�L��(�(�<��:���
�
�7�#�������'�'�)�A��G�N�N�"���3�3�3���'�5�5�5��K�K��&�2M�2M�N��'�+�+�+�
�$�$�Q�%=�%=�%?�@��'�-�-�-��.�.�0�1�4����H�f�$(�$?�$?�A��(�(��)C�)C�)E�F�>� 8���>�>�1��
�H�H�X��� � �"��-�-�/�F��K�K��&�*E�*E�F�� � �"�"��'�'��.��A�-�-�/�/��*�*�5�1���H�H�X��� � �"��
�H�H�X��� � �"�s4�A.R'� "R'�%1R'�AR'�1C(R'�FR'�BR'�'#S
c�(�UUR4SjnU$)Nc��U"USU--5$)Nz+%dcrJ)�offset�_startindex�_iciss   rL�inner�6EditorWindow._build_char_in_string_func.<locals>.inner�s����v���6�7�7rO)r8)r��
startindexr�s   rLrg�'EditorWindow._build_char_in_string_func�s��&0��.�.�	8��rOc�r�UR(a"[XR5up#SU-SU--$SU-$)Nr(r')r��divmodr�)r�rE�ntabs�nspacess    rL�_make_blanks�EditorWindow._make_blanks�s5���<�<�#�A�}�}�5�N�E��%�<�#��-�/�/���7�NrOc��URnUR5 URSSS5(aURSS5 U(a,UR	SURU5UR5 UR5 g)Nr%z!=r))r:r�r4r{r)r�r�r�)r�rZr:s   rLr\�EditorWindow.reindent_to�sm���y�y�������<�<�*�D�(�;�;��K�K�*�H�5���K�K��$�"3�"3�F�";��3�3�
5����rOc���[UR5R5upU(a9U(a2[XR5up4[X R5up5XT-
$S=pEXT-
$�Nr)�IndentSearcherr:r]r[r�)r��opener�indentedr^�indentsmall�indentlarges      rLrM�EditorWindow.guess_indentsa��)�$�)�)�4�8�8�:����h�.�v�}�}�E��C�.�x���G��C��(�(�)*�)�K��(�(rOc���URcgURR(aURR5 SnOURR5 SnUR	SSUS3S9 g)N�Show�Hiderergz
 Line Numbers)r1r�rf)r��is_shown�hide_sidebar�show_sidebarr�)r�rK�
menu_labels   rLr��&EditorWindow.toggle_line_numbers_event
sp�����$�����%�%����*�*�,��J����*�*�,��J����I�]�(2�|�=�%A�	�	CrO)$r�r�rvr3r�r�r�rKr�rjr�r�r�r�r�rmr�r�r�ryrsrxr�rkr�rIr�r:r{rqror�r�r3r6r�)NNNNr	)r)r;)T)�r�
__module__�__qualname__�__firstlineno__�idlelib.percolatorr�idlelib.colorizerrr�idlelib.undor�idlelib.iomenur r!rr"�idlelib.statusbarr#�idlelib.autocompleter$�idlelib.autoexpandr%�idlelib.calltipr&�idlelib.codecontextr'�idlelib.sidebarr(�idlelib.formatr)r*r+r,�idlelib.parenmatchr-�idlelib.zoomheightr.rJ�getfilesystemencoding�filesystemencodingrir�r�r�rr�r�r�r�r�rPrmrr�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�rr�r�r�r�r'r�r3r6r�r@rEr��string�
ascii_letters�digitsrOrRr�rZrgrrr�rwrxr�r�r�r�r�r�r�r�r�r&r�r�r�r�r�r�r�r�r�r�rarr�r�rrr*r.rr8r<rBrJr�r�r�r�rgr�r\rMr��__static_attributes__rJrOrLrr&s���-�>�*�2� �0�1�-�'�/�+�M�M�-�-��2�2�4���H�����!��|I�|�4��
)�V7� ;��&�J�#'�J)�1�
1�
	�
�E�!�J	,��K�

�'�4�����	����
��
�(���������0�	��
��:��
%��K��.��%�%��
�
�5��;�J�	�A��"
<�&G�P>�)�"
"�,.�\ �
F�>%�"��F�&��"��,�*��'���((��&�8�	�9�
�H�E�80�$B�L"�"��$���(�,�)�V!#�Fq#�p� ��)�CrOrc�*�[[U55$r	)r7r�)r�s rLrZrZs���u�U�|��rOz[ \t]*c��[RU5nUR5[UR	5RU554$)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�rcr7�grouprS)r>r�r�s   rLr[r[s;��	���d�#�A��5�5�7�C����	�,�,�X�6�7�7�7rOc�b�\rSrSrSrSrSr\R\RS4Sjr
SrSrg	)
r�i'z4Manage initial indent guess, returned by run method.c�H�XlS=UlUlS=UlUlgr�)r:r��finished�blkopenline�indentedline)r�r:s  rLr�IndentSearcher.__init__*s%���	�!"�"�����/3�3���4�,rOc���UR(agURS-=ol[U5S-nURR	USS5(agURRX"S-5$)Nr2rRrz>=rcz lineend+1c)r�r�r�r:r4r�)r�r�r�s   rL�readline�IndentSearcher.readline/s_���=�=���V�V�a�Z���F��A�w��~���9�9���T�4��/�/���y�y�}�}�T�-�#7�8�8rO)�class�def�for�ifr��try�while�withc	��UR(agX:XaX(;aXPlgX:Xa UR(aXPlSUlggg)NrR)r�r�r�)	r�r9�token�startrcr>�INDENT�NAME�OPENERSs	         rL�
tokeneater�IndentSearcher.tokeneater8s?��
�=�=��
�\�e�.�#��
�^�� 0� 0� $���D�M�!1�^rOc���[R"UR5nUHnUR"U6 M URUR4$![R[
4a N4f=f)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   rLr]�IndentSearcher.runEsi��
	��-�-�d�m�m�<�F�������'� �
����!2�!2�2�2���#�#�[�1�	��	�s�8A�A/�.A/)r�r�r�r�r:N)
rr�r�r��__doc__rr�r�r�r�r�r]r�rJrOrLr�r�'s.��:�4�
9�#�/�/� �
�
�-��3rOr�c�P�URS5nUS:�a
USUXS-S-nX4$)z�Extract 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).
rKrNrR)r�)�sr�s  rLrnrnVs6��	
���s��A��A�v�
�b�q�E�A��c�d�G�O���4�KrO�[�]�/)�bracketleft�bracketright�slashc�6�URU5nU(a [R"5(aUS;agUSn[R"SSU5n[R"SSU5n[R"SSU5n[R"S	S
U5n[R"SSU5n[R"S
SU5n[R"SSU5n[R"SSU5n[R"SSU5nU$)aKReturn 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.
>rPrFrQr2rz-[a-z]\bc�>�UR5R5$r	)r��upper�r�s rLrM�!get_accelerator.<locals>.<lambda>�s��a�g�g�i�o�o�&7rOz\b\w+\bc�f�[RUR5UR55$r	)�keynamesr�r�r�s rLrMr��s��X�\�\�!�'�'�)�Q�W�W�Y�%GrOzKey-�Cancelz
Ctrl-BreakzControl-zCtrl-r
�+z><r'r/r1)r�r
r�r��sub)rcr�rdr�s    rLrmrmms����k�k�)�$�G�
��)�)�+�+�	�>6�16����
�A�
���{�7��;�A�
���z�G��K�A�
���v�r�1��A�
���x��q�)�A�
���z�7�A�&�A�
���s�C���A�
���t�S�!��A�
���s�B���A�
���s�B���A��HrOc��URnURSSS5 URSSS5 URSSS5 g)	N�tcl_wordBreakAfterza brr��
tcl_wordcharsz\w�tcl_nonwordcharsz\W)rr�)rkrs  rL�
fixwordbreaksr��s?��
���B��G�G� �%��+��G�G�E�?�E�*��G�G�E�%�u�-rOc�H�Un[U5 [RSS(a[RSnOSn[R"US5 [XS9nURnSUS'[S5H'nURSSU-[U5-S-5 M) g)	NrR)rkr��
r>�r)z  rN)
r�rJ�argvr
�setupApprr:r6r)r8)r�rkr�rYr:r�s      rL�_editor_windowr��s����D��$��
�x�x���|��8�8�A�;����
�O�O�D�$���T�5�D��9�9�D��D��N�
�2�Y�����H�d�1�f�s�1�v�o��4�5�rO�__main__)r5zidlelib.idle_test.test_editorrXF)�	verbosity�exit)r])9�
importlib.abcr
�importlib.utilrurKr�r�rJr�r�r��tkinter�tkinter.fontr�tkinter.ttkrrr�idlelib.configrrr	r
rrr
�idlelib.multicallrrrrr�idlelib.treer�idlelib.utilrr�idlelib.helprr@rrrZ�compiler�r[r�rnr�rmr�r�r�unittestr5�idlelib.idle_test.htestr]rJrOrL�<module>rs�����	��	�
�
������!� ��#� �����.�����$�&��%���	����	!��oC�oC�d/��*�*�Y�'��8�*3�*3�^�$��

���(
�V.�
6�&�z����	(�A�E�B�+����rO

Youez - 2016 - github.com/yon3zu
LinuXploit