Show More
@@ -11,7 +11,7 b' from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC' | |||||
11 | from IPython.utils.py3compat import PY3, cast_unicode_py2, input |
|
11 | from IPython.utils.py3compat import PY3, cast_unicode_py2, input | |
12 | from IPython.utils.terminal import toggle_set_term_title, set_term_title |
|
12 | from IPython.utils.terminal import toggle_set_term_title, set_term_title | |
13 | from IPython.utils.process import abbrev_cwd |
|
13 | from IPython.utils.process import abbrev_cwd | |
14 | from traitlets import Bool, Unicode, Dict, Integer, observe, Instance, Type |
|
14 | from traitlets import Bool, Unicode, Dict, Integer, observe, Instance, Type, default | |
15 |
|
15 | |||
16 | from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER, EditingMode |
|
16 | from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER, EditingMode | |
17 | from prompt_toolkit.filters import HasFocus, HasSelection, Condition, ViInsertMode, EmacsInsertMode, IsDone |
|
17 | from prompt_toolkit.filters import HasFocus, HasSelection, Condition, ViInsertMode, EmacsInsertMode, IsDone | |
@@ -125,10 +125,11 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
125 | help="Set the editor used by IPython (default to $EDITOR/vi/notepad)." |
|
125 | help="Set the editor used by IPython (default to $EDITOR/vi/notepad)." | |
126 | ).tag(config=True) |
|
126 | ).tag(config=True) | |
127 |
|
127 | |||
128 |
prompts_class = Type(Prompts, |
|
128 | prompts_class = Type(Prompts, help='Class used to generate Prompt token for prompt_toolkit').tag(config=True) | |
129 |
|
129 | |||
130 | prompts = Instance(Prompts) |
|
130 | prompts = Instance(Prompts) | |
131 |
|
131 | |||
|
132 | @default('prompts') | |||
132 | def _prompts_default(self): |
|
133 | def _prompts_default(self): | |
133 | return self.prompts_class(self) |
|
134 | return self.prompts_class(self) | |
134 |
|
135 | |||
@@ -136,6 +137,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
136 | def _(self, change): |
|
137 | def _(self, change): | |
137 | self._update_layout() |
|
138 | self._update_layout() | |
138 |
|
139 | |||
|
140 | @default('displayhook_class') | |||
139 | def _displayhook_class_default(self): |
|
141 | def _displayhook_class_default(self): | |
140 | return RichPromptDisplayHook |
|
142 | return RichPromptDisplayHook | |
141 |
|
143 |
@@ -47,6 +47,7 b' pjoin = path.join' | |||||
47 | warnings.filterwarnings('ignore', message='.*Matplotlib is building the font cache.*', category=UserWarning, module='.*') |
|
47 | warnings.filterwarnings('ignore', message='.*Matplotlib is building the font cache.*', category=UserWarning, module='.*') | |
48 | if sys.version_info > (3,0): |
|
48 | if sys.version_info > (3,0): | |
49 | warnings.filterwarnings('error', message='.*', category=ResourceWarning, module='.*') |
|
49 | warnings.filterwarnings('error', message='.*', category=ResourceWarning, module='.*') | |
|
50 | warnings.filterwarnings('error', message=".*{'config': True}.*", category=DeprecationWarning, module='IPy.*') | |||
50 | warnings.filterwarnings('default', message='.*', category=Warning, module='IPy.*') |
|
51 | warnings.filterwarnings('default', message='.*', category=Warning, module='IPy.*') | |
51 |
|
52 | |||
52 | if version_info < (6,): |
|
53 | if version_info < (6,): |
General Comments 0
You need to be logged in to leave comments.
Login now