← Back
Editing: xri.cpython-311.pyc
� 8O�^� � � � d Z ddlZddlmZ ddlmZ g d�Zd� Zd� Z ej d� � Z d � Zd � Zd� Z d� Zd � Zd� Zd� ZdS )z�Utility functions for handling XRIs. @see: XRI Syntax v2.0 at the U{OASIS XRI Technical Committee<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xri>} � N)�reduce)� codecutil)�!�=�@�+�$�(c �V � | � d� � s| r| d t v rdS dS )zWDetermine if this identifier is an XRI or URI. @returns: C{"XRI"} or C{"URI"} �xri://r �XRI�URI)� startswith�XRI_AUTHORITIES)� identifiers �2/usr/lib/python3/dist-packages/openid/yadis/xri.py�identifierSchemer s: � � ���X�&�&� �:� �+5�a�=�O�+K�+K��u��u� c �T � | � d� � sd| z } t | � � S )z$Transform an XRI to IRI-normal form.r )r �escapeForIRI��xris r �toIRINormalr s- � ��>�>�(�#�#� ���n������r z \((.*?)\)c � � | � � � }|� dd� � }|� dd� � }|� dd� � }|S )zKEscape things that need to be escaped if they're in a cross-reference. �/z%2F�?z%3F�#z%23)�group�replace)� xref_match�xrefs r �_escape_xrefr"