Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/click/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/click/__pycache__/utils.cpython-310.pyc
o

�+caGI�@s�ddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZejrgddlZejdejdejfd�Zdedefdd�Zdedefdd�Zdejdefdd�Z dWded e!defd!d"�Z"Gd#d$�d$�Z#Gd%d&�d&�Z$			'	(	dXd)ej%ejd*ej%ej&d+e'd,e'd-ej%e'ddfd.d/�Z(dd0dej)fd1d2�Z*		3dYdd0d4ej%ed5ej%edej+fd6d7�Z,	8		3	(	(dZd9ed:ed4ej%ed5ej%ed;e'd<e'dej&fd=d>�Z-dej.efd?d@�Z/	(d[d9ej0ee1ej2fdAe'defdBdC�Z3d\dDedEe'dFe'defdGdH�Z4GdIdJ�dJ�Z5dej6dKfdLej%edMedefdNdO�Z7d'd'd'dP�dQej8edRe'dSe'dTe'dej9ef
dUdV�Z:dS)]�N)�update_wrapper)�
ModuleType�)�_default_text_stderr)�_default_text_stdout)�_find_binary_writer)�auto_wrap_for_ansi)�binary_streams)�get_filesystem_encoding)�open_stream)�should_strip_ansi)�
strip_ansi)�text_streams)�WIN)�resolve_color_default�F.)�bound�name�returncCsd�|�����S)N�-)�join�split�lower)r�r�-/usr/lib/python3/dist-packages/click/utils.py�	_posixifysr�funccs�fdd�}tt�t|���S)z0Wraps a function so that it swallows exceptions.cs&z�|i|��WStyYdSw�N)�	Exception)�args�kwargs�rrr�wrapper!s
�zsafecall.<locals>.wrapper)r�t�castr)rr"rr!r�safecallsr%�valuecCs@t|t�rz|�t��WSty|�dd�YSwt|�S)z%Converts a value into a valid string.zutf-8�replace)�
isinstance�bytes�decoder
�UnicodeError�str)r&rrr�make_str*s
�r-�-�help�
max_lengthcCs(|�d�}|dkr|d|�}|��}|sdS|ddkr#|dd�}d}t|�d}t|�D]1\}}|t|�|dk7}||krCn#|ddkrVd	�|d|d��S||kr`||kr`nq/d	�|�S|td
�7}|dkr�|t||�|dk8}||kr�n|d8}|dkspd	�|d|��d
S)z+Returns a condensed version of help string.z

���N�r�r�.� z...)�findr�len�	enumerater)r/r0�
paragraph_end�words�total_length�
last_index�i�wordrrr�make_default_short_help4s8
�
�r?c@s�eZdZdZ				ddededejed	ejed
ef
dd�Zd
edej	fdd�Z
defdd�Zdejfdd�Z
d dd�Zd dd�Zd!dd�Zdd�Zdejejfdd�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�filename�mode�encoding�errors�atomiccCsj||_||_||_||_||_||dkr"t||||�\|_|_dSd|vr-t||��	�d|_d|_dS)NrrAT)
rrDrErFrGr�_f�should_close�open�close)�selfrCrDrErFrGrrr�__init__ms
zLazyFile.__init__rrcCst|��|�Sr)�getattrrJ�rLrrrr�__getattr__�szLazyFile.__getattr__cCs*|jdur
t|j�Sd|j�d|j�d�S)Nz<unopened file 'z' �>)rH�reprrrD�rLrrr�__repr__�s

zLazyFile.__repr__c
Csx|jdur|jSzt|j|j|j|j|jd�\}|_Wnty6}zddl	m
}||j|jd�|�d}~ww||_|S)z�Opens 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�rGr)�	FileError)�hint)rHrrrDrErFrGrI�OSError�
exceptionsrV�strerror)rL�rv�erVrrrrJ�s
���z
LazyFile.opencCs|jdur|j��dSdS)z+Closes the underlying file, no matter what.N)rHrKrSrrrrK�s
�zLazyFile.closecCs|jr	|��dSdS)z�This function only closes the file if it was opened by the lazy
        file wrapper.  For instance this will never close stdin.
        N)rIrKrSrrr�close_intelligently�s�zLazyFile.close_intelligentlycC�|SrrrSrrr�	__enter__��zLazyFile.__enter__cCs|��dSr)r]�rL�exc_type�	exc_value�tbrrr�__exit__��zLazyFile.__exit__cCs|��t|j�Sr)rJ�iterrHrSrrr�__iter__�s
zLazyFile.__iter__)rANrBF�rN)rr@)�__name__�
__module__�__qualname__�__doc__r,r#�Optional�boolrM�AnyrPrT�IOrJrKr]r_re�Iterator�AnyStrrhrrrrr@fs2	�����
�


r@c@sjeZdZdejddfdd�Zdedejfdd�Zdd	d
�Z	dd�Z
defd
d�Zdejej
fdd�ZdS)�KeepOpenFile�filerNcC�
||_dSr)�_file)rLrurrrrM��
zKeepOpenFile.__init__rcC�t|j|�Sr)rNrwrOrrrrP�rfzKeepOpenFile.__getattr__cCr^rrrSrrrr_�r`zKeepOpenFile.__enter__cCsdSrrrarrrre�r`zKeepOpenFile.__exit__cC�
t|j�Sr)rRrwrSrrrrT�rxzKeepOpenFile.__repr__cCrzr)rgrwrSrrrrh�rxzKeepOpenFile.__iter__)rrt)rjrkrlr#rqrMr,rprPr_rerTrrrsrhrrrrrt�s
rtTF�messageru�nl�err�colorcCs
|dur
|r
t�}nt�}|durt|tttf�st|�}n|}|r4|p%d}t|t�r0|d7}n|d7}|s<|��dSt|ttf�r[t|�}|durZ|��|�|�|��dSnt	|�}t
||�rit|�}ntrzt
durtt
|�}n|szt|�}|�|�|��dS)aPrint 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.
    Nr2�
�
)rrr(r,r)�	bytearray�flushr�writerrr
rr)r{rur|r}r~�out�binary_filerrr�echo�sB-



�	



r�z'te.Literal['stdin', 'stdout', 'stderr']cCs(t�|�}|durtd|�d���|�S)z�Returns a system stream for byte processing.

    :param name: the name of the stream to open.  Valid names are ``'stdin'``,
                 ``'stdout'`` and ``'stderr'``
    N�Unknown standard stream '�')r	�get�	TypeError)r�openerrrr�get_binary_stream.s
r�rBrErFcCs,t�|�}|durtd|�d���|||�S)a�Returns a system stream for text processing.  This usually returns
    a wrapped stream around a binary stream returned from
    :func:`get_binary_stream` but it also can take shortcuts for already
    correctly configured streams.

    :param name: the name of the stream to open.  Valid names are ``'stdin'``,
                 ``'stdout'`` and ``'stderr'``
    :param encoding: overrides the detected default encoding.
    :param errors: overrides the default error mode.
    Nr�r�)rr�r�)rrErFr�rrr�get_text_stream:s

r�rArCrD�lazyrGc
CsP|rt�tjt|||||d��St|||||d�\}}|s&t�tjt|��}|S)a�This is similar to how the :class:`File` works but for manual
    usage.  Files are opened non lazy by default.  This can open regular
    files as well as stdin/stdout if ``'-'`` is passed.

    If stdin/stdout is returned the stream is wrapped so that the context
    manager will not close the stream accidentally.  This makes it possible
    to always use the function like this without having to worry to
    accidentally close a standard stream::

        with open_file(filename) as f:
            ...

    .. versionadded:: 3.0

    :param filename: the name of the file to open (or ``'-'`` for stdin/stdout).
    :param mode: the mode in which to open the file.
    :param encoding: the encoding to use.
    :param errors: the error handling for this file.
    :param lazy: can be flipped to true to open the file lazily.
    :param atomic: in atomic mode writes go into a temporary file and it's
                   moved on close.
    rU)r#r$rqr@rrt)rCrDrErFr�rG�frIrrr�	open_fileOsr�cCs&ddl}|jdtdd�tjdd�S)z�Returns the argument part of ``sys.argv``, removing the first
    value which is the name of the script.

    .. deprecated:: 8.0
        Will be removed in Click 8.1. Access ``sys.argv[1:]`` directly
        instead.
    rNze'get_os_args' is deprecated and will be removed in Click 8.1. Access 'sys.argv[1:]' directly instead.�)�
stacklevelr)�warnings�warn�DeprecationWarning�sys�argv)r�rrr�get_os_argsus�r��shortencCs|rtj�|�}t�|�S)aKFormats a filename for user display.  The main purpose of this
    function is to ensure that the filename can be displayed at all.  This
    will decode the filename to unicode if necessary in a way that it will
    not fail.  Optionally, it can shorten the filename to not include the
    full path to the filename.

    :param filename: formats a filename for UI display.  This will also convert
                     the filename into unicode without failing.
    :param shorten: this optionally shortens the filename to strip of the
                    path that leads up to it.
    )�os�path�basename�fsdecode)rCr�rrr�format_filename�s
r��app_name�roaming�force_posixcCs�tr|rdnd}tj�|�}|durtj�d�}tj�||�S|r0tj�tj�dt|�����Stj	dkr@tj�tj�d�|�Stj�tj�dtj�d	��t|��S)
a�Returns the config folder for the application.  The default behavior
    is to return whatever is most appropriate for the operating system.

    To give you an idea, for an app called ``"Foo Bar"``, something like
    the following folders could be returned:

    Mac OS X:
      ``~/Library/Application Support/Foo Bar``
    Mac OS X (POSIX):
      ``~/.foo-bar``
    Unix:
      ``~/.config/foo-bar``
    Unix (POSIX):
      ``~/.foo-bar``
    Windows (roaming):
      ``C:\Users\<user>\AppData\Roaming\Foo Bar``
    Windows (not roaming):
      ``C:\Users\<user>\AppData\Local\Foo Bar``

    .. versionadded:: 2.0

    :param app_name: the application name.  This should be properly capitalized
                     and can contain whitespace.
    :param roaming: controls if the folder should be roaming or not on Windows.
                    Has no affect otherwise.
    :param force_posix: if this is set to `True` then on any POSIX system the
                        folder will be stored in the home folder with a leading
                        dot instead of the XDG config home or darwin's
                        application support folder.
    �APPDATA�LOCALAPPDATAN�~z~/.�darwinz~/Library/Application Support�XDG_CONFIG_HOMEz	~/.config)
rr��environr�r��
expanduserrrr��platform)r�r�r��key�folderrrr�get_app_dir�s 
��r�c@sBeZdZdZdejddfdd�Zddd�Zd	edej	fd
d�Z
dS)
�PacifyFlushWrappera�This wrapper is used to catch and suppress BrokenPipeErrors resulting
    from ``.flush()`` being called on broken pipe during the shutdown/final-GC
    of the Python interpreter. Notably ``.flush()`` is always called on
    ``sys.stdout`` and ``sys.stderr``. So as to have minimal impact on any
    other cleanup code, and the case where the underlying file is not a broken
    pipe, all calls and attributes are proxied.
    �wrappedrNcCrvr)r�)rLr�rrrrM�rxzPacifyFlushWrapper.__init__c
CsNz|j��WdSty&}zddl}|j|jkr�WYd}~dSd}~ww)Nr)r�r�rX�errno�EPIPE)rLr\r�rrrr��s���zPacifyFlushWrapper.flush�attrcCryr)rNr�)rLr�rrrrP�rfzPacifyFlushWrapper.__getattr__ri)rjrkrlrmr#rqrMr�r,rprPrrrrr��s

	r��__main__r��_maincCs�|stjd}t|dd�dus(tjdkr.|jdkr.tj�|�s.tj�|�d��r.tj�|�St	�
t|j�}tj�tj�|��d}|dkrL|�d|��}d	|�
d���S)
a:Determine the command used to run the program, for use in help
    text. If a file or entry point was executed, the file name is
    returned. If ``python -m`` was used to execute a module or package,
    ``python -m name`` is returned.

    This doesn't try to be too precise, the goal is to give a concise
    name for help text. Files are only shown as their name without the
    path. ``python`` is only shown for modules, and the full path to
    ``sys.executable`` is not shown.

    :param path: The Python file being executed. Python puts this in
        ``sys.argv[0]``, which is used by default.
    :param _main: The ``__main__`` module. This should only be passed
        during internal testing.

    .. versionadded:: 8.0
        Based on command args detection in the Werkzeug reloader.

    :meta private:
    r�__package__N�ntr2z.exer�r4z
python -m )r�r�rNr�rr�r��existsr�r#r$r,�splitext�lstrip)r�r��	py_modulerrrr�_detect_program_name�s



��r�)�user�env�glob_recursiverr�r�r�cCsdddlm}g}|D]%}|rtj�|�}|rtj�|�}|||d�}|s*|�|�q
|�|�q
|S)a)Simulate Unix shell expansion with Python functions.

    See :func:`glob.glob`, :func:`os.path.expanduser`, and
    :func:`os.path.expandvars`.

    This intended for use on Windows, where the shell does not do any
    expansion. It may not exactly match what a Unix shell would do.

    :param args: List of command line arguments to expand.
    :param user: Expand user home directory.
    :param env: Expand environment variables.
    :param glob_recursive: ``**`` matches directories recursively.

    .. versionadded:: 8.0

    :meta private:
    r)�glob)�	recursive)r�r�r�r��
expandvars�append�extend)rr�r�r�r�r��arg�matchesrrr�_expand_argssr�)r.)NNTFN)NrB)rANrBFF)F)TF);r�r��typingr#�	functoolsr�typesr�_compatrrrrr	r
rrr
rr�globalsr�
TYPE_CHECKING�typing_extensions�te�TypeVar�Callablerprr,rr%r-�intr?r@rtrnrqror��BinaryIOr��TextIOr�r��Sequencer��Unionr)�PathLiker�r�r��modulesr��Iterable�Listr�rrrr�<module>s�
2R�
�
����
�b����
��������
�&���
�1
���
�6������

Spamworldpro Mini