ó
[³XMc           @   s§   d  d l  Z  d  d l Z d  d l Z d  d l Z d „  Z i d d 6d d 6d d 6d d 6d d 6Z i e j d 6Z d	 d d
 „  ƒ  YZ e ƒ  Z e j	 ƒ  Z
 e j Z d S(   iÿÿÿÿNc          C   sD   t  j }  |  d @d ?} |  d @d ?} |  d @d ?} d | | | f S(   Nl      ~ i   l     þi   l     i   s   %s.%s.%s(   t   syst
   hexversion(   t   hvt   majort   minort   teeny(    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   shortPythonVersion   s
    	t   win32t   ntt   cet   posixt   javas   org.python.modules.ost   Platformc           B   s   e  Z d  Z e j e j ƒ Z e e	 j e e
 j
 ƒ ƒ Z d
 d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z RS(   s8   Gives us information about the platform we're running onc         C   s@   | d  k	 r< t j | ƒ |  _ t j |  j t j ƒ |  _ n  d  S(   N(   t   Nonet   knownPlatformst   gett   typet   _timeFunctionst   timet   seconds(   t   selft   name(    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   __init__'   s    c         C   s   |  j  d k S(   s   Do we know about this platform?N(   R   R   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   isKnown,   s    c         C   s   |  j  S(   s!   Return 'posix', 'win32' or 'java'(   R   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   getType0   s    c         C   s   t  j d k S(   s$   Return if we are runnng on Mac OS X.t   darwin(   R    t   platform(   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   isMacOSX4   s    c         C   sg   |  j  ƒ  d k rc d d l } y- | j | j d ƒ } | j | d ƒ d SWqc t k
 r_ d SXn  d S(   s   Are we running in Windows NT?R   iÿÿÿÿNs,   Software\Microsoft\Windows NT\CurrentVersiont
   SystemRooti   i    (   R   t   _winregt	   OpenKeyExt   HKEY_LOCAL_MACHINEt   QueryValueExt   WindowsError(   R   R   t   k(    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   isWinNT8   s    	c         C   s   |  j  ƒ  d k S(   NR   (   R   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt	   isWindowsF   s    c         C   s4   t  t d d ƒ d k	 r, t j ƒ  d d k St Sd S(   s¹   
        Check if current platform is Windows Vista or Windows Server 2008.

        @return: C{True} if the current platform has been detected as Vista
        @rtype: C{bool}
        t   getwindowsversioni    i   N(   t   getattrR    R   R%   t   False(   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   isVistaJ   s    c         C   s4   y t  j d ƒ d d k SWn t k
 r/ t SXd S(   s    Can threads be created?
        t   threadi    N(   t   impt   find_moduleR   t   ImportErrorR'   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   supportsThreadsW   s    c         C   s\   y d d l  m } m } Wn t k
 r. t SXy t j | ƒ  ƒ Wn | k
 rW t SXt S(   sf   
        Return C{True} if we can use the inotify API on this platform.

        @since: 10.1
        iÿÿÿÿ(   t   INotifyErrort   init(   t   twisted.python._inotifyR.   R/   R,   R'   t   ost   closet   True(   R   R.   R/   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   supportsINotify`   s    N(   t   __name__t
   __module__t   __doc__R   R   R1   R   R   t   staticmethodR   R   R   R   R   R   R   R   R#   R$   R(   R-   R4   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyR   !   s   								(    (   R1   R    R   R*   R   R   R   R   R   R   t   platformTypeR   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/python/runtime.pyt   <module>   s    	
P	