##// END OF EJS Templates
Merge pull request #3323 from takluyver/strip-prompts...
Merge pull request #3323 from takluyver/strip-prompts Strip prompts even if the prompt isn't present on the first line. Users (including me) often copy and paste examples from just after the first prompt. This checks for prompts in the first two lines of a block, but if they aren't found there, it will ignore prompt-like prefixes in later lines, to minimise interference with multi-line strings etc. This fixes both incoming copies (transformed before running code) and outgoing (copied from the Qt console). Closes #3206

File last commit:

r4872:34c10438
r10679:689d7bfc merge
Show More
ipy_defaults.py
62 lines | 1.4 KiB | text/x-python | PythonLexer
Bernardo B. Marques
remove all trailling spaces
r4872 """ Set default options for IPython.
fperez
Fix win32 line endings.
r281
Just import this module to get reasonable defaults for everything.
Bernardo B. Marques
remove all trailling spaces
r4872 These configurations used to be performed in ipythonrc (or ipythonrc.ini).
fperez
Fix win32 line endings.
r281 Therefore importing this in your config files makes ipython basically
Bernardo B. Marques
remove all trailling spaces
r4872 ignore your ipythonrc. This is *not* imported by default, you need to import
fperez
Fix win32 line endings.
r281 this manually in one of your config files.
You can further override these defaults in e.g. your ipy_user_config.py,
ipy_profile_PROFILENAME etc.
"""
Brian Granger
rlineimpl.py utils/rlineimpl.py and imports updated.
r2044 import IPython.utils.rlineimpl as readline
Brian Granger
ipapi.py => core/ipapi.py and imports updated.
r2027 from IPython.core import ipapi
ip = ipapi.get()
fperez
Fix win32 line endings.
r281
fperez
One more getters fix...
r286 o = ip.options
fperez
Fix win32 line endings.
r281
o.colors = "Linux"
o.color_info=1
o.confirm_exit=1
o.pprint=1
o.multi_line_specials=1
o.xmode="Context"
o.prompt_in1='In [\#]: '
o.prompt_in2 =' .\D.: '
o.prompt_out = 'Out[\#]: '
o.prompts_pad_left=1
vivainio
set autoindent ON in ipy_defaults.py
r705 o.autoindent = 1
fperez
Fix win32 line endings.
r281 o.readline_remove_delims="-/~"
o.readline_merge_completions=1
o.readline = 1
rlopts = """\
tab: complete
"\C-l": possible-completions
set show-all-if-ambiguous on
"\C-o": tab-insert
"\M-i": " "
"\M-o": "\d\d\d\d"
"\M-I": "\d\d\d\d"
"\C-r": reverse-search-history
"\C-s": forward-search-history
"\C-p": history-search-backward
"\C-n": history-search-forward
"\e[A": history-search-backward
"\e[B": history-search-forward
"\C-k": kill-line
"\C-u": unix-line-discard"""
jstenar
check if readline is available before calling readline functions in ipy_defaults.py
r537 if readline.have_readline:
for cmd in rlopts.split('\n'):
readline.parse_and_bind(cmd)
Bernardo B. Marques
remove all trailling spaces
r4872