???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
{fc           @   s°   d  Z  d d l Z d d l Z d d l m Z d d l Z d   Z d   Z d a	 d   Z
 d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d S(   s5   
A number of functions that enhance IDLE on Mac OSX.
i˙˙˙˙N(   t   pathc           C   s   t  j d t d d t   S(   Ns/   runningAsOSXApp() is deprecated, use isAquaTk()t
   stackleveli   (   t   warningst   warnt   DeprecationWarningt   isAquaTk(    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   runningAsOSXApp   s    	c         C   s   t  j d t d d t   S(   Ns4   isCarbonAquaTk(root) is deprecated, use isCarbonTk()R   i   (   R   R   R   t
   isCarbonTk(   t   root(    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   isCarbonAquaTk   s    	c         C   s   t  j d k r~ |  j j d d  } d | k r9 d a q d | k rN d a q d |  j j d	 d
 d  k ru d a q d a n d a d S(   sl   
    Initializes OS X Tk variant values for
    isAquaTk(), isCarbonTk(), isCocoaTk(), and isXQuartz().
    t   darwint   tkt   windowingsystemt   x11t   xquartzt   aquat   othert   AppKitt   winfot   servert   .t   cocoat   carbonN(   t   syst   platformR   t   callt   _tk_type(   R   t   ws(    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   _initializeTkVariantTests   s    				c           C   s   t  d k p t  d k S(   sK   
    Returns True if IDLE is using a native OS X Tk (Cocoa or Carbon).
    R   R   (   R   (    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyR   *   s    c           C   s
   t  d k S(   sb   
    Returns True if IDLE is using a Carbon Aqua Tk (instead of the
    newer Cocoa Aqua Tk).
    R   (   R   (    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyR   1   s    c           C   s
   t  d k S(   s8   
    Returns True if IDLE is using a Cocoa Aqua Tk.
    R   (   R   (    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt	   isCocoaTk9   s    c           C   s
   t  d k S(   s7   
    Returns True if IDLE is using an OS X X11 Tk.
    R   (   R   (    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt	   isXQuartz@   s    c         C   sC   t    r; |  j j d d  } | d k r. t Sd j |  St Sd S(   s2  
    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.
    t   infot
   patchlevels   8.5.7s   8.5.9s   WARNING: The version of Tcl/Tk ({0}) in use may be unstable.\nVisit http://www.python.org/download/mac/tcltk/ for current information.N(   s   8.5.7s   8.5.9(   R   R   R   t   Falset   format(   R   R    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   tkVersionWarningG   s    		c            s#     f d   } |  j  d |  d S(   s˘   
    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             s"   x |  D] }   j  |  q Wd  S(   N(   t   open(   t   argst   fn(   t   flist(    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt
   doOpenFile`   s    s   ::tk::mac::OpenDocumentN(   t   createcommand(   R   R'   R(   (    (   R'   s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   addOpenEventSupport[   s    c         C   s2   y |  j  j d d  Wn t j k
 r- n Xd  S(   Nt   consolet   hide(   R   R   t   Tkintert   TclError(   R   (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   hideTkConsolei   s    c            s˘  d d l  m } d d l m } d d l m   | j d d d } | j d d d 3| j d d j d	 |  | j d d d d
 5| j d d d =|   }  j d |  i  } | | d d d d | d <} | j d d d | d d  |   f d  }   j	 |  d'  f d  }	 d'   f d  }
 d'  f d  }  j d |	   j d |
   j d |
   rŽ j d  j   j d  j  n  t   r`| | d d d d | d <} | j d d d |  | j j d d d( d' g f   j j d  } t t t | j d     d) k  r`| j d d j d*  q`n  t   r j d% |	   j d& |  | j d d d =n  d' S(+   sf   
    Replace the Tk root menu by something that is more appropriate for
    IDLE with an Aqua Tk.
    i˙˙˙˙(   t   Menu(   t   Bindings(   t
   WindowListi    i   iţ˙˙˙iý˙˙˙i   i   t   menut   namet   windowst   tearofft   labelt   Windowt	   underlinec            sT   |  j  d  } | d  k r$ d } n  | d k rC |  j d |  n    j |   d  S(   Nt   endi˙˙˙˙i    (   t   indext   Nonet   deletet   add_windows_to_menu(   R3   R:   (   R2   (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   postwindowsmenu   s    	c            s$   d d l  m } | j   d  d S(   s   Handle Help 'About IDLE' event.i˙˙˙˙(   t   aboutDialogs
   About IDLEN(   t   idlelibR@   t   AboutDialog(   t   eventR@   (   R   (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   about_dialogŁ   s    c            s0   d d l  m }   j  _ | j  d  d S(   s&   Handle Options 'Configure IDLE' event.i˙˙˙˙(   t   configDialogt   SettingsN(   RA   RE   t   inversedictt   instance_dictt   ConfigDialog(   RC   RE   (   R'   R   (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   config_dialogŠ   s    c            s!   d d l  m } | j    d S(   s   Handle Help 'IDLE Help' event.i˙˙˙˙(   t   helpN(   RA   RK   t   show_idlehelp(   RC   RK   (   R   (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   help_dialog°   s    s   <<about-idle>>s   <<open-config-dialog>>s   ::tk::mac::ShowPreferencess   <<close-all-windows>>t   exitt   applet   applicationt   IDLEs
   About IDLEs   info patchlevelR   i   i   i   s   _Preferences....t   tkAboutDialogs   ::tk::mac::ShowHelpN(   s
   About IDLEs   <<about-idle>>(   i   i   i   (   s   _Preferences....s   <<open-config-dialog>>(   R-   R0   RA   R1   R2   t   menudefst   insertt	   configuret   add_cascadet   register_callbackR<   t   bindR)   t   close_all_callbackR   R   t   evalt   tuplet   mapt   intt   splitt   appendR   (   R   R'   R0   R1   t	   closeItemt   menubart   menudictR3   R?   RD   RJ   RM   t	   tkversion(    (   R2   R'   R   s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   overrideRootMenup   sP     	$	c         C   s>   t  |   t   r: t |   t |  |  t |  |  n  d S(   sě  
    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   R   R/   Rd   R*   (   R   R'   (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   setupAppŮ   s
    
	
(   t   __doc__R   R-   t   osR    R   R   R	   R<   R   R   R   R   R   R   R#   R*   R/   Rd   Re   (    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   <module>   s"   											i