Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/core/__pycache__/splitinput.cpython-39.pyc
Ðазад
a o�h� � @ sd d Z ddlZddlZddlmZ ddlmZ ddlmZ e� dej �Zddd�ZG d d � d e �ZdS )z� Simple utility for splitting user input. This is used by both inputsplitter and prefilter. Authors: * Brian Granger * Fernando Perez � N)� py3compat)�get_stream_enc)�OInfoaV ^(\s*) # any leading space ([,;/%]|!!?|\?\??)? # escape character or characters \s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading % # to correctly treat things like '?%magic' (.*?$|$) # rest of line c C s� t tjd�}t�| |�} |du r$t}|�| �}|s~z| �dd�\}}W n tyb | d }}Y n0 t �d| �� � d }d}n|� � \}}}}||p�d|�� |�� fS )z`Split user input into initial whitespace, escape character, function part and the rest. zutf-8N� � z ^(\s*)(.*)r ) r �sys�stdinr Zcast_unicode� line_split�match�split� ValueError�re�groups�strip�lstrip)�line�pattern�encodingr �ifun�the_rest�pre�esc� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/core/splitinput.py�split_user_input6 s r c @ s0 e Zd ZdZddd�Zed�dd�Zdd � Zd S )�LineInfoa= A single line of input and associated info. Includes the following as properties: line The original, raw line continue_prompt Is this line a continuation in a sequence of multiline input? pre Any leading whitespace. esc The escape character(s) in pre or the empty string if there isn't one. Note that '!!' and '??' are possible values for esc. Otherwise it will always be a single character. ifun The 'function part', which is basically the maximal initial sequence of valid python identifiers and the '.' character. This is what is checked for alias and magic transformations, used for auto-calling, etc. In contrast to Python identifiers, it may start with "%" and contain "*". the_rest Everything else on the line. Fc C sJ || _ || _t|�\| _| _| _| _| j�� | _| jr>d| _ n| j| _ d S )Nr ) r �continue_promptr r r r r r Zpre_charZpre_whitespace)�selfr r r r r �__init__o s zLineInfo.__init__)�returnc C s |� | j�S )a Do a full, attribute-walking lookup of the ifun in the various namespaces for the given IPython InteractiveShell instance. Return a dict with keys: {found, obj, ospace, ismagic} Note: can cause state changes because of calling getattr, but should only be run if autocall is on and if the line hasn't matched any other, less dangerous handlers. Does cache the results of the call, so can be called multiple times without worrying about *further* damaging state. )Z_ofindr )r �ipr r r �ofindz s zLineInfo.ofindc C s d| j | j| j| jf S )NzLineInfo [%s|%s|%s|%s])r r r r )r r r r �__str__� s zLineInfo.__str__N)F)�__name__� __module__�__qualname__�__doc__r r r! r"