Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.14.131.169
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : macosx.cpython-311.pyc
�

Tf�$���dZddlmZddlZddlmZddlZdad�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�ZedkrddlmZedd���dSdS)z3
A number of functions that enhance IDLE on macOS.
�)�
expanduserN)�platformc�^�tdkr�ddlm}|r#ddlm}m}	|d��n#|$rdaYdSwxYwtj��}|j	�
dd	��}d
|vrdan*d|vrd
an#d|j	�
ddd��vrdanda|���nd
adS)zu Initialize _tk_type for isXyzTk functions.

    This function is only called once, when _tk_type is still None.
    �darwinr)�testing)�requires�ResourceDenied�gui�cocoaN�tk�windowingsystem�x11�xquartz�aqua�other�AppKit�winfo�server�.�carbon)r�idlelib.__init__r�test.supportrr	�_tk_type�tkinter�Tkr�call�destroy)rrr	�root�wss     �7/usr/local/python-3.11/lib/python3.11/idlelib/macosx.py�
_init_tk_typer!s���8���
	-�,�,�,�,�,��	�=�=�=�=�=�=�=�=�
���������!�
�
�
�"�����
�����z�|�|��
�W�\�\�$� 1�
2�
2���B�;�;� �H�H�
�2�
�
��H�H�
�����g�x��=�=�
=�
=��H�H��H����������
�Fs�)�4�4c�X�tst��tdkp
tdkS)zK
    Returns True if IDLE is using a native OS X Tk (Cocoa or Carbon).
    rr�rr!��r �isAquaTkr&3s*���������w��6�(�h�"6�6r%c�B�tst��tdkS)zb
    Returns True if IDLE is using a Carbon Aqua Tk (instead of the
    newer Cocoa Aqua Tk).
    rr#r$r%r �
isCarbonTkr(;s ��
�������x��r%c�B�tst��tdkS)z8
    Returns True if IDLE is using a Cocoa Aqua Tk.
    rr#r$r%r �	isCocoaTkr*Ds ���������w��r%c�B�tst��tdkS)z7
    Returns True if IDLE is using an OS X X11 Tk.
    rr#r$r%r �	isXQuartzr,Ls ���������y� � r%c���tdkrdStd��}	t|d��5}tj|��cddd��S#1swxYwYdS#t
$rYdSwxYw)z-
    Fetch the macOS system preferences.
    rNz.~/Library/Preferences/.GlobalPreferences.plist�rb)rr�open�plistlib�load�OSError)�
plist_path�
plist_files  r �readSystemPreferencesr5Us����8����t��L�M�M�J��
�*�d�
#�
#�	-�z��=��,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	-�	-�������t�t����s4�A�A�A�A�A�A�A�
A*�)A*c�x�tdkrdSt��}|r|�d��dkr	dSdS)zJ
    Warn if "Prefer tabs when opening documents" is set to "Always".
    rN�AppleWindowTabbingMode�alwaysz�WARNING: The system preference "Prefer tabs when opening documents" is set to "Always". This will cause various problems with IDLE. For the best experience, change this setting when running IDLE (via System Preferences -> Dock).)rr5�get)�prefss r �preferTabsPreferenceWarningr;dsT���8����t�!�#�#�E��
����3�4�4��@�@�
>�	
�	
��4r%c�>���fd�}|�d|��dS)z�
    This ensures that the application will respond to open AppleEvents, which
    makes is feasible to use IDLE as the default application for python files.
    c�<��|D]}��|���dS�N)r/)�args�fn�flists  �r �
doOpenFilez'addOpenEventSupport.<locals>.doOpenFile}s-����	�	�B��J�J�r�N�N�N�N�	�	r%z::tk::mac::OpenDocumentN)�
createcommand)rrArBs ` r �addOpenEventSupportrDxs;���
�����	���0�*�=�=�=�=�=r%c�j�	|j�dd��dS#tj$rYdSwxYw)N�console�hide)rrr�TclError�rs r �
hideTkConsolerJ�sH��
�����Y��'�'�'�'�'����
�
�
����
���s��2�2c�p����ddlm}ddlm}ddlm�|jddd}|jdddd�=|jdd�d	|��|jd
ddd�=|jdddd�=|���}��|���i}||d
d���x|d
<}|�d|d���|f�fd�	}��	|��d!�fd�	}	d!��fd�	}
d!�fd�	}��
d|	����
d|
����d|
���r6��
d�j����d�j��t��rI||dd���x|d<}|�d|���|j�ddddgf��t��rB��d|	����d |��|jd
dd=dSdS)"zf
    Replace the Tk root menu by something that is more appropriate for
    IDLE with an Aqua Tk.
    r)�Menu)�mainmenu)�window�������N�����)�menurN)�name�tearoff�Window)�labelrU�	underlinec���|�d��}|�d}|dkr|�d|����|��dS)N�endrSr)�index�delete�add_windows_to_menu)rUr\rNs  �r �postwindowsmenuz)overrideRootMenu.<locals>.postwindowsmenu�sU����j�j������;��C���7�7��K�K��3�����"�"�4�(�(�(�(�(r%c�>��ddlm}|����dS)zHandle Help 'About IDLE' event.r)�
help_aboutN)�idlelibrb�AboutDialog)�eventrbrs  �r �about_dialogz&overrideRootMenu.<locals>.about_dialog�s1���	'�&�&�&�&�&����t�$�$�$�$�$r%c�X��ddlm}�j�_|��d��dS)z&Handle Options 'Configure IDLE' event.r)�configdialog�SettingsN)rcrh�inversedict�
instance_dict�ConfigDialog)rerhrArs  ��r �
config_dialogz'overrideRootMenu.<locals>.config_dialog�s@���	)�(�(�(�(�(�#�.����!�!�$�
�3�3�3�3�3r%c�>��ddlm}|����dS)zHandle Help 'IDLE Help' event.r)�helpN)rcro�
show_idlehelp)rerors  �r �help_dialogz%overrideRootMenu.<locals>.help_dialog�s1���	!� � � � � ����4� � � � � r%�<<about-idle>>z<<open-config-dialog>>z::tk::mac::ShowPreferencesz<<close-all-windows>>z::tk::mac::Quit�apple�application�IDLE)rYrU)z
About IDLErr�
tkAboutDialogz::tk::mac::ShowHelpr>)rrLrcrMrN�menudefs�insert�	configure�add_cascade�register_callback�bindrC�close_all_callbackr(r*)
rrArLrM�	closeItem�menubar�menudictrUr`rfrmrqrNs
``          @r �overrideRootMenur��s����� ������ � � � � � ��������!�!�$�Q�'��+�I�
	��!��Q�����$���a����"�"�1�i�0�0�0�	��"��a� ��1��%�	��"��a� ��1��%��d�4�j�j�G��N�N��N� � � ��H� $��W�8�Q� G� G� G�G�H�X������h�T�Q��?�?�?�!�)�)�)�)�)�)����_�-�-�-�%�%�%�%�%�%�
4�
4�
4�
4�
4�
4�
4�!�!�!�!�!�!�	�I�I���-�-�-��I�I�&�
�6�6�6����3�]�C�C�C��H��	�	�)�5�+C�D�D�D�
	
���,�e�.F�G�G�G��|�|�	�)-��g�G�67�*9�*9�*9�	9����$����&�t��4�4�4��� � ��
�0���
�	�	�	�
�{�{�(����?�L�9�9�9����0�+�>�>�>���b�!�!�$�Q�'�'�'�
(�(r%c��|�dd��|�dd��|�dd��dS)z�Removed bad AquaTk Button-2 (right) and Paste bindings.

    They prevent context menu access and seem to be gone in AquaTk8.6.
    See issue #24801.
    �Textz<B2>z<B2-Motion>z<<PasteSelection>>N)�unbind_classrIs r �fixb2contextr��sM��	���f�f�%�%�%����f�m�,�,�,����f�2�3�3�3�3�3r%c��t��r@t|��t||��t||��t	|��dSdS)a�
    Perform initial OS X customizations if needed.
    Called from pyshell.main() after initial calls to Tk()

    There are currently three major versions of Tk in use on OS X:
        1. Aqua Cocoa Tk (native default since OS X 10.6)
        2. Aqua Carbon Tk (original native, 32-bit only, deprecated)
        3. X11 (supported by some third-party distributors, deprecated)
    There are various differences among the three that affect IDLE
    behavior, primarily with menus, mouse key events, and accelerators.
    Some one-time customizations are performed here.
    Others are dynamically tested throughout idlelib by calls to the
    isAquaTk(), isCarbonTk(), isCocoaTk(), isXQuartz() functions which
    are initialized here as well.
    N)r&rJr�rDr�)rrAs  r �setupAppr��s\�� �z�z���d������u�%�%�%��D�%�(�(�(��T������	�r%�__main__)�mainzidlelib.idle_test.test_macosxrT)�	verbosity)�__doc__�os.pathrr0�sysrrrr!r&r(r*r,r5r;rDrJr�r�r��__name__�unittestr�r$r%r �<module>r�sJ��������������������������!�!�!�F7�7�7� � � ����!�!�!�������(>�>�>�
�
�
�f(�f(�f(�P4�4�4����.�z����������D�	(�A�6�6�6�6�6�6��r%
© 2025 GrazzMean