##// END OF EJS Templates
fix inprocess input request
MinRK -
Show More
@@ -1,22 +1,12 b''
1 """An in-process kernel"""
1 """An in-process kernel"""
2
2
3 #-----------------------------------------------------------------------------
3 # Copyright (c) IPython Development Team.
4 # Copyright (C) 2012 The IPython Development Team
4 # Distributed under the terms of the Modified BSD License.
5 #
6 # Distributed under the terms of the BSD License. The full license is in
7 # the file COPYING, distributed as part of this software.
8 #-----------------------------------------------------------------------------
9
10 #-----------------------------------------------------------------------------
11 # Imports
12 #-----------------------------------------------------------------------------
13
5
14 # Standard library imports
15 from contextlib import contextmanager
6 from contextlib import contextmanager
16 import logging
7 import logging
17 import sys
8 import sys
18
9
19 # Local imports
20 from IPython.core.interactiveshell import InteractiveShellABC
10 from IPython.core.interactiveshell import InteractiveShellABC
21 from IPython.utils.jsonutil import json_clean
11 from IPython.utils.jsonutil import json_clean
22 from IPython.utils.traitlets import Any, Enum, Instance, List, Type
12 from IPython.utils.traitlets import Any, Enum, Instance, List, Type
@@ -83,14 +73,14 b' class InProcessKernel(Kernel):'
83 """ The in-process kernel doesn't abort requests. """
73 """ The in-process kernel doesn't abort requests. """
84 pass
74 pass
85
75
86 def _raw_input(self, prompt, ident, parent):
76 def _input_request(self, prompt, ident, parent, password=False):
87 # Flush output before making the request.
77 # Flush output before making the request.
88 self.raw_input_str = None
78 self.raw_input_str = None
89 sys.stderr.flush()
79 sys.stderr.flush()
90 sys.stdout.flush()
80 sys.stdout.flush()
91
81
92 # Send the input request.
82 # Send the input request.
93 content = json_clean(dict(prompt=prompt))
83 content = json_clean(dict(prompt=prompt, password=password))
94 msg = self.session.msg(u'input_request', content, parent)
84 msg = self.session.msg(u'input_request', content, parent)
95 for frontend in self.frontends:
85 for frontend in self.frontends:
96 if frontend.session.session == parent['header']['session']:
86 if frontend.session.session == parent['header']['session']:
General Comments 0
You need to be logged in to leave comments. Login now