##// END OF EJS Templates
Backport PR #2773: Fixed minor typo causing AttributeError to be thrown....
Backport PR #2773: Fixed minor typo causing AttributeError to be thrown. I'm not sure how I caused the error to be thrown and couldn't reproduce it with the same call again, nevertheless I think the fix is correct. ```python In [21]: rc.shutdown(hub=True) Traceback (most recent call last): File "<ipython-input-21-977a05a15f31>", line 1, in <module> rc.shutdown(hub=True) File "<string>", line 2, in shutdown File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 69, in spin_first self.spin() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 1005, in spin self._flush_notifications() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 800, in _flush_notifications raise Exception("Unhandled message type: %s"%msg.msg_type) AttributeError: 'dict' object has no attribute 'msg_type' ```

File last commit:

r6143:fc389acd
r9855:7ad908bf
Show More
ipy_profile_doctest.py
46 lines | 1.5 KiB | text/x-python | PythonLexer
/ IPython / quarantine / ipy_profile_doctest.py
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750 """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
Brian Granger
ipapi.py => core/ipapi.py and imports updated.
r2027 from IPython.core import ipapi
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750
Brian Granger
Renaming Extensions=>extensions in code and imports.
r2064 from IPython.extensions import InterpreterPasteInput
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750
def main():
ip = ipapi.get()
o = ip.options
# Set the prompts similar to the defaults
o.prompt_in1 = '>>> '
o.prompt_in2 = '... '
o.prompt_out = ''
fperez
fix prompt separators for doctests
r766 # 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'
fperez
Small fix to '?', more doctest-compliant profile.
r762 o.separate_out = ''
fperez
fix prompt separators for doctests
r766 o.separate_out2 = ''
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750
# Disable pprint, so that outputs are printed as similarly to standard
# python as possible
fperez
Small fix to '?', more doctest-compliant profile.
r762 o.pprint = False
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750
W. Trevor King
Fix pyhton -> python typos (everywhere found by grep).
r6143 # Use plain exceptions, to also resemble normal python.
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750 o.xmode = 'plain'
fperez
- new doctest_mode magic to toggle doctest pasting/prompts....
r763 # Store the activity flag in the metadata bag from the running shell
Brian Granger
Continuing a massive refactor of everything.
r2205 ip.meta.doctest_mode = True
fperez
- new doctest_mode magic to toggle doctest pasting/prompts....
r763
fperez
- New profile with doctest support (two way: for generating doctests and for...
r750 main()