
    tfi                         d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
mZmZ ddlmZ ddlmZ d	eed
f         deeef         defdZ eee	           G d d                      ZdS )z(
Parser for 'haproxy:' string endpoint.
    )MappingTuple)implementer)
interfaces)!IStreamServerEndpointStringParser_WrapperServerEndpointquoteStringArgumentserverFromString)IPlugin   )proxyEndpointargs.kwargsreturnc                     d                     d | D             t          d |                                D                       z             }|S )a  
    Un-parse the already-parsed args and kwargs back into endpoint syntax.

    @param args: C{:}-separated arguments

    @param kwargs: C{:} and then C{=}-separated keyword arguments

    @return: a string equivalent to the original format which this was parsed
        as.
    :c                 F    g | ]}t          t          |                    S  )r	   str).0args     `/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/protocols/haproxy/_parser.py
<listcomp>z#unparseEndpoint.<locals>.<listcomp>$   s'    7773	SXX	&	&777    c           	   3      K   | ]Q\  }}d                      t          t          |                    t          t          |                              V  RdS )z{}={}N)formatr	   r   )r   keyvalues      r   	<genexpr>z"unparseEndpoint.<locals>.<genexpr>%   sl       
 
 U NN#CHH--/B3u::/N/N 
 
 
 
 
 
r   )joinsorteditems)r   r   descriptions      r   unparseEndpointr$      sh     ((77$777
 
 
 %llnn	
 
 
 
 
	
 K r   c                   8    e Zd ZdZdZdej        dededefdZ	dS )	HAProxyServerParserz
    Stream server endpoint string parser for the HAProxyServerEndpoint type.

    @ivar prefix: See L{IStreamServerEndpointStringParser.prefix}.
    haproxyreactorr   r   r   c                 `    t          ||          }t          ||          }t          |          S )a[  
        Parse a stream server endpoint from a reactor and string-only arguments
        and keyword arguments.

        @param reactor: The reactor.

        @param args: The parsed string arguments.

        @param kwargs: The parsed keyword arguments.

        @return: a stream server endpoint
        @rtype: L{IStreamServerEndpoint}
        )r$   r
   r   )selfr(   r   r   subdescriptionwrappedEndpoints         r   parseStreamServerz%HAProxyServerParser.parseStreamServer9   s0      )v66*7NCC_---r   N)
__name__
__module____qualname____doc__prefixr   IReactorCoreobjectr   r-   r   r   r   r&   r&   /   s\          F.!..7=.IO.	. . . . . .r   r&   N)r1   typingr   r   zope.interfacer   twisted.internetr   twisted.internet.endpointsr   r   r	   r
   twisted.pluginr    r   r4   r   r$   r&   r   r   r   <module>r;      s6  
  " ! ! ! ! ! ! ! & & & & & & ' ' ' ' ' '            # " " " " "      %, gc6k6J s    0 W788. . . . . . . 98. . .r   