/opt/imunify360/venv/lib/python3.11/site-packages/__pycache__
Edit: /opt/imunify360/venv/lib/python3.11/site-packages/__pycache__/speaklater.cpython-311.pyc (9161B)
§
’CÁË·?¢ã ón — d Z d„ Zd„ Zd„ Z G d„ de¦ « Zedk rddlZ ej ¦ « dS dS ) 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.6.3/opt/imunify360/venv/lib/python3.11/site-packages/speaklater.pyÚis_lazy_stringr F s € å�c�;Ñ'Ô'Ð'ó c ó$ — t | ||¦ « S )z1Creates a lazy string by invoking func with args.)r )Ú__funcÚargsÚkwargss r Úmake_lazy_stringr
K s € å�v˜t VÑ,Ô,Ð,r c ó ‡ — ˆ fd„}|S )aP Creates 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| S t ‰¦ « | ¦ « S ©N)r r
)ÚstringÚlookup_funcs €r Úlazy_gettextz'make_lazy_gettext.
.lazy_gettext_ s. ø€ ݘ&Ñ!Ô!ð ØˆMÝ ¡
¤
¨vÑ6Ô6Ð6r © )r r s ` r Úmake_lazy_gettextr P s$ ø€ ð7ð 7ð 7ð 7ð 7ð Ðr c óÊ — e Zd ZdZdZd„ Z ed„ ¦ « Zd„ Zd„ Z d„ Z
d„ Zd „ Zd
„ Z
d„ Zd„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z dS )r zÎ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 — || _ || _ || _ d S r r )ÚselfÚfuncr r s r Ú__init__z_LazyString.__init__n s € ؈Œ
؈Œ
؈Œˆˆr c ó0 — | j | j i | j ¤ŽS r r )Úxs r úz_LazyString.s s € ˜w˜qœw¨¬Ð=°1´9Ð=Ð=€ r c ó — || j v S r ©Úvalue©r Úkeys r Ú__contains__z_LazyString.__contains__u s € Ø�d”jÐ Ð r c ó* — t | j ¦ « S r )Úboolr$ ©r s r Ú__nonzero__z_LazyString.__nonzero__x ó € Ý�D”JÑÔÐr c ó* — t t ¦ « S r )ÚdirÚunicoder* s r Ú__dir__z_LazyString.__dir__{ s € Ý•7‰|Œ|Ðr c ó* — t | j ¦ « S r )Úiterr$ r* s r Ú__iter__z_LazyString.__iter__~ r, r c ó* — t | j ¦ « S r )Úlenr$ r* s r Ú__len__z_LazyString.__len__� ó € Ý�4”:‰ŒÐr c ó* — t | j ¦ « S r )Ústrr$ r* s r Ú__str__z_LazyString.__str__„ r7 r c ó* — t | j ¦ « S r )r/ r$ r* s r Ú__unicode__z_LazyString.__unicode__‡ s € Ý�t”zÑ"Ô"Ð"r c ó — | j |z S r r# ©r Úothers r Ú__add__z_LazyString.__add__Š ó € ØŒz˜EÑ!Ð!r c ó — || j z S r r# r> s r Ú__radd__z_LazyString.__radd__� ó € Ø�t”zÑ!Ð!r c ó — | j |z S r r# r> s r Ú__mod__z_LazyString.__mod__� rA r c ó — || j z S r r# r> s r Ú__rmod__z_LazyString.__rmod__“ rD r c ó — | j |z S r r# r> s r Ú__mul__z_LazyString.__mul__– rA r c ó — || j z S r r# r> s r Ú__rmul__z_LazyString.__rmul__™ rD r c ó — | j |k S r r# r> s r Ú__lt__z_LazyString.__lt__œ ó € ØŒz˜EÒ!Ð!r c ó — | j |k S r r# r> s r Ú__le__z_LazyString.__le__Ÿ ó € ØŒz˜UÒ"Ð"r c ó — | j |k S r r# r> s r Ú__eq__z_LazyString.__eq__¢ rR r c ó — | j |k S r r# r> s r Ú__ne__z_LazyString.__ne__¥ rR r c ó — | j |k S r r# r> s r Ú__gt__z_LazyString.__gt__¨ rO r c ó — | j |k S r r# r> s r Ú__ge__z_LazyString.__ge__« rR r c ó` — |dk r| ¦ « S t | j |¦ « S )NÚ__members__)r0 Úgetattrr$ )r Únames r Ú__getattr__z_LazyString.__getattr__® s- € Ø�=Ò Ð Ø—<’<‘>”>Ð!Ý�t”z 4Ñ(Ô(Ð(r c ó* — | j | j | j fS r r r* s r Ú__getstate__z_LazyString.__getstate__³ s € ØŒz˜4œ: t¤|Ð3Ð3r c ó0 — |\ | _ | _ | _ d S r r )r Útups r Ú__setstate__z_LazyString.__setstate__¶ s € Ø/2Ñ,ˆŒ
�D”J ¤ r c ó — | j | S r r# r% s r Ú__getitem__z_LazyString.__getitem__¹ s € ØŒz˜#ŒÐr c ó — | S r r r* s r Ú__copy__z_LazyString.__copy__¼ s € ؈r c óp — dt | j ¦ « z S # t $ r d| j j z cY S w xY w)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+ r0 r3 r6 r: r<