HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/runtime.cpython-38.pyc
U


W[~�@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�8/usr/lib/python3/dist-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}
        rrrrr	�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)rrrrr	�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�	isWindowsrrrr	�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)rrrrr	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}
        Zlinux)r�
startswithrrrr	�isLinux�szPlatform.isLinux�/proc/1/cgroupcCsn|��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.
        @rtype: C{bool}
        Fr)�FilePathcSsg|]}|�d��qS)�:)�split)�.0�xrrr	�
<listcomp>�s�z%Platform.isDocker.<locals>.<listcomp>�
rr!s/docker/T)r-Ztwisted.python.filepathr/�existsZ
getContentr1�lenr,)rZ_initCGroupLocationr/ZinitCGroupsZ
controlGroups�grouprrr	�isDocker�s�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}.
        @rtype: L{bool}
        FTN)r&�os�symlink�AttributeErrorrrrr	�_supportsSymlinks�s
zPlatform._supportsSymlinkscCs.zddl}|dk	WStk
r(YdSXdS)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.supportsThreadscCsdzddlm}m}Wntk
r*YdSX|��r8dSzt�|��Wn|k
r^YdSXdS)zf
        Return C{True} if we can use the inotify API on this platform.

        @since: 10.1
        r)�INotifyError�initFT)Ztwisted.python._inotifyrArBr?r9r:�close)rrArBrrr	�supportsINotify�szPlatform.supportsINotify)NN)r.)�__name__�
__module__�__qualname__�__doc__rrr:rr�staticmethodrrrrrrrrrr r'r&r+r-r9r=r@rDrrrr	r)s 






r)Z
__future__rrr:rrr#Ztwisted.python._oldstylerr
rrrrrZplatformTyperrrrr	�<module>s*	��?