|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/uritemplate/__pycache__/ |
U
N��gF2 � @ s� d Z ddlZddlZddlZejee e
ef Zejej
e ejeef ejeef ef Zejeef ZG dd� d�Zejejeejej
ejeef f d�dd�Zejed�dd �Zejed�d
d�Zdejeed
�dd�Zejeed�dd�ZdS )z�
uritemplate.variable
====================
This module contains the URIVariable class which powers the URITemplate class.
What treasures await you:
- URIVariable class
You see a hammer in front of you.
What do you do?
>
� Nc @ s e Zd ZdZdZdZed�dd�Zed�dd �Zed�d
d�Z dd�d
d�Z
dd�dd�Zeee
eje eje d�dd�Zeee
eje eje d�dd�Zeee
eje eje d�dd�Zeee
eje eje d�dd�Zdeje ejeef d�dd�ZdS )�URIVariablea This object validates everything inside the URITemplate object.
It validates template expansions and will truncate length as decided by
the template.
Please note that just like the :class:`URITemplate <URITemplate>`, this
object's ``__str__`` and ``__repr__`` methods do not return the same
information. Calling ``str(var)`` will return the original variable.
This object does the majority of the heavy lifting. The ``URITemplate``
object finds the variables in the URI and then creates ``URIVariable``
objects. Expansions of the URI are handled by each ``URIVariable``
object. ``URIVariable.expand()`` returns a dictionary of the original
variable and the expanded value. Check that method's documentation for
more information.
)
�+�#�.�/�;�?�&�|�!�@z:/?#[]@!$&'()*+,;=)�varc C s8 || _ d| _d| _g | _g | _i | _| �� | �� d S )N� )�original�operator�safe� variables�variable_names�defaults�parse�
post_parse)�selfr
� r �A/opt/cppython/lib/python3.8/site-packages/uritemplate/variable.py�__init__6 s �zURIVariable.__init__)�returnc C s d| S )NzURIVariable(%s)r �r r r r �__repr__I s zURIVariable.__repr__c C s | j S �N)r r r r r �__str__L s zURIVariable.__str__Nc C s | j }| j d tjkr0| j d | _| j dd� }| jtjdd� krLtj| _|�d�}|D ]�}d}|}d|kr�t|�dd��\}}d}|�d�r�d }|dd
� }d}d|kr�t|�dd��\}}t |�}|r�|| j
|<