+
    ^|i                         R t ^ RIHt ^ RIt^ RIt^ RIHtHt ^ RIH	t	H
t
Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ]P*                  R	3R
 lt]
 ! R R]	4      4       tR# )zExtra magics for terminal use.)errorN)TryNext
UsageError)Magicsmagics_class
line_magic)ClipboardEmpty)skip_doctest)SListstrip_email_quotes)	py3compatFc              #     "   V'       g   \        RV ,          4       RpMRp  V! V4      pW@8X  d   R# Vx  K    \         d    \        R4        R# i ; i5i)zGYield pasted lines until the user enters the given sentinel value.
    zAPasting code; enter '%s' alone on the line to stop or use Ctrl-D.: Nz<EOF>)printEOFError)sentinell_inputquietpromptls   &&&  9/usr/lib/python3/dist-packages/IPython/terminal/magics.pyget_pasted_linesr      s]      Q 	
	A} 	'N	s.   !A: A: AAAAAc                      a a ] tR t^'t oV 3R ltRR ltR tRR lt]RR l4       t	]
]RR l4       4       t]RR l4       t]P                  R8X  d   ]R	 4       tR
tVtV ;t# R
tVtV ;t# )TerminalMagicsc                .   < \         \        V `  V4       R # )N)superr   __init__)selfshell	__class__s   &&r   r   TerminalMagics.__init__)   s    nd,U3    c                   V'       dE   \        VP                  4       4      V P                  P                  V&   \	        RV,          4       R# V P                  V4      pW@P                  P                  R&   RV P                  n         V P                  P                  WC4       RV P                  n        R#   RT P                  n        i ; i)zLExecute a block, or store it in a variable, per the user's request.
        zBlock assigned to '%s'pasted_blockTFN)r
   
splitlinesr   user_nsr   preclean_inputusing_paste_magicsrun_cell)r   blocknamestore_historybs   &&&& r   store_or_executeTerminalMagics.store_or_execute,   s     ',U-=-=-?'@DJJt$*T12##E*A12JJ~.,0DJJ)6

##A505

-

-s   B6 6C	c                    VP                  4       pV'       d)   V^ ,          P                  4       '       g   VR,          pK0  \        RP                  V4      4      # )    :   NN
)r%   stripr   join)r   r*   liness   && r   r'   TerminalMagics.preclean_input<   s@      "E!HNN,,"IE!$))E"233r"   c                N   V P                   P                  P                  V4      pVf   \        R4      h\	        V\
        4      '       g   \        R4      h\        RVP                  R^4      ^ ,          \        V4      3,          4       V P                   P                  V4       R# )z+Rerun a previously pasted command.
        Nz"No previous pasted block availablez6Variable 'pasted_block' is not a string, can't executezRe-executing '%s...' (%d chars)r3   )
r   r&   getr   
isinstancestrr   splitlenr)   )r   r+   r-   s   && r   rerun_pastedTerminalMagics.rerun_pastedB   s     JJ""4( 9ABB!S!!HJ J 	/!''$q/!2Dc!f1MMN

Ar"   c                    V P                   P                  4        \        RRR.V P                   P                  ,          4       R# )z%Toggle autoindent on/off (deprecated)zAutomatic indentation is:OFFONN)r   set_autoindentr   
autoindent)r   parameter_ss   &&r   rD   TerminalMagics.autoindentQ   s2     	

!!#)5,tzz7L7L*MNr"   c                    V P                  VRRR7      w  r#RV9   d   V P                  4        R# RV9   pVP                  RR4      pR	P                  \	        WTR
7      4      pV P                  WcRR7       R# )u  Paste & execute a pre-formatted code block from clipboard.

You must terminate the block with '--' (two minus-signs) or Ctrl-D
alone on the line. You can also provide your own sentinel with '%paste
-s %%' ('%%' is the new sentinel for this operation).

The block is dedented prior to execution to enable execution of method
definitions. '>' and '+' characters at the beginning of a line are
ignored, to allow pasting directly from e-mails, diff files and
doctests (the '...' continuation prompt is also stripped).  The
executed block is also assigned to variable named 'pasted_block' for
later editing with '%edit pasted_block'.

You can also pass a variable name as an argument, e.g. '%cpaste foo'.
This assigns the pasted block to variable 'foo' as string, without
dedenting or executing it (preceding >>> and + is still stripped)

'%cpaste -r' re-executes the block previously entered by cpaste.
'%cpaste -q' suppresses any additional output messages.

Do not be alarmed by garbled output on Windows (it's a readline bug).
Just press enter and type -- (and press enter again) and the block
will be what was just pasted.

Shell escapes are not supported (yet).

See Also
--------
paste : automatically pull code from clipboard.

Examples
--------
::

  In [8]: %cpaste
  Pasting code; enter '--' alone on the line to stop.
  :>>> a = ["world!", "Hello"]
  :>>> print(" ".join(sorted(a)))
  :--
  Hello world!

::
  In [8]: %cpaste
  Pasting code; enter '--' alone on the line to stop.
  :>>> %alias_magic t timeit
  :>>> %t -n1 pass
  :--
  Created `%t` as an alias for `%timeit`.
  Created `%%t` as an alias for `%%timeit`.
  354 ns ± 224 ns per loop (mean ± std. dev. of 7 runs, 1 loop each)
zrqs:stringmoderNqsz--r3   )r   Tr,   )parse_optionsr>   r9   r5   r   r.   )r   rE   optsr+   r   r   r*   s   &&     r   cpasteTerminalMagics.cpasteW   st    l ''V('K
$;88C'		*8ABe>r"   c                   V P                  VRRR7      w  r#RV9   d   V P                  4        R#  V P                  P                  P	                  4       pR	T9  d   \        P                  P                  T P                  P                  T4      4       TP                  R
4      '       g    \        P                  P                  R
4       \        P                  P                  R4       T P                  YCRR7       R#   \
         d>   p\        TR4      pT'       d   \        T^ ,          4       M\        R4        Rp?R# Rp?i\         d   p\        R4      ThRp?ii ; i)aE  Paste & execute a pre-formatted code block from clipboard.

The text is pulled directly from the clipboard without user
intervention and printed back on the screen before execution (unless
the -q flag is given to force quiet mode).

The block is dedented prior to execution to enable execution of method
definitions. '>' and '+' characters at the beginning of a line are
ignored, to allow pasting directly from e-mails, diff files and
doctests (the '...' continuation prompt is also stripped).  The
executed block is also assigned to variable named 'pasted_block' for
later editing with '%edit pasted_block'.

You can also pass a variable name as an argument, e.g. '%paste foo'.
This assigns the pasted block to variable 'foo' as string, without
executing it (preceding >>> and + is still stripped).

Options:

  -r: re-executes the block previously entered by cpaste.

  -q: quiet mode: do not echo the pasted text back to the terminal.

IPython statements (magics, shell escapes) are not supported (yet).

See Also
--------
cpaste : manually paste code into terminal until you mark its end.
rqrH   rI   rK   Nargsz&Could not get text from the clipboard.z!The clipboard appears to be emptyrL   r3   z## -- End pasted text --
TrN   )rO   r>   r   hooksclipboard_getr   getattrr   r   r   sysstdoutwrite
pycolorizeendswithr.   )r   rE   rP   r+   r*   clipboard_excmessagees   &&      r   pasteTerminalMagics.paste   s   > ''T'I
$;
	IJJ$$224E d?JJTZZ2259:>>$''

  &JJ9:e>#  	mV4Ggaj!>? 	I@AqH	Is)   $C> >E 	2EE E EE win32c                2    \         P                  ! R4       R# )zClear screen.
            clsN)ossystem)r   rM   s   &&r   re   TerminalMagics.cls   s     IIer"    )F)r$   )r   )__name__
__module____qualname____firstlineno__r   r.   r'   r>   r   rD   r	   rQ   ra   rY   platformre   __static_attributes____classdictcell____classcell__)r    __classdict__s   @@r   r   r   '   s     46 4 O O
 =?  =?~ 5? 5?p ||w		 
	 	 r"   r   )__doc__loggingr   rf   rY   IPython.core.errorr   r   IPython.core.magicr   r   r   IPython.lib.clipboardr   IPython.testing.skipdoctestr	   IPython.utils.textr
   r   IPython.utilsr   inputr   r   ri   r"   r   <module>r|      sT    $  	 
 2 ? ? 0 4 8 #'0e * nV n nr"   