Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/twisted/python/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/twisted/python/__pycache__/runtime.cpython-37.pyc

B

:��]H�@s�ddlmZmZddlZddlZddlZddlZddlmZdd�Z	dddddd	�Z
dejiZeGd
d�d��Ze�Z
e
��Ze
jZdS)�)�division�absolute_importN)�	_oldStylecCsdtjdd�S)z?
    Returns the Python version as a dot-separated string.
    z%s.%s.%sN�)�sys�version_info�rr�I/opt/alt/python37/lib64/python3.7/site-packages/twisted/python/runtime.py�shortPythonVersionsr
�win32�posix�java)�ntZcerr
zorg.python.modules.osc@s�eZdZdZe�ej�Ze	e
�eej��Ze
jZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zddd�Zdd�Zdd�Zdd�ZdS)�PlatformzC
    Gives us information about the platform we're running on.
    NcCs8|dk	r&t�|�|_t�|jtj�|_|dk	r4||_dS)N)�knownPlatforms�get�type�_timeFunctions�time�seconds�	_platform)�self�name�platformrrr	�__init__3s
zPlatform.__init__cCs
|jdkS)z�
        Do we know about this platform?

        @return: Boolean indicating whether this is a known platform or not.
        @rtype: C{bool}
        N)r)rrrr	�isKnown;szPlatform.isKnowncCs|jS)zo
        Get platform type.

        @return: Either 'posix', 'win32' or 'java'
        @rtype: C{str}
        )r)rrrr	�getTypeEszPlatform.getTypecCs
|jdkS)z�
        Check if current platform is macOS.

        @return: C{True} if the current platform has been detected as macOS.
        @rtype: C{bool}
        �darwin)r)rrrr	�isMacOSXOszPlatform.isMacOSXcCstjdtdd�|��S)a8
        Are we running in Windows NT?

        This is deprecated and always returns C{True} on win32 because
        Twisted only supports Windows NT-derived platforms at this point.

        @return: C{True} if the current platform has been detected as
            Windows NT.
        @rtype: C{bool}
        zgtwisted.python.runtime.Platform.isWinNT was deprecated in Twisted 13.0. Use Platform.isWindows instead.�)�
stacklevel)�warnings�warn�DeprecationWarning�	isWindows)rrrr	�isWinNTYs
zPlatform.isWinNTcCs|��dkS)z�
        Are we running in Windows?

        @return: C{True} if the current platform has been detected as
            Windows.
        @rtype: C{bool}
        r)r)rrrr	r$kszPlatform.isWindowscCs(ttdd�dk	r t��ddkSdSdS)z�
        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}
        �getwindowsversionNr�F)�getattrrr&)rrrr	�isVistavszPlatform.isVistacCs|j�d�S)z�
        Check if current platform is Linux.

        @return: C{True} if the current platform has been detected as Linux.
        @rtype: C{bool}
        �linux)r�
startswith)rrrr	�isLinux�szPlatform.isLinux�/proc/1/cgroupcCsp|��sdSddlm}||�}|��rldd�|���d�D�}x*|D]"}t|�dkrF|d�d	�rFd
SqFWdS)z�
        Check if the current platform is Linux in a Docker container.

        @return: C{True} if the current platform has been detected as Linux
            inside a Docker container.
        @rtype: C{bool}
        Fr)�FilePathcSsg|]}|�d��qS)�:)�split)�.0�xrrr	�
<listcomp>�sz%Platform.isDocker.<locals>.<listcomp>�
rrs/docker/T)r,Ztwisted.python.filepathr.�existsZ
getContentr0�lenr+)rZ_initCGroupLocationr.ZinitCGroupsZ
controlGroups�grouprrr	�isDocker�s
zPlatform.isDockercCs4|��rdSy
tjWntk
r*dSXdSdS)z�
        Check for symlink support usable for Twisted's purposes.

        @return: C{True} if symlinks are supported on the current platform,
                 otherwise C{False}.
        @rtype: L{bool}
        FTN)r$�os�symlink�AttributeError)rrrr	�_supportsSymlinks�s
zPlatform._supportsSymlinkscCs*yddl}|dk	Stk
r$dSXdS)z�
        Can threads be created?

        @return: C{True} if the threads are supported on the current platform.
        @rtype: C{bool}
        rNF)�	threading�ImportError)rr=rrr	�supportsThreads�s
zPlatform.supportsThreadscCsTyddlm}m}Wntk
r(dSXyt�|��Wn|k
rNdSXdS)zf
        Return C{True} if we can use the inotify API on this platform.

        @since: 10.1
        r)�INotifyError�initFT)Ztwisted.python._inotifyr@rAr>r9�close)rr@rArrr	�supportsINotify�szPlatform.supportsINotify)NN)r-)�__name__�
__module__�__qualname__�__doc__rrr9rr�staticmethodrrrrrrrrrrr%r$r)r,r8r<r?rCrrrr	r)s 






r)�
__future__rrr9rrr!Ztwisted.python._oldstylerr
rrrrrZplatformTyperrrrr	�<module>s"	
=