
    i                     p    d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZmZ  G d de          ZdgZd	S )
zURI values from :rfc:`5545`.    )AnyClassVar)Self)JCalParsingError)
Parameters)DEFAULT_ENCODING
to_unicodec            	       l    e Zd ZU dZdZee         ed<   eed<   dZ	e
dfdeeef         dz  deded	ef fd
Zd	efdZedeez  d	efd            Zed	ee         fd            Zded	efdZeded	efd            Zed	efd            Zed	efd            Zd	efdZddlmZmZmZmZm Z m!Z!m"Z"  xZ#S )vUria  URI

    Value Name:
        URI

    Purpose:
        This value type is used to identify values that contain a
        uniform resource identifier (URI) type of reference to the
        property value.

    Format Definition:
        This value type is defined by the following notation:

        .. code-block:: text

            uri = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

    Description:
        This value type might be used to reference binary
        information, for values that are large, or otherwise undesirable
        to include directly in the iCalendar object.

        Property values with this value type MUST follow the generic URI
        syntax defined in [RFC3986].

        When a property parameter value is a URI value type, the URI MUST
        be specified as a quoted-string value.

    Examples:
        The following is a URI for a network file:

        .. code-block:: ics

            http://example.com/my-report.txt

        .. code-block:: pycon

            >>> from icalendar.prop import vUri
            >>> uri = vUri.from_ical('http://example.com/my-report.txt')
            >>> uri
            vUri('http://example.com/my-report.txt')
            >>> uri.uri
            'http://example.com/my-report.txt'
    URIdefault_valueparams)r   Nvalueencodingreturnc                    t          ||          }t                                          | |          }t          |          |_        |S )N)r   )r	   super__new__r   r   )clsr   r   r   self	__class__s        M/root/projects/butler/venv/lib/python3.11/site-packages/icalendar/prop/uri.pyr   zvUri.__new__=   sB     58444wwsE** ((    c                 6    |                      t                    S )N)encoder   r   s    r   to_icalzvUri.to_icalI   s    {{+,,,r   icalc                 d    	  | |          S # t           $ r}t          d|           |d }~ww xY w)NzExpected , got: )	Exception
ValueError)r   r   es      r   	from_icalzvUri.from_icalL   sM    	?3t99 	? 	? 	?66677Q>	?s   
 
/*/c                      | d          gS )zExamples of vUri.z http://example.com/my-report.txt )r   s    r   exampleszvUri.examplesS   s     67788r   namec                     || j                                         | j                                        t	          |           gS )zBThe jCal representation of this property according to :rfc:`7265`.)r   to_jcalVALUElowerstr)r   r'   s     r   r)   zvUri.to_jcalX   s3    dk))++TZ-=-=-?-?TKKr   jcal_propertyc                 t    t          j        ||             | |d         t          j        |                    S )zParse jCal from :rfc:`7265`.

        Parameters:
            jcal_property: The jCal property to parse.

        Raises:
            ~error.JCalParsingError: If the provided jCal is invalid.
           )r   validate_propertyr   from_jcal_property)r   r-   s     r   	from_jcalzvUri.from_jcal\   sA     	*=#>>>s!)-88
 
 	
r   c                     | j         S zThe URI.)urir   s    r   
ical_valuezvUri.ical_valuel   s     xr   c                      t          |           S r4   )r,   r   s    r   r5   zvUri.uriq   s     4yyr   c                 0    | j         j         d| j        dS )z
repr(self)())r   __name__r5   r   s    r   __repr__zvUri.__repr__v   s     .)99DH9999r   r   )FMTTYPEGAPLABELLANGUAGELINKRELRELTYPEr*   )$r;   
__module____qualname____doc__r   r   r,   __annotations__r   	__slots__r   dictr   r   r   bytesr   classmethodr#   listr&   r)   r2   propertyr6   r5   r<   icalendar.paramr=   r>   r?   r@   rA   rB   r*   __classcell__)r   s   @r   r   r      s        + +Z $)M8C=(((I
 )(,
 

 S#X%

 
 

 
 
 
 
 
- - - - - ?S5[ ?T ? ? ? [? 9d 9 9 9 [9LC LD L L L L 
d 
t 
 
 
 [
 C    X S    X:# : : : : WVVVVVVVVVVVVVVVVVVVVVr   r   N)rE   typingr   r   icalendar.compatibilityr   icalendar.errorr   icalendar.parserr   icalendar.parser_toolsr   r	   r,   r   __all__r%   r   r   <module>rU      s    " "                 ( ( ( ( ( ( , , , , , , ' ' ' ' ' ' ? ? ? ? ? ? ? ?oW oW oW oW oW3 oW oW oWd (r   