← Back
Editing: embed.cpython-311.pyc
� �@�ct; � �. � d Z ddlZddlZddlmZmZ ddlmZ ddlmZm Z m Z ddlmZm Z ddlmZ ddlmZ dd lmZmZmZ dd lmZ ddlmZ G d� d e� � ZeZe G d� de� � � � Z G d� d� � Z G d� de� � Zddd�d�Z dS )z An embedded IPython shell. � N)�ultratb� compilerop)�magic_arguments)�Magics�magics_class� line_magic)�DummyMod�InteractiveShell)�TerminalInteractiveShell)�load_default_config)�Bool�CBool�Unicode)� ask_yes_no)�Setc � � e Zd ZdS )�KillEmbeddedN)�__name__� __module__�__qualname__� � �8/usr/lib/python3/dist-packages/IPython/terminal/embed.pyr r s � � � � � � � r r c � � e Zd Ze ej � � ej dddd�� � ej dddd�� � ej d d dd�� � dd �� � � � � � � � � � Zedd�� � ZdS )�EmbeddedMagicsz-iz --instance� store_truez&Kill instance instead of call location)�action�helpz-xz--exitzAlso exit the current sessionz-yz--yeszDo not ask confirmation� c � � t j | j |� � }t |� � |j rE|j st dd� � }nd}|r(| j � � � t d� � n7|j st dd� � }nd}|rd| j _ t d� � |j r| j � � � dS dS ) a# %kill_embedded : deactivate for good the current embedded IPython This function (after asking for confirmation) sets an internal flag so that an embedded IPython will never activate again for the given call location. This is useful to permanently disable a shell that is being called inside a loop: once you've figured out what you needed from it, you may then kill it and the program will then continue to run without the interactive shell interfering again. Kill Instance Option: If for some reasons you need to kill the location where the instance is created and not called, for example if you create a single instance in one place and debug in many locations, you can use the ``--instance`` option to kill this specific instance. Like for the ``call location`` killing an "instance" should work even if it is recreated within a loop. .. note:: This was the default behavior before IPython 5.2 z<Are you sure you want to kill this embedded instance? [y/N] �nTzIThis embedded IPython instance will not reactivate anymore once you exit.zAAre you sure you want to kill this embedded call_location? [y/N] FzOThis embedded IPython call location will not reactivate anymore once you exit.N)r �parse_argstring� kill_embedded�print�instance�yesr �shell�_disable_init_location�embedded_active�exit�ask_exit)�self�parameter_s�args�kills r r# zEmbeddedMagics.kill_embedded"