Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/idlelib/__pycache__/macosx.cpython-310.opt-2.pyc

o

0�i�'�@s�	ddlmZddlZddlmZddlZdadd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedkr]ddlmZed d!d"�dSdS)#�)�
expanduserN)�platformcCs�	tdkrVddlm}|r(ddlm}m}z|d�Wn|y'daYdSwt��}|j	�
dd�}d	|vr:d
and|vrAdand
|j	�
ddd�vrNdanda|��dSdadS)N�darwinr)�testing)�requires�ResourceDeniedZgui�cocoa�tkZwindowingsystemZx11�xquartzZaqua�otherZAppKitZwinfoZserver�.�carbon)rZidlelib.__init__rZtest.supportrr�_tk_type�tkinterZTkr	�callZdestroy)rrr�rootZws�r�5/opt/alt/python310/lib64/python3.10/idlelib/macosx.py�
_init_tk_types0��rcCs	tst�tdkp
tdkS)Nrr
�rrrrrr�isAquaTk3srcC�	tst�tdkS)Nr
rrrrr�
isCarbonTk;srcCr)Nrrrrrr�	isCocoaTkD�rcCr)Nr
rrrrr�	isXQuartzLrrcCs0	t�r|j�dd�}|dvrdSd�|�SdS)N�info�
patchlevel)z8.5.7z8.5.9Fz�WARNING: The version of Tcl/Tk ({0}) in use may be unstable.
Visit https://www.python.org/download/mac/tcltk/ for current information.)rr	r�format)rrrrr�tkVersionWarningUs�rcCsh	tdkrdStd�}zt|d��}t�|�Wd�WS1s"wYWdSty3YdSw)Nrz.~/Library/Preferences/.GlobalPreferences.plist�rb)rr�open�plistlib�load�OSError)Z
plist_pathZ
plist_filerrr�readSystemPreferencesjs(��r%cCs0	tdkrdSt�}|r|�d�dkr	dSdS)NrZAppleWindowTabbingMode�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).)rr%�get)Zprefsrrr�preferTabsPreferenceWarningys�r(cs	�fdd�}|�d|�dS)Ncs|D]}��|�qdS�N)r!)�args�fn��flistrr�
doOpenFile�s�z'addOpenEventSupport.<locals>.doOpenFilez::tk::mac::OpenDocument)�
createcommand)rr-r.rr,r�addOpenEventSupport�sr0cCs,z
|j�dd�WdStjyYdSw)NZconsoleZhide)r	rrZTclError�rrrr�
hideTkConsole�s
�r2cs�	ddlm}ddlm}ddlm�|jddd}|jdddd�=|jdd�d|�|jd	ddd
�=|jdddd
�=|��}�j|d�i}||ddd
�|d<}|jd|dd�|f�fdd�	}��	|�d$�fdd�	}	d$��fdd�	}
d$�fdd�	}��
d|	���
d|
���d|
��r���
d�j���d�j�t
�r�||ddd
�|d<}|jd|d �|j�ddd!dgf�t�r��d"|	���d#|�|jd	dd=dSdS)%Nr)�Menu)�mainmenu��window������������)�menur6)�nameZtearoffZWindow)�labelr=Z	underlinecs8|�d�}|durd}|dkr|�d|���|�dS)N�endr;r)�index�deleteZadd_windows_to_menu)r=r@r5rr�postwindowsmenu�s
z)overrideRootMenu.<locals>.postwindowsmenuc�	ddlm}|���dS)Nr)�
help_about)�idlelibrEZAboutDialog)�eventrEr1rr�about_dialog��z&overrideRootMenu.<locals>.about_dialogcs&	ddlm}�j�_|��d�dS)Nr)�configdialogZSettings)rFrJZinversedictZ
instance_dictZConfigDialog)rGrJ)r-rrr�
config_dialog�sz'overrideRootMenu.<locals>.config_dialogcrD)Nr)�help)rFrLZ
show_idlehelp)rGrLr1rr�help_dialog�rIz%overrideRootMenu.<locals>.help_dialog�<<about-idle>>z<<open-config-dialog>>z::tk::mac::ShowPreferencesz<<close-all-windows>>�exitZappleZapplicationZIDLE)r?r=)z
About IDLErNZ
tkAboutDialogz::tk::mac::ShowHelpr))rr3rFr4r6Zmenudefs�insertZ	configureZadd_cascadeZregister_callbackZbindr/Zclose_all_callbackrr)rr-r3r4Z	closeItemZmenubarZmenudictr=rCrHrKrMr)r-rr6r�overrideRootMenu�sR
����rQcCs*	|�dd�|�dd�|�dd�dS)NZTextz<B2>z<B2-Motion>z<<PasteSelection>>)Zunbind_classr1rrr�fixb2context
srRcCs4	t�rt|�t||�t||�t|�dSdSr))rr2rQr0rR)rr-rrr�setupApps

�rS�__main__)�mainzidlelib.idle_test.test_macosxr<)�	verbosity)Zos.pathrr"�sysrrrrrrrrrr%r(r0r2rQrRrS�__name__ZunittestrUrrrr�<module>s.#		h
�