403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/core/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/core/__pycache__/alias.cpython-311.pyc
�

�@�c2'����dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlmZejd��Z
d	�ZGd
�de��ZGd�d
e��ZGd�de��ZGd�de��ZdS)zE
System command aliases.

Authors:

* Fernando Perez
* Brian Granger
�N)�Configurable�)�
UsageError)�List�Instance)�errorz^(\s*)()(\S+)(.*$)c�:�tjdkrugd�}tj�d��rgd�}nGtj�d��stj�d��rgd�}ngd�}||z}ntjd	vrgd
�}ng}|S)z1Return list of shell aliases to auto-define.
    �posix)��mkdirr��rmdirr)�mvr)�rmr)�cpr)�catr�linux))�lsz
ls -F --color)�llzls -F -o --color)�lfzls -F -o --color %l | grep ^-)�lkzls -F -o --color %l | grep ^l)�ldirzls -F -o --color %l | grep /$)�lxz ls -F -o --color %l | grep ^-..x�openbsd�netbsd))rzls -F)rzls -F -l)rzls -F -l %l | grep ^-)rzls -F -l %l | grep ^l)rzls -F -l %l | grep /$)rzls -F -l %l | grep ^-..x))rzls -F -G)rzls -F -l -G)rzls -F -l -G %l | grep ^-)rzls -F -l -G %l | grep ^l)rzls -F -G -l %l | grep /$)rzls -F -l -G %l | grep ^-..x)�nt�dos))rzdir /on)�ddir�dir /ad /on)rrrr
)�echor )�renr!)�copyr")�os�name�sys�platform�
startswith)�default_aliases�
ls_aliasess  �4/usr/lib/python3/dist-packages/IPython/core/alias.pyr(r((s���
�w�'��������<�"�"�7�+�+�)	����J�J��\�
$�
$�Y�
/�
/�	�3�<�3J�3J�8�3T�3T�	����J�J����J�*�J�6���	��M�	!�	!����������c��eZdZdS)�
AliasErrorN��__name__�
__module__�__qualname__�r+r*r-r-q��������Dr+r-c��eZdZdS)�InvalidAliasErrorNr.r2r+r*r5r5ur3r+r5c�4�eZdZdZhd�Zd�Zd�Zd�Zd	d�ZdS)
�Aliasz�Callable object storing the details of one alias.

    Instances are registered as magic functions to allow use of aliases.
    >�cd�popd�alias�dhist�pushd�unaliasc��||_||_||_d�|��|_|���|_dS)NzAlias for `!{}`)�shellr$�cmd�format�__doc__�validate�nargs)�selfr?r$r@s    r*�__init__zAlias.__init__�s?����
���	����(�/�/��4�4����]�]�_�_��
�
�
r+c�B�|j|jvrtd|jz���	|jjjd|j}t
|t��std|jz���n#t$rYnwxYwt
|j	t��std|j	z���|j	�d��|j	�d��z
}|dkr-|j	�d��dkrtd	���|S)
z7Validate the alias, and return the number of arguments.z@The name %s can't be aliased because it is a keyword or builtin.�linezAThe name %s can't be aliased because it is another magic command.z*An alias command must be a string, got: %r�%s�%%sr�%lzEThe %s and %l specifiers are mutually exclusive in alias definitions.)
r$�	blacklistr5r?�magics_manager�magics�
isinstancer7�KeyErrorr@�str�count�find)rE�callerrDs   r*rCzAlias.validate�s\���9���&�&�#�%J�LP�I�%V�W�W�
W�	\��Z�.�5�f�=�d�i�H�F��f�e�,�,�
\�'�)O�QU�QZ�)[�\�\�\�
\���	�	�	��D�	�����4�8�S�)�)�	:�#�%.�04��%9�:�:�
:�����t�$�$�t�x�~�~�e�'<�'<�<���A�I�I�D�H�M�M�$�/�/�1�4�4�#�%F�G�G�
G��s�"A6�6
B�Bc�B�d�|j|j��S)Nz<alias {} for {!r}>)rAr$r@�rEs r*�__repr__zAlias.__repr__�s��$�+�+�D�I�t�x�@�@�@r+�c
�N�|j}|j}|�d��dkr|�d|��}d}|dkr7|�d��dkr|�dd��}|�d|��}n�|�d|��}t|��|kr+t
d|j�d	|�d
t|���d����|t|d|���z�dd�	||d�����}|j
�|��dS)NrKrrXrJrrI� zAlias <z> requires z arguments, z given.)r@rDrS�replace�split�lenrr$�tuple�joinr?�system)rE�restr@rD�argss     r*�__call__zAlias.__call__�s2���h���
���8�8�D�>�>�Q����+�+�d�D�)�)�C��D��!�8�8��x�x����!�#�#��k�k�%��.�.�� �S�S�$�$�'�C�C��:�:�d�E�*�*�D��4�y�y�5� � � �j��y�y�y�%�%�%��T�����"4�5�5�5� �5��f�u�f��#6�#6�6�6�6�s�x�x��U�V�V��7M�7M�7M�N�C��
���#�����r+N)rX)	r/r0r1rBrLrFrCrWrcr2r+r*r7r7xsp��������@�?�?�I�%�%�%����4A�A�A������r+r7c���eZdZee�����d���Zeg����d���Zedd���Zd�fd�	Z	d�Z
ed	���Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Z�xZS)�AliasManagerT)�config)�
default_valuez1IPython.core.interactiveshell.InteractiveShellABC)�
allow_noneNc���tt|��jdd|i|��|jjjd|_|���dS)Nr?rHr2)�superrerFr?rMrN�
linemagics�init_aliases)rEr?�kwargs�	__class__s   �r*rFzAliasManager.__init__�sW���*��l�D�!�!�*�A�A��A�&�A�A�A��*�3�:�6�B����������r+c���|j|jzD]V\}}|�d��r&|jjdkr|�dd��}|�||���WdS)Nzls �NoColorz --colorrX)r(�user_aliasesr'r?�colorsr[�soft_define_alias�rEr$r@s   r*rlzAliasManager.init_aliases�sy���-��0A�A�	.�	.�I�D�#��~�~�e�$�$�
2���):�i�)G�)G��k�k�*�b�1�1���"�"�4��-�-�-�-�	.�	.r+c�H�d�|j���D��S)Nc�P�g|]#\}}t|t���||jf��$Sr2)rOr7r@)�.0�n�funcs   r*�
<listcomp>z(AliasManager.aliases.<locals>.<listcomp>�s@��8�8�8�)�1�d�)�$��6�6�8��D�H�
�8�8�8r+)rk�itemsrVs r*�aliaseszAliasManager.aliases�s0��8�8�t��/D�/D�/F�/F�8�8�8�	8r+c��	|�||��dS#t$r}td|z��Yd}~dSd}~wwxYw)z2Define an alias, but don't raise on an AliasError.zInvalid alias: %sN)�define_aliasr-r)rEr$r@�es    r*rszAliasManager.soft_define_alias�sh��	+����d�C�(�(�(�(�(���	+�	+�	+��%��)�*�*�*�*�*�*�*�*�*�����	+���s��
A�<�Ac�x�t|j||���}|jj�|d|���dS)z�Define a new alias after validating it.

        This will raise an :exc:`AliasError` if there are validation
        problems.
        )r?r$r@rH)�
magic_kind�
magic_nameN)r7r?rM�register_function)rEr$r@rTs    r*r~zAliasManager.define_alias�sR���T�Z�d��<�<�<���
�!�3�3�F�v�?C�	4�	E�	E�	E�	E�	Er+c�j�|j�|d��}t|t��r|ndS)z9Return an alias, or None if no alias by that name exists.N)rk�getrOr7)rEr$�anames   r*�	get_aliaszAliasManager.get_alias�s2����#�#�D�$�/�/��"�5�%�0�0�:�u�u�d�:r+c�0�|�|��duS)z?Return whether or not a given name has been defined as an aliasN)r��rEr$s  r*�is_aliaszAliasManager.is_alias�s���~�~�d�#�#�4�/�/r+c�d�|�|��r
|j|=dStd|z���)N�%s is not an alias)r�rk�
ValueErrorr�s  r*�undefine_aliaszAliasManager.undefine_alias�s:���=�=����	:����%�%�%��1�D�8�9�9�9r+c�J�|jD]\}}|�|���dS�N)r|r�rts   r*�
clear_aliaseszAliasManager.clear_aliases�s8����	&�	&�I�D�#�����%�%�%�%�	&�	&r+c�b�|�|��}|r|jStd|z���)z/Retrieve the command to which an alias expands.r�)r�r@r�)rEr$rTs   r*�retrieve_aliaszAliasManager.retrieve_alias�s7������%�%���	:��:���1�D�8�9�9�9r+r�)r/r0r1rr(�tagrqrr?rFrl�propertyr|rsr~r�r�r�r�r��
__classcell__)rns@r*rere�s4��������d�?�?�,�,�-�-�1�1��1�>�>�O��4�b�)�)�)�-�-�T�-�:�:�L��H�H�UY�Z�Z�Z�E�������.�.�.��8�8��X�8�+�+�+�E�E�E�;�;�;�
0�0�0�:�:�:�&�&�&�:�:�:�:�:�:�:r+re)rBr#�rer%�traitlets.config.configurablerrr�	traitletsrr�logging�compile�shell_line_splitr(�	Exceptionr-r5�objectr7rer2r+r*�<module>r�sg����*
�	�	�	�	�	�	�	�
�
�
�
�6�6�6�6�6�6�������$�$�$�$�$�$�$�$��������2�:�3�4�4��F�F�F�R	�	�	�	�	��	�	�	�	�	�	�	�	�
�	�	�	�B�B�B�B�B�F�B�B�B�PB:�B:�B:�B:�B:�<�B:�B:�B:�B:�B:r+

Youez - 2016 - github.com/yon3zu
LinuXploit