Ë
    oj$  ã                   óš   — g d ¢Z ddlZddlZddlZddlmZ ddlmZ defd„Z	dddd	d	d
œZ
 G d„ d«      Z e«       Zej                  «       Zy))ÚsecondsÚshortPythonVersionÚPlatformÚplatformÚplatformTypeé    N)Útime)ÚOptionalÚreturnc                  ó.   — dt         j                  dd z  S )z?
    Returns the Python version as a dot-separated string.
    z%s.%s.%sNé   )ÚsysÚversion_info© ó    ú8/usr/lib/python3/dist-packages/twisted/python/runtime.pyr   r      s   € ð œ×(Ñ(¨¨!Ð,Ñ,Ð,r   Úwin32ÚposixÚjava)ÚntÚcer   r   zorg.python.modules.osc                   ó4  — e Zd ZU dZej                  ej                  «      Ze	e
   ed<    ee«      Zej                  Z	 dde	e
   de	e
   ddfd„Zdefd„Zde	e
   fd	„Zdefd
„Zdefd„Zdefd„Zdefd„Zdefd„Zdde
defd„Zdefd„Zdefd„Zdefd„Zy)r   zC
    Gives us information about the platform we're running on.
    ÚtypeNÚnamer   r
   c                 óP   — |�t         j                  |«      | _        |�|| _        y y )N)ÚknownPlatformsÚgetr   Ú	_platform)Úselfr   r   s      r   Ú__init__zPlatform.__init__,   s.   € ð ÐÜ&×*Ñ*¨4Ó0ˆDŒIØÐØ%ˆD�Nð  r   c                 ó    — | j                   dk7  S )z
        Do we know about this platform?

        @return: Boolean indicating whether this is a known platform or not.
        N©r   ©r   s    r   ÚisKnownzPlatform.isKnown4   s   € ð �y‰y˜DÑ Ð r   c                 ó   — | j                   S )zX
        Get platform type.

        @return: Either 'posix', 'win32' or 'java'
        r!   r"   s    r   ÚgetTypezPlatform.getType<   s   € ð �y‰yÐr   c                 ó    — | j                   dk(  S )zƒ
        Check if current platform is macOS.

        @return: C{True} if the current platform has been detected as macOS.
        Údarwin)r   r"   s    r   ÚisMacOSXzPlatform.isMacOSXD   s   € ð �~‰~ Ñ)Ð)r   c                 óZ   — t        j                  dt        d¬«       | j                  «       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Ú	isWindowsr"   s    r   ÚisWinNTzPlatform.isWinNTL   s*   € ô 	�‰ð<äØõ		
ð �~‰~ÓÐr   c                 ó(   — | j                  «       dk(  S )zˆ
        Are we running in Windows?

        @return: C{True} if the current platform has been detected as
            Windows.
        r   )r%   r"   s    r   r/   zPlatform.isWindows^   s   € ð �|‰|‹~ Ñ(Ð(r   c                 ón   — t         j                  dk(  xr! t        j                  «       j                  dk(  S )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   r   ÚgetwindowsversionÚmajorr"   s    r   ÚisVistazPlatform.isVistag   s,   € ô �|‰|˜wÑ&ÒM¬3×+@Ñ+@Ó+B×+HÑ+HÈAÑ+MÐMr   c                 ó8   — | j                   j                  d«      S )zƒ
        Check if current platform is Linux.

        @return: C{True} if the current platform has been detected as Linux.
        Úlinux)r   Ú
startswithr"   s    r   ÚisLinuxzPlatform.isLinuxo   s   € ð �~‰~×(Ñ(¨Ó1Ð1r   Ú_initCGroupLocationc                 ó:  — | j                  «       syddlm}  ||«      }|j                  «       rg|j	                  «       j                  d«      D �cg c]  }|j                  d«      ‘Œ }}|D ]'  }t        |«      dk(  sŒ|d   j                  d«      sŒ' y	 yc c}w )
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   )ÚFilePathó   
ó   :r   r*   s   /docker/T)r:   Útwisted.python.filepathr=   ÚexistsÚ
getContentÚsplitÚlenr9   )r   r;   r=   ÚinitCGroupsÚxÚcontrolGroupsÚgroups          r   ÚisDockerzPlatform.isDockerw   sž   € ð �|‰|Œ~Øå4ñ Ð2Ó3ˆØ×ÑÔð (3×'=Ñ'=Ó'?×'EÑ'EÀeÓ'LöØ"#�—‘˜•ðˆMð ð 'ò  �Ü�u“: “? u¨Q¡x×':Ñ':¸;Õ'Gáð ð
 ùòs   ÁBc                 óf   — | j                  «       ry	 t        j                   y# t        $ r Y yw xY w)z¼
        Check for symlink support usable for Twisted's purposes.

        @return: C{True} if symlinks are supported on the current platform,
                 otherwise C{False}.
        FT)r/   ÚosÚsymlinkÚAttributeErrorr"   s    r   Ú_supportsSymlinkszPlatform._supportsSymlinks“   s8   € ð �>‰>Ôð ðÜ—
’
ð øô "ò Ùðús   “$ ¤	0¯0c                 ó2   — 	 ddl }|duS # t        $ r Y yw xY w)zy
        Can threads be created?

        @return: C{True} if the threads are supported on the current platform.
        r   NF)Ú	threadingÚImportError)r   rP   s     r   ÚsupportsThreadszPlatform.supportsThreads¬   s'   € ð	Ûà DÐ(Ð(øÜò 	Ùð	ús   ‚
 Š	•c                 ó€   — 	 ddl m}m} 	 t	        j
                   |«       «       y# t        $ r Y yw xY w# |$ r Y yw xY w)zf
        Return C{True} if we can use the inotify API on this platform.

        @since: 10.1
        r   )ÚINotifyErrorÚinitFT)Útwisted.python._inotifyrT   rU   rQ   rK   Úclose)r   rT   rU   s      r   ÚsupportsINotifyzPlatform.supportsINotify¹   sI   € ð	ßBð	Ü�H‰H‘T“VÔð øô ò 	Ùð	ûð
 ò 	Ùð	ús   ‚& ‹5 ¦	2±2µ=¼=)NN)z/proc/1/cgroup)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   rK   r   r   r	   ÚstrÚ__annotations__Ústaticmethodr   r   r   r   r   Úboolr#   r%   r(   r0   r/   r6   r:   rI   rN   rR   rX   r   r   r   r   r   #   sö   … ñð )×,Ñ,¨R¯W©WÓ5€Dˆ(�3‰-Ó5Ù˜7Ó#€GØ—‘€Ið EIñ&Ø˜S‘Mð&Ø4<¸S±Mð&à	ó&ð!˜ó !ð˜ #™ó ð*˜$ó *ð ˜ó  ð$)˜4ó )ðN˜ó Nð2˜ó 2ñ¨Cð Àtó ð8 4ó ð2 ó ð ô r   r   )Ú__all__rK   r   r,   r   r   Útypingr	   r]   r   r   r   r   r%   r   r   r   r   ú<module>rc      se   ðò
€ó 
Û 
Û Ý  Ý ð-˜Có -ð Ø
ØØØ#ñ€÷eñ eñP ‹:€Ø×ÑÓ!�r   