Format: application/x-python-code
⬇ Download File (1.7 KB)
   1  o
   2  
   3  ��h��@s6dZddlZddlmZe�d�ZGdd�de�ZdS)z)Support for interactive macros in IPython�N)�DEFAULT_ENCODINGz#\s*coding[:=]\s*([-\w.]+)c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
   4  d�ZdS)
   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      cCsjg}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�lineZcoding_match�r�Hc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/macro.py�__init__s
  14  
  15  
  16  zMacro.__init__cCs|jS�N�r�rrrr�__str__&sz
  17  Macro.__str__cCsdt|j�S)NzIPython.macro.Macro(%s))�reprrrrrr�__repr__)szMacro.__repr__cCs
  18  d|jiS)z% needed for safe pickling via %store rrrrrr�__getstate__,s
  19  zMacro.__getstate__cCs6t|t�r
  20  t|j|j�St|t�rt|j|�St�r)rrr�str�	TypeError)r�otherrrr�__add__0s
  21  
  22  
  23  z
  24  Macro.__add__N)	�__name__�
  25  __module__�__qualname__�__doc__rrrrr"rrrrrsr)r&�reZIPython.utils.encodingr�compiler�objectrrrrr�<module>s
  26  	
  27