Format: application/x-python-code
1 o
2
3 ��h� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
4 Z
5 ddd�Zd d
6 d �Zd!dd�Z
7 d"dd�Zd#dd�Zd$dd�Zd%dd�Zd&dd�Zd'dd�Zd(dd�Zd)dd�ZdS )*z� 'editor' hooks for common editors that work well with ipython
8
9 They should honor the line number argument, at least.
10
11 Contributions are *very* welcome.
12 � N)�get_ipython)�TryNext)� py3compatFc s* d� �fdd� }t � �d|� � t � _dS )ay Installs the editor that is called by IPython for the %edit magic.
13
14 This overrides the default editor, which is generally set by your EDITOR
15 environment variable or is notepad (windows) or vi (linux). By supplying a
16 template string `run_template`, you can control how the editor is invoked
17 by IPython -- (e.g. the format in which it accepts command line options)
18
19 Parameters
20 ----------
21 template : basestring
22 run_template acts as a template for how your editor is invoked by
23 the shell. It should contain '{filename}', which will be replaced on
24 invocation with the file name, and '{line}', $line by line number
25 (or 0) to invoke the file with.
26 wait : bool
27 If `wait` is true, wait until the user presses enter before returning,
28 to facilitate non-blocking editors that exit immediately after
29 the call.
30 r c sv |d u rd}� j t�|�|d�}td|� tj�d�r t�|�}tj |dd�}|�
31 � dkr0t� ��r9t�
32 d� d S d S )Nr )�filename�line�>�winT)�shellzPress Enter when done editing:)�format�shlex�quote�print�sys�platform�
33 startswith�split�
34 subprocess�Popen�waitr r �input)�selfr r �cmd�proc��templater � �Mc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/lib/editorhooks.py�call_editor. s
35
36 �z#install_editor.<locals>.call_editor�editorN)r )r Zset_hookr )r r r r r r �install_editor s r �komodoc C s t | d dd� dS )z Activestate Komodo [Edit] z -l {line} {filename}T)r N�r ��exer r r r B s �scitec C � t | d � dS )z SciTE or Sc1 z {filename} -goto:{line}Nr! r"