Hacked By AnonymousFox

Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/cmd.cpython-39.opt-2.pyc

a

R�f:�@s<ddlZddlZdgZdZejejdZGdd�d�ZdS)�N�Cmdz(Cmd) �_c@s�eZdZeZeZdZdZdZ	dZ
dZdZdZ
dZdZd/d
d�Zd0dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Z d1d-d.�Z!dS)2r�=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dur||_ntj|_|dur(||_ntj|_g|_||_dS�N)�stdin�sys�stdout�cmdqueue�completekey)�selfr
r	r�r�(/opt/alt/python39/lib64/python3.9/cmd.py�__init__LszCmd.__init__cCs�|��|jrZ|jrZz2ddl}|��|_|�|j�|�|jd�Wnt	yXYn0�z|durl||_
|j
r�|j�t
|j
�d�d}|�s2|jr�|j�d�}nj|jr�zt|j�}Wnty�d}Yn0n<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W|j�r�|j�r�zddl}|�|j�Wnt	�yxYn0n@|j�r�|j�r�zddl}|�|j�Wnt	�y�Yn00dS)Nrz
: complete�
�EOFz
)�preloop�use_rawinputr
�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror�write�strr�pop�input�prompt�EOFError�flushr	�len�rstrip�precmd�onecmd�postcmd�postloop)rrr�stop�linerrr�cmdloopbsZ







�zCmd.cmdloopcCs|Srr�rr)rrrr$�sz
Cmd.precmdcCs|Srr)rr(r)rrrr&�szCmd.postcmdcCsdSrr�rrrrr�szCmd.preloopcCsdSrrr,rrrr'�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jvr�|d}qt|d|�||d���}}|||fS)Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr"�
identchars)rr)�i�n�cmd�argrrr�	parseline�s


 z
Cmd.parselinecCs�|�|�\}}}|s|��S|dur.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wnty�|�|�YS0||�SdS)Nrr�do_)r6�	emptyline�default�lastcmd�getattr�AttributeError)rr)r4r5�funcrrrr%�s


z
Cmd.onecmdcCs|jr|�|j�SdSr)r:r%r,rrrr8�sz
Cmd.emptylinecCs|j�d|�dS)Nz*** Unknown syntax: %s
)rrr+rrrr9�szCmd.defaultcGsgSrr)r�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr7cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>��z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r�textr>rrFr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	y�|j}Yq�0n|j
}|||||�|_z|j|WSty�YdS0dS)NrrZ	complete_)
rZget_line_buffer�lstripr"Z
get_begidxZ
get_endidxr6r?r;r<rKZcompletion_matches�
IndexError)
rrJ�staterZorigliner)�strippedZbegidxZendidxr4�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�Sr)�dir�	__class__r,rrrrIsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�NrArC�rPrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrKrI�list)rrPZcommandsZtopicsrrUr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wnxty�z4t|d|�j}|rV|j�dt|��WYdSWntyjYn0|j�dt|j|f��YdS0|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|v�r4|�	|
�||
=q�t||�j�rN|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|dd	�|�|j
t|���dd	�|�|j|dd	�dS)
NrSr7�%s
rTrrr@��P)r;r<�__doc__rrr�nohelprI�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrX�keys�undoc_header)rr5r=�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer4rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrZrr)rrr�rulerr"�	columnize)r�headerZcmdsZcmdlenZmaxcolrrrrbRszCmd.print_topicsr\cs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d��dStdt���D]�}||d|}g}d	}t|�D]h}	d}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d
7}||kr��qq�||kr��q4q�t��}d}dg}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d�s�|d=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd
�|����q<dS)Nz<empty>
csg|]}t�|t�s|�qSr)�
isinstancer)rDr2�rXrrrGds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrZr����r���z  )rr�ranger"�	TypeError�join�mapr�maxr`�ljust)rrXZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr2�xZtextsrrprrmZs\�


z
Cmd.columnize)rNN)N)r\)"�__name__�
__module__�__qualname__�PROMPTr�
IDENTCHARSr1rlr:rrarcrdrfr^rrr*r$r&rr'r6r%r8r9r?rKrrIrYrkrbrmrrrrr4s:

4
		.)�stringr
�__all__r�Z
ascii_lettersZdigitsr�rrrrr�<module>-s

Hacked By AnonymousFox1.0, Coded By AnonymousFox