HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/runtime.cpython-38.pyc
U

�b$�@s|dddddgZddlZddlZddlZddlmZddlmZed	�d
d�Z	dddd
d
d�Z
Gdd�d�Ze�Ze�
�ZdS)�seconds�shortPythonVersion�Platform�platform�platformType�N)�time)�Optional��returncCsdtjdd�S)z?
    Returns the Python version as a dot-separated string.
    z%s.%s.%sN�)�sys�version_info�rr�8/usr/lib/python3/dist-packages/twisted/python/runtime.pyrs�win32�posix�java)�ntZcerrzorg.python.modules.osc@s�eZdZUdZe�ej�Ze	e
ed<ee
�Z
ejZd e	e
e	e
dd�dd�Zed�dd	�Ze	e
d�d
d�Zed�dd
�Zed�dd�Zed�dd�Zed�dd�Zed�dd�Zd!e
ed�dd�Zed�dd�Zed�dd�Zed�dd�ZdS)"rzC
    Gives us information about the platform we're running on.
    �typeN)�namerr
cCs&|dk	rt�|�|_|dk	r"||_dS)N)�knownPlatforms�getr�	_platform)�selfrrrrr�__init__,szPlatform.__init__r	cCs
|jdkS)z
        Do we know about this platform?

        @return: Boolean indicating whether this is a known platform or not.
        N�r�rrrr�isKnown4szPlatform.isKnowncCs|jS)zX
        Get platform type.

        @return: Either 'posix', 'win32' or 'java'
        rrrrr�getType<szPlatform.getTypecCs
|jdkS)z�
        Check if current platform is macOS.

        @return: C{True} if the current platform has been detected as macOS.
        �darwin)rrrrr�isMacOSXDszPlatform.isMacOSXcCstjdtdd�|��S)a 
        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.
        zgtwisted.python.runtime.Platform.isWinNT was deprecated in Twisted 13.0. Use Platform.isWindows instead.�)�
stacklevel)�warnings�warn�DeprecationWarning�	isWindowsrrrr�isWinNTLs
�zPlatform.isWinNTcCs|��dkS)z�
        Are we running in Windows?

        @return: C{True} if the current platform has been detected as
            Windows.
        r)rrrrrr&^szPlatform.isWindowscCstjdkot��jdkS)z�
        Check if current platform is Windows Vista or Windows Server 2008.

        @return: C{True} if the current platform has been detected as Vista
        r�)rrZgetwindowsversion�majorrrrr�isVistagszPlatform.isVistacCs|j�d�S)z�
        Check if current platform is Linux.

        @return: C{True} if the current platform has been detected as Linux.
        Zlinux)r�
startswithrrrr�isLinuxoszPlatform.isLinux�/proc/1/cgroup)�_initCGroupLocationr
cCsn|��sdSddlm}||�}|��rjdd�|���d�D�}|D]$}t|�dkrD|d�d	�rDd
SqDdS)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.
        Fr)�FilePathcSsg|]}|�d��qS)�:)�split)�.0�xrrr�
<listcomp>�sz%Platform.isDocker.<locals>.<listcomp>�
rr!s/docker/T)r,Ztwisted.python.filepathr/�existsZ
getContentr1�lenr+)rr.r/ZinitCGroupsZ
controlGroups�grouprrr�isDockerws�zPlatform.isDockercCs6|��rdSz
tjWntk
r,YdSXdSdS)z�
        Check for symlink support usable for Twisted's purposes.

        @return: C{True} if symlinks are supported on the current platform,
                 otherwise C{False}.
        FTN)r&�os�symlink�AttributeErrorrrrr�_supportsSymlinks�s
zPlatform._supportsSymlinkscCs.zddl}|dk	WStk
r(YdSXdS)zy
        Can threads be created?

        @return: C{True} if the threads are supported on the current platform.
        rNF)�	threading�ImportError)rr>rrr�supportsThreads�s

zPlatform.supportsThreadscCsXzddlm}m}Wntk
r*YdSXzt�|��Wn|k
rRYdSXdS)zf
        Return C{True} if we can use the inotify API on this platform.

        @since: 10.1
        r)�INotifyError�initFT)Ztwisted.python._inotifyrArBr?r:�close)rrArBrrr�supportsINotify�szPlatform.supportsINotify)NN)r-)�__name__�
__module__�__qualname__�__doc__rrr:rrr�str�__annotations__�staticmethodrrrrr�boolrrr r'r&r*r,r9r=r@rDrrrrr#s,
��	
)�__all__r:rr#rr�typingrrIrrrrrrrrrr�<module>s*��	)