/opt/imunify360/venv/lib/python3.11/site-packages/click/__pycache__
Edit: /opt/imunify360/venv/lib/python3.11/site-packages/click/__pycache__/utils.cpython-311.pyc (28006B)
§
‚ð,»ßC·ã ó — d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm Z ddl
mZ ddl
mZ ddl
m
Z
dd l
mZ dd
l
mZ ddl
mZ ddl
mZ dd
l
mZ ddl
mZ ddl
mZ ddlmZ ej rd dlZ ej d¦ « Z ej d¦ « Zdedefd„ZdJd„Z dej! defd„Z"dKdede#defd„Z$ G d „ d!¦ « Z% G d"„ d#¦ « Z& dLd&ej' ej! d'ej' ej( ej! d(e)d)e)d*ej' e) ddfd+„Z*dd,dej+ fd-„Z, dMdd,d/ej' e d0ej' e dej- fd1„Z. dNd3ed4ed/ej' e d0ej' e d5e)d6e)dej( ej! fd7„Z/ dOd3d8d9e)defd:„Z0dPd;ed
„Z1 G d?„ d@¦ « Z2 dQdAej' e dBej' e defdC„Z3d$d$d$dDœdEej4 e dFe)dGe)dHe)dej5 e f
dI„Z6dS )Ré N)Úupdate_wrapper)Ú
ModuleType)Ú
TracebackTypeé )Ú_default_text_stderr)Ú_default_text_stdout)Ú_find_binary_writer)Úauto_wrap_for_ansi)Úbinary_streams)Úopen_stream)Úshould_strip_ansi)Ú
strip_ansi)Útext_streams)ÚWIN)Úresolve_color_defaultÚPÚRÚnameÚreturnc ót — d | ¦ « ¦ « ¦ « S )Nú-)ÚjoinÚsplitÚlower)r s úk/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/click/utils.pyÚ _posixifyr s( € Ø�8Š8�D—J’J‘L”LÑ!Ô!×'Ò'Ñ)Ô)Ð)ó Úfuncút.Callable[P, R]út.Callable[P, t.Optional[R]]c óf ‡ — dddddt j t fˆ fd„}t |‰ ¦ « S )z0Wraps a function so that it swallows exceptions.ÚargszP.argsÚkwargszP.kwargsr c ó: •— ‰| i |¤ŽS # t $ r Y nw xY wd S ©N)Ú Exception)r" r# r s €r Úwrapperzsafecall..wrapper$ sB ø€ ð Ø�4˜Ð( Ð(Ð(Ð(øÝð ð ð ØˆDð øøøàˆts ƒ ‹
—)ÚtÚOptionalr r )r r' s ` r Úsafecallr* ! sN ø€ ð�xð ¨:ð ½!¼*ÅQ¼-ð ð ð ð ð ð õ ˜' 4Ñ(Ô(Ð(r Úvaluec óä — t | t ¦ « rM | t j ¦ « ¦ « S # t
$ r | dd¦ « cY S w xY wt
| ¦ « S )z%Converts a value into a valid string.úutf-8Úreplace)Ú
isinstanceÚbytesÚdecodeÚsysÚgetfilesystemencodingÚUnicodeErrorÚstr)r+ s r Úmake_strr6 . su € å�%�ÑÔð 4ð 4Ø—<’<¥Ô 9Ñ ;Ô ;Ñ<Ô<Ð<øÝð 4ð 4ð 4Ø—<’< ¨Ñ3Ô3Ð3Ð3Ð3ð 4øøøåˆu‰:Œ:Ðs —%= ½ A ÁA é- ÚhelpÚ
max_lengthc ó° — | d¦ « }|dk r
| d|… } | ¦ « }|sdS |d dk r
|dd… }d}t |¦ « dz
}t |¦ « D ]b\ }}|t |¦ « |dk z z
}||k r nR|d dk r"d |d|dz … ¦ « c S ||k r||k r nŒcd |¦ « S |t d
¦ « z
}|dk r1|t || ¦ « |dk z z }||k rn|dz }|dk °1d |d|… ¦ « d
z S )z+Returns a condensed version of help string.z
éÿÿÿÿNÚ r úr ú.ú z...)Úfindr ÚlenÚ enumerater )r8 r9 Ú
paragraph_endÚwordsÚtotal_lengthÚ
last_indexÚiÚwords r Úmake_default_short_helprI 8 s— € ð —I’I˜fÑ%Ô%€Mà˜ÒÐØ�N�]�NÔ#ˆð
�JŠJ‰LŒL€Eàð Øˆrð
ˆQ„x�4ÒÐØ�a�b�b” ˆà€LÝ�U‘”˜a‘€Jå˜UÑ#Ô#ð 𠉈ˆ4Ø�˜D™ œ Q¨¢UÑ+Ñ+ˆà˜*Ò$Ð$؈Eà�Œ8�sŠ?ˆ?Ø—8’8˜E ' A¨¡E 'œNÑ+Ô+Ð+Ð+Ð+à˜:Ò%Ð%¨!¨zª/¨/؈Eøà�xŠx˜‰ŒÐð •C˜‘J”JÑ€Lð ˆaŠ%ˆ%Ø�˜E !œH™
œ
¨¨QªÑ/Ñ/ˆà˜:Ò%Ð%Øà ˆQ‰ˆð
ˆaŠ%ˆ%ð �8Š8�E˜"˜1˜"”IÑÔ Ñ&Ð&r c ó„ — e Zd ZdZ ddej edf ded ej e d
ej e def
d„Z d
edej
fd„Zdefd„Zdej
ej
fd„Zdd„Zdd„Zdd„Zdej ej e dej e dej e ddfd„Zdej ej fd„ZdS )ÚLazyFilezîA lazy file works like a regular file but it does not fully open
the file but it does perform some basic checks early to see if the
filename parameter does make sense. This is useful for safely opening
files for writing.
ÚrNÚstrictFÚfilenamezos.PathLike[str]ÚmodeÚencodingÚerrorsÚatomicc ó8 — t j |¦ « | _ || _ || _ || _ || _ | | | j dk r!t ||||¦ « \ | _ | _ d S d|v r"t ||¦ « ¦ « d | _ d| _ d S )Nr rL T)ÚosÚfspathr rO rP rQ rR r Ú_fÚshould_closeÚopenÚclose)ÚselfrN rO rP rQ rR s r Ú__init__zLazyFile.__init__q s© € õ œ 8Ñ,Ô,ˆŒ ؈Œ Ø ˆŒ
؈ŒØˆŒØÐ(ØÐàŒ9˜ÒÐÝ)4°X¸tÀXÈvÑ)VÔ)VÑ&ˆDŒG�TÔ&Ð&Ð&à�dˆ{ˆ{õ �X˜tÑ$Ô$×*Ò*Ñ,Ô,Ð,؈DŒGØ $ˆDÔÐÐr r r c óF — t | ¦ « |¦ « S r% )ÚgetattrrX ©rZ r s r Ú__getattr__zLazyFile.__getattr__Œ s € Ý�t—y’y‘{”{ DÑ)Ô)Ð)r c óx — | j �t | j ¦ « S dt | j ¦ « › d| j › d�S )Nz)rV ÚreprÚformat_filenamer rO ©rZ s r Ú__repr__zLazyFile.__repr__� s= € ØŒ7Ðݘœ‘=”=Ð ØL¥/°$´)Ñ"<Ô"<ÐLÐLÀÄ ÐLÐLÐLÐLr c óþ — | j �| j S t | j | j | j | j | j ¬¦ « \ }| _ n0# t $ r#}ddl m
} || j |j ¬¦ « |‚d}~ww xY w|| _ |S )zOpens the file if it's not yet open. This call might fail with
a :exc:`FileError`. Not handling this error will produce an error
that Click shows.
N©rR r )Ú FileError)Úhint)rV r r rO rP rQ rR rW ÚOSErrorÚ
exceptionsrh Ústrerror)rZ ÚrvÚerh s r rX z
LazyFile.open” s¨ € ð
Œ7ÐØ”7ˆNð ?Ý$/Ø” ˜4œ9 d¤m°T´[ÈÌð%ñ %ô %Ñ!ˆB�Ô!Ð!øõ ð ?ð ?ð ?Ø-Ð-Ð-Ð-Ð-Ð-à�)˜DœI¨A¬JÐ7Ñ7Ô7¸QÐ>øøøøð ?øøøð ˆŒØˆ s �5A Á
A3ÁA.Á.A3c óJ — | j �| j ¦ « dS dS )z+Closes the underlying file, no matter what.N)rV rY rd s r rY zLazyFile.close¦ s% € àŒ7ÐØŒG�MŠM‰OŒOˆOˆOˆOð Ðr c ó@ — | j r| ¦ « dS dS )z‰This function only closes the file if it was opened by the lazy
file wrapper. For instance this will never close stdin.
N)rW rY rd s r Úclose_intelligentlyzLazyFile.close_intelligently« s* € ð Ôð Ø�JŠJ‰LŒLˆLˆLˆLð ð r c ó — | S r% © rd s r Ú __enter__zLazyFile.__enter__² ó € Øˆr Úexc_typeÚ exc_valueÚtbc ó. — | ¦ « d S r% )rq ©rZ rv rw rx s r Ú__exit__zLazyFile.__exit__µ s € ð
× Ò Ñ"Ô"Ð"Ð"Ð"r c óR — | ¦ « t | j ¦ « S r% )rX ÚiterrV rd s r Ú__iter__zLazyFile.__iter__½ s € Ø� Š ‰ŒˆÝ�D”G‰}Œ}Ðr )rL NrM F©r N)r rK )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r( ÚUnionr5 r) Úboolr[ ÚAnyr_ re ÚIOrX rY rq rt ÚTypeÚ
BaseExceptionr r{ ÚIteratorÚAnyStrr~ rs r r rK rK j s« € € € € € ðð ð Ø$(Ø"*Øð
%ð %à”'˜#Ð1Ð1Ô2ð%ð ð%ð ”*˜S”/ð %ð
”
˜3”ð%ð ð
%ð %ð %ð %ð6* ð *¨¬ð *ð *ð *ð *ðM˜#ð Mð Mð Mð Mð
�a”d˜1œ5”kð ð ð ð ð$ð ð ð ð
ð ð ð ðð ð ð ð#à”*˜QœV MÔ2Ô3ð#ð ”:˜mÔ,ð#ð
ŒJ�}Ô%ð #ð
ð#ð #ð #ð #ð˜!œ* Q¤XÔ.ð ð ð ð ð ð r rK c ó — e Zd Zdej ej ddfd„Zdedej fd„Zdd„Z dej
ej e d ej
e d
ej
e
ddfd„Zdefd„Zdej ej fd
„ZdS )ÚKeepOpenFileÚfiler Nc ó — || _ d S r% )Ú_file)rZ rŽ s r r[ zKeepOpenFile.__init__Ã s
€ Ø"&ˆŒ
ˆ
ˆ
r r c ó, — t | j |¦ « S r% )r] r� r^ s r r_ zKeepOpenFile.__getattr__Æ s € Ý�t”z 4Ñ(Ô(Ð(r c ó — | S r% rs rd s r rt zKeepOpenFile.__enter__É ru r rv rw rx c ó — d S r% rs rz s r r{ zKeepOpenFile.__exit__Ì s € ð
ˆr c ó* — t | j ¦ « S r% )rb r� rd s r re zKeepOpenFile.__repr__Ô ó € Ý�D”JÑÔÐr c ó* — t | j ¦ « S r% )r} r� rd s r r~ zKeepOpenFile.__iter__× r• r )r r� )r€ r� r‚ r( r‡ r† r[ r5 r_ rt r) rˆ r‰ r r{ re rŠ r‹ r~ rs r r r� r�  s € € € € € ð'˜QœT !¤%œ[ð '¨Tð 'ð 'ð 'ð 'ð) ð )¨¬ð )ð )ð )ð )ðð ð ð ð
à”*˜QœV MÔ2Ô3ð
ð ”:˜mÔ,ð
ð
ŒJ�}Ô%ð
ð
ð
ð
ð
ð
ð ˜#ð ð ð ð ð ˜!œ* Q¤XÔ.ð ð ð ð ð ð r r� TFÚmessagerŽ ÚnlÚerrÚcolorc ó — |€#|rt ¦ « }nt ¦ « }|€dS | �2t | t t t
f¦ « st | ¦ « }n| }|r$|pd}t |t ¦ « r|dz
}n|dz
}|s| ¦ « dS t |t t
f¦ « rQt |¦ « }|�?| ¦ « | |¦ « | ¦ « dS n^t |¦ « }t ||¦ « rt |¦ « }n/t r(t �t |¦ « }n|st |¦ « }| |¦ « | ¦ « dS )a Print a message and newline to stdout or a file. This should be
used instead of :func:`print` because it provides better support
for different data, files, and environments.
Compared to :func:`print`, this does the following:
- Ensures that the output encoding is not misconfigured on Linux.
- Supports Unicode in the Windows console.
- Supports writing to binary outputs, and supports writing bytes
to text outputs.
- Supports colors and styles on Windows.
- Removes ANSI color and style codes if the output does not look
like an interactive terminal.
- Always flushes the output.
:param message: The string or bytes to output. Other objects are
converted to strings.
:param file: The file to write to. Defaults to ``stdout``.
:param err: Write to ``stderr`` instead of ``stdout``.
:param nl: Print a newline after the message. Enabled by default.
:param color: Force showing or hiding colors and other styles. By
default Click will remove color if the output does not look like
an interactive terminal.
.. versionchanged:: 6.0
Support Unicode output on the Windows console. Click does not
modify ``sys.stdout``, so ``sys.stdout.write()`` and ``print()``
will still not support Unicode.
.. versionchanged:: 4.0
Added the ``color`` parameter.
.. versionadded:: 3.0
Added the ``err`` parameter.
.. versionchanged:: 2.0
Support colors on Windows if colorama is installed.
Nr<