← Back
Editing: macro.cpython-311.pyc
� �@�c� � �Z � d Z ddlZddlmZ ej d� � Z G d� de� � ZdS )z)Support for interactive macros in IPython� N)�DEFAULT_ENCODINGz#\s*coding[:=]\s*([-\w.]+)c �0 � e Zd ZdZd� Zd� Zd� Zd� Zd� ZdS )�Macroz�Simple class to store the value of macros as strings. Macro is just a callable that executes a string of IPython input when called. c �j � g }d}|� � � D ]I}t � |� � }|r|� d� � }�4|� |� � �Jd� |� � }t |t � � r|� |pt � � }|dz | _ dS )z?store the macro value, as a single string which can be executedN� � )� splitlines�coding_declaration�match�group�append�join� isinstance�bytes�decoder �value)�self�code�lines�enc�line�coding_matchs �4/usr/lib/python3/dist-packages/IPython/core/macro.py�__init__zMacro.__init__ s� � ������O�O�%�%� #� #�D�-�3�3�D�9�9�L�� #�"�(�(��+�+������T�"�"�"�"��y�y������d�E�"�"� 8��;�;�s�6�&6�7�7�D��D�[�� � � � c � � | j S �N�r �r s r �__str__z Macro.__str__&