
    f2                     D    d dl mZ d dlmZmZ d dlmZmZmZ ddZ	ddZ
y)    )mkFilter)discoverDiscoveryFailure)	parseXRDSiterServices	XRDSErrorNc                     t        |       }	 t        |j                  |j                  |      }|j                  |fS # t        $ r}t        t        |      d      d}~ww xY w)at  Perform the Yadis protocol on the input URL and return an
    iterable of resulting endpoint objects.

    @param flt: A filter object or something that is convertable to
        a filter object (using mkFilter) that will be used to generate
        endpoint objects. This defaults to generating BasicEndpoint
        objects.

    @param input_url: The URL on which to perform the Yadis protocol

    @return: The normalized identity URL and an iterable of endpoint
        objects generated by the filter function.

    @rtype: (str, [endpoint])

    @raises DiscoveryFailure: when Yadis fails to obtain an XRDS document.
    N)r   applyFilternormalized_uriresponse_textr   r   str)	input_urlfltresult	endpointserrs        P/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/openid/yadis/services.pygetServiceEndpointsr      sf    $ i F/ 5 5v7K7K #%	 !!9--  /s3x../s   !< 	AAAc                     t        |      }t        |      }g }t        |      D ]#  }|j                  |j	                  | |             % |S )aa  Generate an iterable of endpoint objects given this input data,
    presumably from the result of performing the Yadis protocol.

    @param normalized_uri: The input URL, after following redirects,
        as in the Yadis protocol.


    @param xrd_data: The XML text the XRDS file fetched from the
        normalized URI.
    @type xrd_data: str

    )r   r   r   extendr   )r   xrd_datar   etr   service_elements         r   r
   r
   #   sY     3-C	8	BI'+ F##NOD	FF     )N)openid.yadis.filtersr   openid.yadis.discoverr   r   openid.yadis.etxrdr   r   r   r   r
    r   r   <module>r      s    * < A A.6r   