Your IP : 3.17.76.163


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/__pycache__/speaklater.cpython-311.pyc

�

M�Dg`��n�dZd�Zd�Zd�ZGd�de��ZedkrddlZej��dSdS)	a�
    speaklater
    ~~~~~~~~~~

    A module that provides lazy strings for translations.  Basically you
    get an object that appears to be a string but changes the value every
    time the value is evaluated based on a callable you provide.

    For example you can have a global `lazy_gettext` function that returns
    a lazy string with the value of the current set language.

    Example:

    >>> from speaklater import make_lazy_string
    >>> sval = u'Hello World'
    >>> string = make_lazy_string(lambda: sval)

    This lazy string will evaluate to the value of the `sval` variable.

    >>> string
    lu'Hello World'
    >>> unicode(string)
    u'Hello World'
    >>> string.upper()
    u'HELLO WORLD'

    If you change the value, the lazy string will change as well:

    >>> sval = u'Hallo Welt'
    >>> string.upper()
    u'HALLO WELT'

    This is especially handy when combined with a thread local and gettext
    translations or dicts of translatable strings:

    >>> from speaklater import make_lazy_gettext
    >>> from threading import local
    >>> l = local()
    >>> l.translations = {u'Yes': 'Ja'}
    >>> lazy_gettext = make_lazy_gettext(lambda: l.translations.get)
    >>> yes = lazy_gettext(u'Yes')
    >>> print yes
    Ja
    >>> l.translations[u'Yes'] = u'Si'
    >>> print yes
    Si

    Lazy strings are no real strings so if you pass this sort of string to
    a function that performs an instance check, it will fail.  In that case
    you have to explicitly convert it with `unicode` and/or `string` depending
    on what string type the lazy string encapsulates.

    To check if a string is lazy, you can use the `is_lazy_string` function:

    >>> from speaklater import is_lazy_string
    >>> is_lazy_string(u'yes')
    False
    >>> is_lazy_string(yes)
    True

    New in version 1.2: It's now also possible to pass keyword arguments to
    the callback used with `make_lazy_string`.

    :copyright: (c) 2010 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
c�,�t|t��S)z,Checks if the given object is a lazy string.)�
isinstance�_LazyString)�objs �j/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/speaklater.py�is_lazy_stringrFs���c�;�'�'�'�c�$�t|||��S)z1Creates a lazy string by invoking func with args.)r)�__func�args�kwargss   r�make_lazy_stringr
Ks���v�t�V�,�,�,rc����fd�}|S)aPCreates a lazy gettext function dispatches to a gettext
    function as returned by `lookup_func`.

    Example:

    >>> translations = {u'Yes': u'Ja'}
    >>> lazy_gettext = make_lazy_gettext(lambda: translations.get)
    >>> x = lazy_gettext(u'Yes')
    >>> x
    lu'Ja'
    >>> translations[u'Yes'] = u'Si'
    >>> x
    lu'Si'
    c�V��t|��r|St���|��S�N)rr
)�string�lookup_funcs �r�lazy_gettextz'make_lazy_gettext.<locals>.lazy_gettext_s.����&�!�!�	��M����
�
�v�6�6�6r�)rrs` r�make_lazy_gettextrPs$���7�7�7�7�7��rc���eZdZdZdZd�Zed���Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z dS)rz�Class for strings created by a function call.

    The proxy implementation attempts to be as complete as possible, so that
    the lazy objects should mostly work as expected, for example for sorting.
    ��_func�_args�_kwargsc�0�||_||_||_dSrr)�self�funcrrs    r�__init__z_LazyString.__init__ns����
���
�����rc�0�|j|ji|j��Srr)�xs r�<lambda>z_LazyString.<lambda>ss��w�q�w���=�1�9�=�=�rc��||jvSr��value�r�keys  r�__contains__z_LazyString.__contains__us���d�j� � rc�*�t|j��Sr)�boolr$�rs r�__nonzero__z_LazyString.__nonzero__x����D�J���rc�*�tt��Sr)�dir�unicoder*s r�__dir__z_LazyString.__dir__{s���7�|�|�rc�*�t|j��Sr)�iterr$r*s r�__iter__z_LazyString.__iter__~r,rc�*�t|j��Sr)�lenr$r*s r�__len__z_LazyString.__len__�����4�:���rc�*�t|j��Sr)�strr$r*s r�__str__z_LazyString.__str__�r7rc�*�t|j��Sr)r/r$r*s r�__unicode__z_LazyString.__unicode__�s���t�z�"�"�"rc��|j|zSrr#�r�others  r�__add__z_LazyString.__add__�����z�E�!�!rc��||jzSrr#r>s  r�__radd__z_LazyString.__radd__�����t�z�!�!rc��|j|zSrr#r>s  r�__mod__z_LazyString.__mod__�rArc��||jzSrr#r>s  r�__rmod__z_LazyString.__rmod__�rDrc��|j|zSrr#r>s  r�__mul__z_LazyString.__mul__�rArc��||jzSrr#r>s  r�__rmul__z_LazyString.__rmul__�rDrc��|j|kSrr#r>s  r�__lt__z_LazyString.__lt__�����z�E�!�!rc��|j|kSrr#r>s  r�__le__z_LazyString.__le__�����z�U�"�"rc��|j|kSrr#r>s  r�__eq__z_LazyString.__eq__�rRrc��|j|kSrr#r>s  r�__ne__z_LazyString.__ne__�rRrc��|j|kSrr#r>s  r�__gt__z_LazyString.__gt__�rOrc��|j|kSrr#r>s  r�__ge__z_LazyString.__ge__�rRrc�`�|dkr|���St|j|��S)N�__members__)r0�getattrr$)r�names  r�__getattr__z_LazyString.__getattr__�s-���=� � ��<�<�>�>�!��t�z�4�(�(�(rc�*�|j|j|jfSrrr*s r�__getstate__z_LazyString.__getstate__�s���z�4�:�t�|�3�3rc�0�|\|_|_|_dSrr)r�tups  r�__setstate__z_LazyString.__setstate__�s��/2�,��
�D�J����rc��|j|Srr#r%s  r�__getitem__z_LazyString.__getitem__�s���z�#��rc��|Srrr*s r�__copy__z_LazyString.__copy__�s���rc�p�	dt|j��zS#t$rd|jjzcYSwxYw)N�lz<%s broken>)�reprr$�	Exception�	__class__�__name__r*s r�__repr__z_LazyString.__repr__�sM��	;���d�j�)�)�)�)���	;�	;�	;� �4�>�#:�:�:�:�:�	;���s��5�5N)!rn�
__module__�__qualname__�__doc__�	__slots__r�propertyr$r'r+r0r3r6r:r<r@rCrFrHrJrLrNrQrTrVrXrZr_rardrfrhrorrrrrfs���������
.�I����

�H�=�=�>�>�E�!�!�!� � � ���� � � �������#�#�#�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�#�#�#�#�#�#�#�#�#�"�"�"�#�#�#�)�)�)�
4�4�4�3�3�3�������;�;�;�;�;rr�__main__�N)	rrrr
r�objectrrn�doctest�testmodrrr�<module>rzs���A�A�H(�(�(�
-�-�-�
���,];�];�];�];�];�&�];�];�];�@�z����N�N�N��G�O�������r

?>