
    )Jf2                     F    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
dS )    )mkFilter)discoverDiscoveryFailure)	parseXRDSiterServices	XRDSErrorNc                     t          |           }	 t          |j        |j        |          }n/# t          $ r"}t          t          |          d          d}~ww xY w|j        |fS )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        X/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/openid/yadis/services.pygetServiceEndpointsr      sw    $ i  F/ 5v7K #% %		 / / /s3xx.../!9--s   - 
AAAc                     t          |          }t          |          }g }t          |          D ]+}|                    |                    | |                     ,|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
   #   sv     3--C	8		BI'++ F F##NODD	F 	F 	F 	F     )N)openid.yadis.filtersr   openid.yadis.discoverr   r   openid.yadis.etxrdr   r   r   r   r
    r   r   <module>r      s    * ) ) ) ) ) < < < < < < < < A A A A A A A A A A. . . .6     r   