Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/core/__pycache__/inputtransformer.cpython-39.pyc
Ðазад
a o�hG � @ s� d Z ddlZddlZddlZddlZddlmZmZ ddlmZ ddl m Z ddlmZ dZ dZd Zd ZdZdZd ZdZdZe eeeeeeeeg ZG dd� dejd�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zejdd� �Zeeeed�dd�Z e d �d!d"�Z!e d �d#d$�Z"e d �d%d&�Z#e d �d'd(�Z$e d �d)d*�Z%e d �d+d,�Z&e d �d-d.�Z'e e!ee"ee#ee#ee$ee%ee&ee'iZ(ejed/�d0d1��Z)e�*d2�Z+e�*d3ej,�Z-e.� Z/e.� Z0d4d5� Z1d6d7� Z2d8d9� Z3ejed/�d:d;��Z4ejdQe5d=�d>d?��Z6dRd@dA�Z7ejdBdC� �Z8ejdDdE� �Z9ejdFdG� �Z:dHZ;e�*dI�<e;�ej,�Z=dJZ>ejdKdL� �Z?e�*dM�<e;�ej,�Z@dNZAejdOdP� �ZBdS )Sa, DEPRECATED: Input transformer classes to support IPython special syntax. This module was deprecated in IPython 7.0, in favour of inputtransformer2. This includes the machinery to recognise and transform ``%magic`` commands, ``!system`` commands, ``help?`` querying, prompt stripping, and so forth. � N)� untokenize� TokenError)�StringIO)�LineInfo)� tokenutil�!z!!�?�??�%z%%�,�;�/c @ s8 e Zd ZdZejdd� �Zejdd� �Zedd� �Z dS ) �InputTransformerz6Abstract base class for line-based input transformers.c C s dS )a1 Send a line of input to the transformer, returning the transformed input or None if the transformer is waiting for more input. Must be overridden by subclasses. Implementations may raise ``SyntaxError`` if the input is invalid. No other exceptions may be raised. N� ��self�liner r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/core/inputtransformer.py�push. s zInputTransformer.pushc C s dS )z�Return, transformed any lines that the transformer has accumulated, and reset its internal state. Must be overridden by subclasses. Nr �r r r r �reset: s zInputTransformer.resetc s t ���� �fdd��}|S )z�Can be used by subclasses as a decorator, to return a factory that will allow instantiation with the decorated object. c s � �fi | ��S �Nr )�kwargs��cls�funcr r �transformer_factoryH s z2InputTransformer.wrap.<locals>.transformer_factory)� functools�wraps)r r r r r r �wrapC s zInputTransformer.wrapN) �__name__� __module__�__qualname__�__doc__�abc�abstractmethodr r �classmethodr r r r r r + s r )� metaclassc @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd S )�StatelessInputTransformerzDWrapper for a stateless input transformer implemented as a function.c C s || _ d S r �r �r r r r r �__init__P s z"StatelessInputTransformer.__init__c C s d� | j�S )Nz%StatelessInputTransformer(func={0!r}))�formatr r r r r �__repr__S s z"StatelessInputTransformer.__repr__c C s | � |�S )zQSend a line of input to the transformer, returning the transformed input.r) r r r r r V s zStatelessInputTransformer.pushc C s dS )z!No-op - exists for compatibility.Nr r r r r r [ s zStatelessInputTransformer.resetN�r r! r"