##// END OF EJS Templates
Moving extensions to either quarantine or deathrow....
Moving extensions to either quarantine or deathrow. When a module is moved to quarantine, it means that while we intend to keep it, it is currently broken or sufficiently untested that it can't be in the main IPython codebase. To be moved back into the main IPython codebase a module must: 1. Work fully. 2. Have a test suite. 3. Be a proper IPython extension and tie into the official APIs. 3. Have members of the IPython dev team who are willing to maintain it. When a module is moved to deathrow, it means that the code is either broken and not worth repairing, deprecated, replaced by newer functionality, or code that should be developed and maintained by a third party.

File last commit:

r2267:928c921b
r2267:928c921b
Show More
ipy_profile_doctest.py
46 lines | 1.5 KiB | text/x-python | PythonLexer
"""Config file for 'doctest' profile.
This profile modifies the prompts to be the standard Python ones, so that you
can generate easily doctests from an IPython session.
But more importantly, it enables pasting of code with '>>>' prompts and
arbitrary initial whitespace, as is typical of doctests in reST files and
docstrings. This allows you to easily re-run existing doctests and iteratively
work on them as part of your development workflow.
The exception mode is also set to 'plain' so the generated exceptions are as
similar as possible to the default Python ones, for inclusion in doctests."""
# get various stuff that are there for historical / familiarity reasons
import ipy_legacy
from IPython.core import ipapi
from IPython.extensions import InterpreterPasteInput
def main():
ip = ipapi.get()
o = ip.options
# Set the prompts similar to the defaults
o.prompt_in1 = '>>> '
o.prompt_in2 = '... '
o.prompt_out = ''
# Add a blank line before each new set of inputs. This is needed by
# doctest to distinguish each test from the next.
o.separate_in = '\n'
o.separate_out = ''
o.separate_out2 = ''
# Disable pprint, so that outputs are printed as similarly to standard
# python as possible
o.pprint = False
# Use plain exceptions, to also resemble normal pyhton.
o.xmode = 'plain'
# Store the activity flag in the metadata bag from the running shell
ip.meta.doctest_mode = True
main()