Sindbad~EG File Manager

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

�

%ΜgJ$���dZddlmZddlZddlmZddlZdad�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zedk(rddlmZedd��yy)z3
A number of functions that enhance IDLE on macOS.
�)�
expanduserN)�platformc�L�tdk(r�ddlm}|rddlm}m}	|d�tj�}|jjdd	�}d
|vrdan+d|vrd
an$d|jjddd�vrdanda|j�yd
ay#|$rdaYywxYw)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     �+/usr/local/lib/python3.12/idlelib/macosx.py�
_init_tk_typer!s����8��
	-��=�
����
�z�z�|��
�W�W�\�\�$� 1�
2���B�;� �H�
�2�
��H�
������g�x��=�
=��H��H��������
��#"�
�"���
�s�B�B#�"B#c�J�ts
t�tdk(xs	tdk(S)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�4�ts
t�tdk(S)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�4�ts
t�tdk(S)z8
    Returns True if IDLE is using a Cocoa Aqua Tk.
    rr#r$r%r �	isCocoaTkr*Ds������w��r%c�4�ts
t�tdk(S)z7
    Returns True if IDLE is using an OS X X11 Tk.
    rr#r$r%r �	isXQuartzr,Ls������y� � r%c��tdk7rytd�}	t|d�5}tj|�cddd�S#1swYyxYw#t
$rYywxYw)z-
    Fetch the macOS system preferences.
    rNz.~/Library/Preferences/.GlobalPreferences.plist�rb)rr�open�plistlib�load�OSError)�
plist_path�
plist_files  r �readSystemPreferencesr5UsT���8����L�M�J��
�*�d�
#�z��=�=��,�$�
#�
#������s-�A�A�	A�A�A�A�	A�Ac�\�tdk7ryt�}|r|jd�dk(r	yy)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;ds:���8���!�#�E�����3�4��@�
>�	
�r%c�4���fd�}|jd|�y)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�6��|D]}�j|��y�N)r/)�args�fn�flists  �r �
doOpenFilez'addOpenEventSupport.<locals>.doOpenFile}s����B��J�J�r�N�r%z::tk::mac::OpenDocumentN)�
createcommand)rrArBs ` r �addOpenEventSupportrDxs���
�	���0�*�=r%c�p�	|jjdd�y#tj$rYywxYw)N�console�hide)rrr�TclError�rs r �
hideTkConsolerJ�s1��
������Y��'�����
��
�s��5�5c������ddlm}ddlm}ddlm�|j
ddd}|j
dddd�=|j
ddj
d	|�|j
d
ddd�=|j
dddd�=|��}�j|��||d
d��}|jd|d��|f�fd�	}�j|�d!�fd�	}d!��fd�	}	d!�fd�	}
�jd|��jd|	��jd|	��r8�jd�j��jd�j�t�r>||dd��}|jd|��|j
j
ddddgf�t�r8�jd|��jd |
�|j
d
dd=yy)"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���|jd�}|�d}|dkDr|jd|��j|�y)N�endrSr)�index�delete�add_windows_to_menu)rUr\rNs  �r �postwindowsmenuz)overrideRootMenu.<locals>.postwindowsmenu�s>����j�j�����;��C���7��K�K��3���"�"�4�(r%c�4��ddlm}|j��y)zHandle Help 'About IDLE' event.r)�
help_aboutN)�idlelibrb�AboutDialog)�eventrbrs  �r �about_dialogz&overrideRootMenu.<locals>.about_dialog�s���	'����t�$r%c�X��ddlm}�j�_|j	�d�y)z&Handle Options 'Configure IDLE' event.r)�configdialog�SettingsN)rcrh�inversedict�
instance_dict�ConfigDialog)rerhrArs  ��r �
config_dialogz'overrideRootMenu.<locals>.config_dialog�s(���	)�#�.�.����!�!�$�
�3r%c�4��ddlm}|j��y)zHandle Help 'IDLE Help' event.r)�helpN)rcro�
show_idlehelp)rerors  �r �help_dialogz%overrideRootMenu.<locals>.help_dialog�s���	!����4� r%�<<about-idle>>z<<open-config-dialog>>z::tk::mac::ShowPreferencesz<<close-all-windows>>z::tk::mac::Quit�apple�IDLE)rYrU�application)z
About IDLErr�
tkAboutDialogz::tk::mac::ShowHelpr>)rrLrcrMrN�menudefs�insert�	configure�add_cascade�register_callback�bindrC�close_all_callbackr(r*)rrArLrM�	closeItem�menubarrUr`rfrmrqrNs``         @r �overrideRootMenur��s���� � ���!�!�!�$�Q�'��+�I�
	���!��Q����$����a����"�"�1�i�0�	���"��a� ��1��%�	���"��a� ��1��%��4�j�G��N�N��N� ���h��2�D����h�T�Q��?�!�)����_�-�%�
4�!�	�I�I���-��I�I�&�
�6����3�]�C���	�	�)�5�+C�+C�D�
	
���,�e�.F�.F�G��|��G�'�1�5�����&�t��4���� � ��
�0���
�	�
�{����?�L�9����0�+�>����b�!�!�$�Q�'�
r%c�p�|jdd�|jdd�|jdd�y)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��s5��	���f�f�%����f�m�,����f�2�3r%c�v�t�r/t|�t||�t||�t	|�yy)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��s2�� �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�s{���������!�F7� ��!���(>�
�d(�L4��.�z����	(�A�6�r%

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