def fromHTML(cls, uri, html):
        """Parse the given document as HTML looking for an OpenID <link
        rel=...>

        @rtype: [OpenIDServiceEndpoint]
        """
        discovery_types = [
            (OPENID_2_0_TYPE, 'openid2.provider', 'openid2.local_id'),
            (OPENID_1_1_TYPE, 'openid.server', 'openid.delegate'),
            ]

        link_attrs = html_parse.parseLinkAttrs(html)
        services = []
        for type_uri, op_endpoint_rel, local_id_rel in discovery_types:
            op_endpoint_url = html_parse.findFirstHref(
                link_attrs, op_endpoint_rel)
            if op_endpoint_url is None:
                continue

            service = cls()
            service.claimed_id = uri
            service.local_id = html_parse.findFirstHref(
                link_attrs, local_id_rel)
            service.server_url = op_endpoint_url
            service.type_uris = [type_uri]

            services.append(service)

        return services
def fromHTML ( cls , uri , html ) : discovery_types = [ ( OPENID_2_0_TYPE , 'openid2.provider' , 'openid2.local_id' ) , ( OPENID_1_1_TYPE , 'openid.server' , 'openid.delegate' ) , ] link_attrs = html_parse . parseLinkAttrs ( html ) services = [ ] for type_uri , op_endpoint_rel , local_id_rel in discovery_types : op_endpoint_url = html_parse . findFirstHref ( link_attrs , op_endpoint_rel ) if op_endpoint_url is None : continue service = cls ( ) service . claimed_id = uri service . local_id = html_parse . findFirstHref ( link_attrs , local_id_rel ) service . server_url = op_endpoint_url service . type_uris = [ type_uri ] services . append ( service ) return services
Parse the given document as HTML looking for an OpenID <link
        rel=...>

        @rtype: [OpenIDServiceEndpoint]