ó
    Ö›‘hÏ  ã                   ó¬   • S r S/rSSKJr  SSKJrJrJrJrJ	r	  SSK
JrJr  \ " S S5      5       rS\S\\\4   S	\\   4S
 jrS\\\4   S	\	\   4S jrg)zƒ
Integration with systemd.

Currently only the minimum APIs necessary for using systemd's socket activation
feature are supported.
Ú	ListenFDsé    )Úgetpid)ÚDictÚListÚMappingÚOptionalÚSequence)ÚFactoryÚdefinec                   ó¸   • \ rS rSr% Sr\\   \S'   \" \	5      r
\\   \S'   Sr\  SS\\\\4      S\\   S	S 4S
 jj5       rS	\\   4S jrS	\\\4   4S jrSrg)r   é   aŠ  
L{ListenFDs} provides access to file descriptors inherited from systemd.

Typically L{ListenFDs.fromEnvironment} should be used to construct a new
instance of L{ListenFDs}.

@cvar _START: File descriptors inherited from systemd are always
    consecutively numbered, with a fixed lowest "starting" descriptor.  This
    gives the default starting descriptor.  Since this must agree with the
    value systemd is using, it typically should not be overridden.

@ivar _descriptors: A C{list} of C{int} giving the descriptors which were
    inherited.

@ivar _names: A L{Sequence} of C{str} giving the names of the descriptors
    which were inherited.
Ú_descriptorsÚ_namesé   NÚenvironÚstartÚreturnc                 ó
  • Uc  SSK Jn  UnUc  U R                  n[        [	        5       5      UR                  S5      :X  a  [        X!5      n[        U5      nO/ nSn[        U5      [        U5      :w  a	  U " / S5      $ U " XE5      $ )a^  
@param environ: A dictionary-like object to inspect to discover
    inherited descriptors.  By default, L{None}, indicating that the
    real process environment should be inspected.  The default is
    suitable for typical usage.

@param start: An integer giving the lowest value of an inherited
    descriptor systemd will give us.  By default, L{None}, indicating
    the known correct (that is, in agreement with systemd) value will be
    used.  The default is suitable for typical usage.

@return: A new instance of C{cls} which can be used to look up the
    descriptors which have been inherited.
r   )r   Ú
LISTEN_PID© )	Úosr   Ú_STARTÚstrr   ÚgetÚ_parseDescriptorsÚ_parseNamesÚlen)Úclsr   r   Ú_environÚdescriptorsÚnamess         ÚZC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/python/systemd.pyÚfromEnvironmentÚListenFDs.fromEnvironment.   s~   € ð( ‰?Ý.àˆGØ‰=Ø—J‘JˆEäŒv‹x‹=˜GŸK™K¨Ó5Ó5Ü%6°uÓ%FˆKÜ#.¨wÓ#7‰EàˆKØˆEô ˆu‹:œ˜[Ó)Ó)Ù�r˜2“;Ðá�;Ó&Ð&ó    c                 ó,   • [        U R                  5      $ )z&
@return: The configured descriptors.
)Úlistr   ©Úselfs    r"   ÚinheritedDescriptorsÚListenFDs.inheritedDescriptors\   s   € ô �D×%Ñ%Ó&Ð&r%   c                 óT   • [        [        U R                  U R                  5      5      $ )zZ
@return: A mapping from the names of configured descriptors to
    their integer values.
)ÚdictÚzipr   r   r(   s    r"   ÚinheritedNamedDescriptorsÚ#ListenFDs.inheritedNamedDescriptorsb   s    € ô
 ”C˜Ÿ™ T×%6Ñ%6Ó7Ó8Ð8r%   r   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   ÚintÚ__annotations__r
   Útupler   r   r   Úclassmethodr   r   r#   r   r*   r   r/   Ú__static_attributes__r   r%   r"   r   r      s—   ‡ ñð$ ˜3‘-ÓÙ# E›N€FˆH�S‰MÓ*à€Fàð 04Ø#ñ+'à˜' # s (Ñ+Ñ,ð+'ð ˜‰}ð+'ð 
ô	+'ó ð+'ðZ' d¨3¡iô 'ð9¨4°°S°©>÷ 9r%   r   r   r   c                 óŽ   •  [        US   5      n[        [        X U-   5      5      nUS	 US	 U$ ! [        [        4 a    / s $ f = f)aú  
Parse the I{LISTEN_FDS} environment variable supplied by systemd.

@param start: systemd provides only a count of the number of descriptors
    that have been inherited.  This is the integer value of the first
    inherited descriptor.  Subsequent inherited descriptors are numbered
    counting up from here.  See L{ListenFDs._START}.

@param environ: The environment variable mapping in which to look for the
    value to parse.

@return: The integer values of the inherited file descriptors, in order.
Ú
LISTEN_FDSr   )r6   r'   ÚrangeÚKeyErrorÚ
ValueError)r   r   Úcountr    s       r"   r   r   j   s]   € ðÜ�G˜LÑ)Ó*ˆô œ5 °©Ó6Ó7ˆð �LÐ! 7¨<Ð#8ØÐøô# ”jÐ!ó ØŠ	ðús   ‚/ ¯AÁAc                 óz   • U R                  SS5      n[        U5      S:”  a  [        UR                  S5      5      $ g)zâ
Parse the I{LISTEN_FDNAMES} environment variable supplied by systemd.

@param environ: The environment variable mapping in which to look for the
    value to parse.

@return: The names of the inherited descriptors, in order.
ÚLISTEN_FDNAMESÚ r   Ú:r   )r   r   r8   Úsplit)r   r!   s     r"   r   r   Ž   s7   € ð �K‰KÐ(¨"Ó-€EÜ
ˆ5ƒz�Aƒ~Ü�U—[‘[ Ó%Ó&Ð&Ør%   N)r5   Ú__all__r   r   Útypingr   r   r   r   r	   Úattrsr
   r   r   r6   r   r   r   r   r%   r"   Ú<module>rI      s„   ðñ
ð ˆ-€å ß :Õ :ç !ð ÷Q9ð Q9ó ðQ9ðh!˜Sð !¨7°3¸°8Ñ+<ð !ÀÀcÁô !ðH˜  c Ñ*ð ¨x¸©}õ r%   