MINI MINI MANI MO
ó
Eì]c           @   s}   d  Z  d d l Z d d l Z d d l m Z d a d „  Z d a d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z
 d
 „  Z d S(   s   
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
iÿÿÿÿN(   t   pathc           C   s1   t  d k r- t j d k o' d t j k a  n  t  S(   s›   
    Returns True if Python is running from within an app on OSX.
    If so, assume that Python was built with Aqua Tcl/Tk rather than
    X11 Tcl/Tk.
    t   darwins   .appN(   t
   _appbundlet   Nonet   syst   platformt
   executable(    (    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   runningAsOSXApp   s    !c         C   sU   t  d k rQ t ƒ  oK d |  j j d d ƒ k oK d |  j j d d d ƒ k a  n  t  S(	   sb   
    Returns True if IDLE is using a Carbon Aqua Tk (instead of the
    newer Cocoa Aqua Tk).
    t   aquat   tkt   windowingsystemt   AppKitt   winfot   servert   .N(   t
   _carbonaquatkR   R   R	   t   call(   t   root(    (    s-   /usr/lib64/python2.7/idlelib/macosxSupport.pyt   isCarbonAquaTk   s
    	!c         C   sa   t  ƒ  rY d |  j j d d d ƒ k rY |  j j d d ƒ } | d k rL 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.
    R   R   R
   R   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   tkVersionWarning%   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"