Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/idlelib/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/idlelib/__pycache__/codecontext.cpython-312.opt-2.pyc

�

%Μg�,����	ddlZddlmZddlmZmZmZddlm	Z	m
Z
ddlmZhd�Z
ejd�fd�Zd	�ZGd
�d�Zej%�edk(rdd
lmZeddd��yy)�N)�maxsize)�Frame�Text�TclError)�NSEW�SUNKEN)�idleConf>�if�def�for�try�elif�else�with�async�class�while�except�finallyz^(\s*)(\w*)c�B�	|j|�j�S�N)�match�groups)�codeline�cs  �0/usr/local/lib/python3.12/idlelib/codecontext.py�get_spaces_firstwordrs��D��7�7�8��#�#�%�%�c��	t|�\}}t|�}t|�|k(s||dk(rt}|tvxr|}|||fS)N�#)r�len�INFINITY�BLOCKOPENERS)r�spaces�	firstword�indent�openers     r�
get_line_infor(sZ���
-�X�6��F�I�
��[�F�
�8�}���(�6�"2�c�"9���
�,�
&�
4�9�F��8�V�#�#rc�d�eZdZ	dZd�Zd�Zed��Zd�Zdd�Z	dd�Z
d	�Zdd
�Zd�Z
d�Zd
�Zy)�CodeContext�dc�V�	||_|j|_|j�yr)�editwin�text�_reset)�selfr-s  r�__init__zCodeContext.__init__1s$��	� ����L�L��	����
rc�L�d|_d|_d|_d|_dg|_y)N�)r����F)�context�cell00�t1�
topvisible�info�r0s rr/zCodeContext._resetFs(��������������'�(��	rc�D�	tjddddd��|_y)N�
extensionsr*�maxlines�int�)�type�default)r	�	GetOption�
context_depth)�clss r�reloadzCodeContext.reloadMs$��+�$�.�.�|�]�/9��79�;��rc��	|j�.	|jj|j�d|_yy#t$rY�wxYwr)r8r.�after_cancelrr;s r�__del__zCodeContext.__del__TsL��"��7�7��
��	�	�&�&�t�w�w�/��D�G����
��
�s�%=�	A	�A	Nc
�@�	|j���|jj|jjf}d}d}|D]�}||jjur|j	�n|j�}||jj|d�z
}||jj|jd��z
}||jj|jd��z
}��t|jjddd||td��x}|_|j�|j�|jd|j�|j�|j!ddt"��t%j&t%j(�d	�}t+|jj|d
��|_|j,j!ddt"��d}	ny|jj/�d|_|j,j/�d|_|jj1|j2�|j5�d
}	|jj7dd|	�d���y)Nr�padx�borderr3�disabled)�height�width�highlightthicknessrKrL�relief�statez<ButtonRelease-1>)�row�column�sticky�
linenumber�
background��bg�Hide�Show�optionsz*ode*ontextz
 Code Context)�menu�index�label�break)r6r-r.�
text_frame�	grid_info�	pack_info�tk�getint�cgetrr�update_font�update_highlight_colors�bind�
jumptoline�timer_event�gridrr	�GetHighlight�CurrentThemerr7�destroyrHr8r/�update_menu_label)
r0�event�widgetsrKrL�widgetr:r6�line_number_colors�menu_statuss
          r�toggle_code_context_eventz%CodeContext.toggle_code_context_event]s6��	��<�<���l�l�'�'����)@�)@�@�G��D��F�!��!�T�\�\�%6�%6�6��(�(�*�#�-�-�/����	�	�(�(��f��6�6����	�	�(�(����V�)<�=�=���&�)�)�*�*�6�;�;�x�+@�A�A��
"�&*����'�'���#$��&��z�&K�
K�G�d�l�
�����(�(�*��L�L�,�d�o�o�>������L�L�Q�q��L�6�!)�!6�!6�x�7L�7L�7N�7C�"E������ 7� 7�+=�l�+K�M�D�K��K�K����1�T��:� �K��L�L� � �"��D�L��K�K���!��D�K��I�I�"�"�4�7�7�+��K�K�M� �K����&�&�I�]�0;�}�M�-J�	'�	L�rc�:�	g}t}t||dz
d�D]l}|jj|�d�|�d��}t	|�\}}	}
||ks�:|}|
dvr|dz
}|
r||kr||k\r|j|||	|
f�||ks�ln|j
�||fS)Nr3r4�.0z.end)rr)r"�ranger.�getr(�append�reverse)r0�new_topvisible�stopline�
stopindent�lines�
lastindent�linenumrr&r.r's           r�get_contextzCodeContext.get_context�s���	����
��^�X�a�Z��<�G��y�y�}�}��y��^��y��5E�F�H�#0��#:� �F�D�&��
�"�#�
��-�-��!�O�J��g��6�6�Z�;O��L�L�'�6�4��!@�A���+��=�	�
�
���j� � rc���	|jjd�}|j|k(ry|j|krX|j||j�\}}|jdd|k\r�|jd=|jdd|k\r�#n�|jdddz}|jdd|k\r5|jdd}|jd=|jdd|k\r�5|j||jdddz|�\}}|jj|�||_|j|jdD�cgc]}|d��	}}|drdnd}t|�|z
|jd<d|jd<|jjd	d
�|jjd
dj||d��d|jd<ycc}w)
Nz@0,0r4r3r�rN�normalrRz1.0�end�
rM)r-�	getlinenor9r�r:�extendrDr!r6�delete�insert�join)r0r}r�r�r�x�context_strings�	showfirsts        r�update_code_contextzCodeContext.update_code_context�s���	����/�/��7���?�?�n�,���?�?�^�+� $� 0� 0��15���!B��E�:��)�)�B�-��"�j�0��I�I�b�M��)�)�B�-��"�j�0����2��q�)�A�-�J��)�)�B�-��"�n�4�!�Y�Y�r�]�1�-�
��I�I�b�M��)�)�B�-��"�n�4�!%� 0� 0��15���2��q�1A�!�1C�1;�!=��E�:�	
�	�	�����(���)-���D�4F�4F�3F�3G�)H�I�)H�A�1�Q�4�)H��I�(��+�A��	�!$�_�!5�	�!A����X�� (����W�������E�5�)������E�4�9�9�_�Y�Z�-H�#I�J� *����W���Js�G5c��		|jjd�y#t$r�t|j�}|dk(rd}n^tt
|jjd���}td||jz
�dz
}|j||zd}|jj|�d��|j�YywxYw)Nz	sel.firstr3r�rrx)r6r^rr!r:r?�float�maxrDr.�yviewr�)r0rqr��newtop�contextline�offsets      rrjzCodeContext.jumptoline�s���	�

	'��L�L���{�+���	'���	�	�N�E���z���"�%����(:�(:�8�(D�"E�F���Q���(:�(:� :�;�a�?�����6�K�#7�8��;���I�I�O�O�v�h�b�M�*��$�$�&�	'�s��B2C�Cc��	|j�F|j�|jj|j|j
�|_yyr)r6r�r.�after�UPDATEINTERVALrkr8r;s rrkzCodeContext.timer_event�sB��H��<�<�#��$�$�&��i�i�o�o�d�&9�&9�4�;K�;K�L�D�G�$rc�~�|j�1tj|jdd�}||jd<yy)N�main�EditorWindow�font)r6r	�GetFontr.)r0r�s  rrgzCodeContext.update_font�s7���<�<�#��#�#�D�I�I�v�~�F�D�#'�D�L�L�� �$rc�\�|j�Ltjtj�d�}|d|jd<|d|jd<|j�Htjtj�d�}|jj|d��yy)Nr6rW�
foregroundrVrX)r6r	rmrnr7�config)r0�colorsrts   rrhz#CodeContext.update_highlight_colors�s����<�<�#��*�*�8�+@�+@�+B�I�N�F�)/��)=�D�L�L��&�)/��)=�D�L�L��&��;�;�"�!)�!6�!6�x�7L�7L�7N�7C�"E���K�K���"4�\�"B��C�#rr)r3r)�__name__�
__module__�__qualname__r�r1r/�classmethodrFrIrvr�r�rjrkrgrh�rrr*r*-sT��2��N��*)��;��;��6�p!�<&+�P'�*M�(�
	Drr*�__main__)r�z"idlelib.idle_test.test_codecontextr�F)�	verbosity�exit)�re�sysrr"�tkinterrrr�tkinter.constantsrr�idlelib.configr	r#�compilerr(r*rFr��unittestr�r�rr�<module>r�s{���
�#�)�)�*�#�>��&0�R�Z�Z��%?�&�
$�WD�WD�t�����z����	-���G�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists