;ò
ÎÑAHc           @   su   d  Z  d k Z d k Z d k Z e i i ƒ  Z e e	 d „ Z
 e e	 d „ Z e d j o d Z d Z d Z n d S(   s»   Doctest-related utilities for IPython.

For most common uses, all you should need to run is::

  from IPython.dtutils import idoctest

See the idoctest docstring below for usage details.
Nc   	      C   s³   d } d } | o t i ƒ  } n t i ƒ  } t i ƒ  } | t
 j o2 t i d ƒ } | i i ƒ  } | i | i ƒ n | i |  | | | d ƒ } | i | ƒ | i t ƒ d S(   s:  Run a the input source as a doctest, in the caller's namespace.

    :Parameters:
      text : str
        Source to execute.

    :Keywords:
      ns : dict (None)
        Namespace where the code should be executed.  If not given, the
        caller's locals and globals are used.
      eraise : bool (False)
        If true, immediately raise any exceptions instead of reporting them at
        the end.  This allows you to then do interactive debugging via
        IPython's facilities (use %debug after the fact, or with %pdb for
        automatic activation).
    s   interactive doctests   <IPython console>i   i    N(   s   names   filenames   eraises   doctests   DebugRunners   runners   DocTestRunners   DocTestParsers   parsers   nss   Nones   syss	   _getframes   fs	   f_globalss   copys   updates   f_localss   get_doctests   texts   tests   runs	   summarizes   True(	   s   texts   nss   eraises   names   fs   runners   parsers   filenames   test(    (    s@   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/dtutils.pys
   rundoctest   s     c         C   s  g  } d } t } |  t j o t i }  n t i i	 ƒ  yd x] t oU t
 ƒ  } | p
 | i ƒ  o | d 7} n d } | d j o Pn | i | ƒ q? WWn0 t j
 o n t j
 o d GHt } n Xt i i ƒ  | o* | i d ƒ t d i | ƒ |  | ƒ n d S(   sØ  Interactively prompt for input and run it as a doctest.

    To finish entering input, enter two blank lines or Ctrl-D (EOF).  If you
    use Ctrl-C, the example is aborted and all input discarded.

    :Keywords:
      ns : dict (None)
        Namespace where the code should be executed.  If not given, the IPython
        interactive namespace is used.
      eraise : bool (False)
        If true, immediately raise any exceptions instead of reporting them at
        the end.  This allows you to then do interactive debugging via
        IPython's facilities (use %debug after the fact, or with %pdb for
        automatic activation).
      end_mark : str ('--')
        String to explicitly indicate the end of input.

    i    i   i   s%   KeyboardInterrupt - Discarding input.s    s   
N(   s   inliness   empty_liness   Trues   run_tests   nss   Nones   ips   user_nss   IPs   savehists	   raw_inputs   lines   isspaces   appends   EOFErrors   KeyboardInterrupts   Falses
   reloadhists
   rundoctests   joins   eraise(   s   nss   eraises   inliness   empty_liness   run_tests   line(    (    s@   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/dtutils.pys   idoctest5   s4      	s   __main__sV   
    >>> for i in range(10):
    ...     print i,
    ...
    0 1 2 3 4 5 6 7 8 9
    sÔ   
        A simple example::

          >>> for i in range(10):
          ...     print i,
          ...
          0 1 2 3 4 5 6 7 8 9

        Some more details::

          >>> print "hello"
          hello
    sR   
        A failing example::

          >>> x=1
          >>> x+1
          3
    (   s   __doc__s   doctests   syss   IPython.ipapis   IPythons   ipapis   gets   ips   Nones   Falses
   rundoctests   idoctests   __name__s   ts   t2s   t3(	   s   idoctests   ips   t2s
   rundoctests   t3s   syss   doctests   IPythons   t(    (    s@   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/dtutils.pys   ?   s   			%8