Hacked By AnonymousFox

Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/macosx.cpython-36.pyc

3

� f�%�@s�dZddlmZddlZddlmZddlZdadd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedkr�dd lmZed!d"d#�dS)$z3
A number of functions that enhance IDLE on macOS.
�)�
expanduserN)�platformcCsjtdkrbtj�}|jjdd�}d|kr,dan,d|kr:dand|jjd	d
d�krTdand
a|j�ndadS)zl
    Initializes OS X Tk variant values for
    isAquaTk(), isCarbonTk(), isCocoaTk(), and isXQuartz().
    �darwin�tkZwindowingsystemZx11�xquartzZaqua�otherZAppKitZwinfoZserver�.�cocoa�carbonN)r�tkinterZTkr�call�_tk_typeZdestroy)�rootZws�r�3/opt/alt/python36/lib64/python3.6/idlelib/macosx.py�
_init_tk_types
rcCsts
t�tdkptdkS)zK
    Returns True if IDLE is using a native OS X Tk (Cocoa or Carbon).
    r	r
)r
rrrrr�isAquaTk%srcCsts
t�tdkS)zb
    Returns True if IDLE is using a Carbon Aqua Tk (instead of the
    newer Cocoa Aqua Tk).
    r
)r
rrrrr�
isCarbonTk-srcCsts
t�tdkS)z8
    Returns True if IDLE is using a Cocoa Aqua Tk.
    r	)r
rrrrr�	isCocoaTk6srcCsts
t�tdkS)z7
    Returns True if IDLE is using an OS X X11 Tk.
    r)r
rrrrr�	isXQuartz>srcCs2t�r*|jjdd�}|dkr dSdj|�SdSdS)	a2
    Returns a string warning message if the Tk version in use appears to
    be one known to cause problems with IDLE.
    1. Apple Cocoa-based Tk 8.5.7 shipped with Mac OS X 10.6 is unusable.
    2. Apple Cocoa-based Tk 8.5.9 in OS X 10.7 and 10.8 is better but
        can still crash unexpectedly.
    �info�
patchlevel�8.5.7�8.5.9Fz�WARNING: The version of Tcl/Tk ({0}) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.N)rr)rrr�format)rrrrr�tkVersionWarningGs	rcCsNtdkrdStd�}y t|d��}tj|�SQRXWntk
rHdSXdS)z-
    Fetch the macOS system preferences.
    rNz.~/Library/Preferences/.GlobalPreferences.plist�rb)rr�open�plistlib�load�OSError)Z
plist_pathZ
plist_filerrr�readSystemPreferences\sr!cCs,tdkrdSt�}|r(|jd�dkr(dSdS)zJ
    Warn if "Prefer tabs when opening documents" is set to "Always".
    rNZAppleWindowTabbingMode�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�preferTabsPreferenceWarningksr$cs�fdd�}|jd|�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.
    csx|D]}�j|�qWdS)N)r)�args�fn)�flistrr�
doOpenFile�s
z'addOpenEventSupport.<locals>.doOpenFilez::tk::mac::OpenDocumentN)�
createcommand)rr'r(r)r'r�addOpenEventSupportsr*cCs.y|jjdd�Wntjk
r(YnXdS)NZconsoleZhide)rrrZTclError)rrrr�
hideTkConsole�sr+cs�ddlm}ddlm}ddlm�|jddd#}|jddd$d�=|jddjd	|�|jd%ddd�=|jd&dd=|��}�j|d
�i}||ddd�|d<}|jd
|dd�|f�fdd�	}�j	|�d'�fdd�	}	d(��fdd�	}
d)�fdd�	}�j
d|	��j
d|
��jd|
���rN�j
d�j��jd�j�t
��r�||ddd�|d<}|jd|d�|jjddd*dgf�t��r��jd!|	��jd"|�|jd+dd=dS),zf
    Replace the Tk root menu by something that is more appropriate for
    IDLE with an Aqua Tk.
    r)�Menu)�mainmenu)�window���N�)�menur.)�nameZtearoffZWindow)�labelr3Z	underlinecs8|jd�}|dkrd}|dkr*|jd|��j|�dS)N�endr/r���)�index�deleteZadd_windows_to_menu)r3r6)r.rr�postwindowsmenu�s
z)overrideRootMenu.<locals>.postwindowsmenucsddlm}|j��dS)zHandle Help 'About IDLE' event.r)�
help_aboutN)�idlelibr;ZAboutDialog)�eventr;)rrr�about_dialog�sz&overrideRootMenu.<locals>.about_dialogcs$ddlm}�j�_|j�d�dS)z&Handle Options 'Configure IDLE' event.r)�configdialogZSettingsN)r<r?ZinversedictZ
instance_dictZConfigDialog)r=r?)r'rrr�
config_dialog�sz'overrideRootMenu.<locals>.config_dialogcsddlm}|j��dS)zHandle Help 'IDLE Help' event.r)�helpN)r<rAZ
show_idlehelp)r=rA)rrr�help_dialog�sz%overrideRootMenu.<locals>.help_dialog�<<about-idle>>z<<open-config-dialog>>z::tk::mac::ShowPreferencesz<<close-all-windows>>�exitZappleZapplicationZIDLE)r5r3�
About IDLEZ
tkAboutDialogz::tk::mac::ShowHelp������r7rF)N)N)N)rErCr7)rr,r<r-r.Zmenudefs�insertZ	configureZadd_cascadeZregister_callbackZbindr)Zclose_all_callbackrr)rr'r,r-Z	closeItemZmenubarZmenudictr3r:r>r@rBr)r'rr.r�overrideRootMenu�sH

rIcCs(|jdd�|jdd�|jdd�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.
    ZTextz<B2>z<B2-Motion>z<<PasteSelection>>N)Zunbind_class)rrrr�fixb2context�srJcCs.t�r*t|�t||�t||�t|�dS)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)rr+rIr*rJ)rr'rrr�setupApps


rK�__main__)�mainzidlelib.idle_test.test_macosxr0)�	verbosity)�__doc__Zos.pathrr�sysrrr
rrrrrrr!r$r*r+rIrJrK�__name__ZunittestrMrrrr�<module>s*		h


Hacked By AnonymousFox1.0, Coded By AnonymousFox