| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/lib/python3.10/dist-packages/utils/__pycache__/ |
Upload File : |
o
Peg� � @ s0 d Z e dfdd�ZG dd� de�Zd
dd�Zd S )zRAISE ON EXCEPTION�.c C s\ |� |�}| }|D ]"}zt||�}W q ty+ |tu r%td�||���| Y S w |S )z� getattr via a chain of attributes like so:
>>> import datetime
>>> some_date = datetime.date.today()
>>> get_attr(some_date, "month.numerator.__doc__")
'int(x[, base]) -> integer
Convert a string or number to an integer, ...
z!Bad attribute "{}" in chain: "{}")�split�getattr�AttributeError�"_get_attr_raise_on_attribute_error�format)�obj�
string_rep�default� separator�attribute_chain�current_obj�attr� r �8/usr/local/lib/python3.10/dist-packages/utils/objects.py�get_attr s
��r c @ s4 e Zd ZdZdZdd� Zdd� Zdd� Zdd � ZdS )
�ImmutableWrapperNc C s || _ || _d S )N)�_obj�
_recursive)�selfr � recursiver r r �__init__ s
zImmutableWrapper.__init__c C sP |dkr| j d u rt�| ||� d S |dkr$| jd u r$t�| ||� d S td��)Nr r zHThis object has been marked as immutable; you cannot set its attributes.)r �object�__setattr__r r )r �name�valr r r r # s zImmutableWrapper.__setattr__c C s( | j rtt| j|�| j d�S t| j|�S )N)r )r � immutabler r )r r r r r �__getattr__- s zImmutableWrapper.__getattr__c C s d� | jjj| j�� �S )Nz<Immutable {}: {}>)r r � __class__�__name__�__repr__)r r r r r 3 s zImmutableWrapper.__repr__) r �
__module__�__qualname__r r r r r r r r r r r s
r Tc C s
t | |�S )z�wraps the argument in a pass-through class that disallows all attribute
setting. If the `recursive` flag is true, all attribute accesses will
return an immutable-wrapped version of the "real" attribute.)r )r r r r r r 7 s
r N)T)r r r r r r r r r �<module> s