
    h$                         / S Qr SSKrSSKrSSKrSSKJr  SSKJr  S\4S jr	SSSS	S	S
.r
 " S S5      r\" 5       r\R                  5       rg))secondsshortPythonVersionPlatformplatformplatformType    N)time)Optionalreturnc                  .    S[         R                  SS -  $ )z7
Returns the Python version as a dot-separated string.
z%s.%s.%sN   )sysversion_info     ]/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/python/runtime.pyr   r      s     ((!,,,r   win32posixjava)ntcer   r   zorg.python.modules.osc                   X   \ rS rSr% Sr\R                  \R                  5      r	\
\   \S'   \" \5      r\R                   r SS\
\   S\
\   SS4S jjrS\4S	 jrS\
\   4S
 jrS\4S jrS\4S jrS\4S jrS\4S jrS\4S jrSS\S\4S jjrS\4S jrS\4S jrS\4S jrSrg)r   #   z;
Gives us information about the platform we're running on.
typeNnamer   r
   c                 R    Ub  [         R                  U5      U l        Ub  X l        g g )N)knownPlatformsgetr   	_platform)selfr   r   s      r   __init__Platform.__init__,   s,     &**40DI%N  r   c                      U R                   S:g  $ )zg
Do we know about this platform?

@return: Boolean indicating whether this is a known platform or not.
Nr   r   s    r   isKnownPlatform.isKnown4   s     yyD  r   c                     U R                   $ )z@
Get platform type.

@return: Either 'posix', 'win32' or 'java'
r#   r$   s    r   getTypePlatform.getType<   s     yyr   c                      U R                   S:H  $ )zk
Check if current platform is macOS.

@return: C{True} if the current platform has been detected as macOS.
darwin)r   r$   s    r   isMacOSXPlatform.isMacOSXD   s     ~~))r   c                 V    [         R                  " S[        SS9  U R                  5       $ )z
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   isWinNTPlatform.isWinNTL   s*     	<		
 ~~r   c                 (    U R                  5       S:H  $ )zh
Are we running in Windows?

@return: C{True} if the current platform has been detected as
    Windows.
r   )r(   r$   s    r   r4   Platform.isWindows^   s     ||~((r   c                 z    [         R                  S:H  =(       a"    [         R                  " 5       R                  S:H  $ )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   isVistaPlatform.isVistag   s,     ||w&M3+@+@+B+H+HA+MMr   c                 8    U R                   R                  S5      $ )zk
Check if current platform is Linux.

@return: C{True} if the current platform has been detected as Linux.
linux)r   
startswithr$   s    r   isLinuxPlatform.isLinuxo   s     ~~((11r   _initCGroupLocationc                 d   U R                  5       (       d  gSSKJn  U" U5      nUR                  5       (       ar  UR	                  5       R                  S5       Vs/ s H  oDR                  S5      PM     nnU H/  n[        U5      S:X  d  M  US   R                  S5      (       d  M/    g	   gs  snf )
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)rB   twisted.python.filepathrF   exists
getContentsplitlenrA   )r   rD   rF   initCGroupsxcontrolGroupsgroups          r   isDockerPlatform.isDockerw   s     ||~~4 23 (3'='='?'E'Ee'L'L!'L   'u:?uQx':':;'G'G '
 s   B-c                 r    U R                  5       (       a  g [        R                    g! [         a     gf = f)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)r4   ossymlinkAttributeErrorr$   s    r   _supportsSymlinksPlatform._supportsSymlinks   s;     >> 

  " s   ) 
66c                 4     SSK nUSL$ ! [         a     gf = f)za
Can threads be created?

@return: C{True} if the threads are supported on the current platform.
r   NF)	threadingImportError)r   r[   s     r   supportsThreadsPlatform.supportsThreads   s'    	D(( 		s   
 
c                      SSK JnJn   [        R
                  " U" 5       5        g! [         a     gf = f! U a     gf = f)zN
Return C{True} if we can use the inotify API on this platform.

@since: 10.1
r   )INotifyErrorinitFT)twisted.python._inotifyr`   ra   r\   rU   close)r   r`   ra   s      r   supportsINotifyPlatform.supportsINotify   sI    	B	HHTV   		
  		s   ' 7 
44A A )r   r   )NN)z/proc/1/cgroup) __name__
__module____qualname____firstlineno____doc__r   r   rU   r   r   r	   str__annotations__staticmethodr   r   r   r   r    boolr%   r(   r,   r5   r4   r=   rB   rR   rX   r]   rd   __static_attributes__r   r   r   r   r   #   s     ),,RWW5D(3-57#GI EI&SM&4<SM&	&! !# *$ *   $)4 )N N2 2C t 84 2  r   r   )__all__rU   r   r1   r   r   typingr	   rk   r   r   r   r   r(   r   r   r   r   <module>rr      se   
 
 
    -C - 
#e eP :!r   