Format: application/x-python-code
1 o
2
3 ��h� � @ s6 d Z ddlZddlmZ e�d�ZG dd� de�ZdS )z)Support for interactive macros in IPython� N)�DEFAULT_ENCODINGz#\s*coding[:=]\s*([-\w.]+)c @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
4 d� ZdS )
5 �Macroz�Simple class to store the value of macros as strings.
6
7 Macro is just a callable that executes a string of IPython
8 input when called.
9 c C sj g }d}|� � D ]}t�|�}|r|�d�}q|�|� qd�|�}t|t�r.|�|p,t �}|d | _
10 dS )z?store the macro value, as a single string which can be executedN� �
11 )�
12 splitlines�coding_declaration�match�group�append�join�
13 isinstance�bytes�decoder �value)�self�code�lines�enc�lineZcoding_match� r �Hc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/macro.py�__init__ s
14
15
16 zMacro.__init__c C s | j S �N�r �r r r r �__str__&