
    h                         S r SSKrSSKJrJr  SSKJr  SSKJr  SSK	r	SSK
Jr  SSKJr  SSKJrJr  SS	KJr  \" \5      \	R&                  " S
S
S9 " S S5      5       5       r\" \5      \	R&                  " S
S
S9 " S S5      5       5       r\" \5       " S S5      5       r\	R&                  " S
S
S9\" \5       " S S5      5       5       r\	R&                  " SSSS
S9\" \5       " S S5      5       5       r " S S\5      rg)z*
Address objects for network connections.
    N)OptionalUnion)warn)implementer)Literal)IAddress)_asFilesystemBytes_coerceToFilesystemEncoding)platformT)unsafe_hashauto_attribsc                       \ rS rSr% Sr\R                  " \R                  R                  SS/5      S9r	\
\S   \S   4   \S'   \\S'   \\S'   S	rg
)IPv4Address   aP  
An L{IPv4Address} represents the address of an IPv4 socket endpoint.

@ivar type: A string describing the type of transport, either 'TCP' or
    'UDP'.

@ivar host: A string containing a dotted-quad IPv4 address; for example,
    "127.0.0.1".
@type host: C{str}

@ivar port: An integer representing the port number.
@type port: C{int}
TCPUDP	validatortypehostport N)__name__
__module____qualname____firstlineno____doc__attrib
validatorsin_r   r   r   __annotations__strint__static_attributes__r       _/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/internet/address.pyr   r      sR     37''//%%uen53D%.
/  I
Ir&   r   c                       \ rS rSr% Sr\R                  " \R                  R                  SS/5      S9r	\
\S   \S   4   \S'   \\S'   \\S'   S	r\\S
'   S	r\
\\4   \S'   Srg)IPv6Address/   a  
An L{IPv6Address} represents the address of an IPv6 socket endpoint.

@ivar type: A string describing the type of transport, either 'TCP' or
    'UDP'.

@ivar host: A string containing a colon-separated, hexadecimal formatted
    IPv6 address; for example, "::1".
@type host: C{str}

@ivar port: An integer representing the port number.
@type port: C{int}

@ivar flowInfo: the IPv6 flow label.  This can be used by QoS routers to
    identify flows of traffic; you may generally safely ignore it.
@type flowInfo: L{int}

@ivar scopeID: the IPv6 scope identifier - roughly analagous to what
    interface traffic destined for this address must be transmitted over.
@type scopeID: L{int} or L{str}
r   r   r   r   r   r   r   flowInfoscopeIDr   N)r   r   r   r   r   r   r   r    r!   r   r   r   r"   r#   r$   r+   r,   r%   r   r&   r'   r)   r)   /   sn    , 37''//%%uen53D%.
/  I
IHc GU38_ r&   r)   c                       \ rS rSrSrSrg)_ProcessAddressQ   z<
An L{interfaces.IAddress} provider for process transports.
r   N)r   r   r   r   r   r%   r   r&   r'   r.   r.   Q   s    r&   r.   c                   .    \ rS rSr% Sr\\S'   \\S'   Srg)HostnameAddressX   z
A L{HostnameAddress} represents the address of a L{HostnameEndpoint}.

@ivar hostname: A hostname byte string; for example, b"example.com".
@type hostname: L{bytes}

@ivar port: An integer representing the port number.
@type port: L{int}
hostnamer   r   N)	r   r   r   r   r   bytesr"   r$   r%   r   r&   r'   r1   r1   X   s     O
Ir&   r1   F)r   repreqr   c                       \ rS rSr% Sr\R                  " \R                  R                  \	5      S9r
\\   \S'   \" \R                   SS5      b
  S\S\4S	 jrO	S\S\4S
 jrS\4S jrS rSrg)UNIXAddressi   zy
Object representing a UNIX socket endpoint.

@ivar name: The filename associated with this socket.
@type name: C{bytes}
)	converternamesamefileNotherreturnc                    [        XR                  5      (       d  [        $ U R                  UR                  :H  nU(       dW  U R                  (       aF  UR                  (       a5   [        R
                  R                  U R                  UR                  5      $ U$ ! [         a     U$ [        [        4 a'  n[        R                  " 5       (       d  Ue SnAU$ SnAff = f)zh
Overriding C{attrs} to ensure the os level samefile
check is done if the name attributes do not match.
N)
isinstance	__class__NotImplementedr;   ospathr<   OSError	TypeError
ValueErrorr   isLinux)selfr=   reses       r'   __eq__UNIXAddress.__eq__y   s    
 e^^44%%))uzz)C499 77++DIIuzzBB J   J ":.   $++-- .J s   $3B 
C'C6CCc                 t    [        XR                  5      (       a  U R                  UR                  :H  $ [        $ N)r@   rA   r;   rB   )rI   r=   s     r'   rL   rM      s*    %00yyEJJ..!!r&   c                 J    U R                   nUb  [        SU5      OS nSU< S3$ )N zUNIXAddress())r;   r
   )rI   r;   shows      r'   __repr__UNIXAddress.__repr__   s.    yy8<8H*2t4ddXQ''r&   c                    U R                   c  [        U R                  S 45      $  [        R                  " U R                   5      n[        UR
                  UR                  45      $ ! [         a    [        U R                   5      s $ f = frO   )r;   hashrA   rC   statst_inost_devrE   )rI   s1s     r'   __hash__UNIXAddress.__hash__   sl    99.//	##BBII.// 	#		?"	#s   A A' 'B	B	r   )r   r   r   r   r   r   r   
convertersoptionalr	   r;   r   r4   r"   getattrrC   rD   objectboolrL   r#   rT   r\   r%   r   r&   r'   r8   r8   i   s     !GG//**+=>D(5/  rww
D)5	 	4 	,	" 	"4 	"
(# (
#r&   r8   c                   *    \ rS rSrSrS\S\4S jrSrg)_ServerFactoryIPv4Address   z@Backwards compatibility hack. Just like IPv4Address in practice.r=   r>   c                 J   [        U[        5      (       a*  [        S[        SS9  U R                  U R
                  4U:H  $ [        U[        5      (       aJ  U R                  U R                  U R
                  4nUR                  UR                  UR
                  4nX#:H  $ [        $ )Nz?IPv4Address.__getitem__ is deprecated.  Use attributes instead.   )category
stacklevel)	r@   tupler   DeprecationWarningr   r   r   r   rB   )rI   r=   abs       r'   rL    _ServerFactoryIPv4Address.__eq__   s    eU##T+
 IItyy)U22{++DIItyy1AUZZ4A6Mr&   r   N)	r   r   r   r   r   ra   rb   rL   r%   r   r&   r'   rd   rd      s    JF t r&   rd   )r   rC   typingr   r   warningsr   zope.interfacer   r   typing_extensionsr   twisted.internet.interfacesr   twisted.python.filepathr	   r
   twisted.python.runtimer   sr   r)   r.   r1   r8   rd   r   r&   r'   <module>rw      s  
 
 "  &  % 0 S + XDt,  - , XDt,! ! - !@ X   Dt,X   - E%dCX5# 5#  D5#x r&   