booting
This commit is contained in:
@@ -522,8 +522,7 @@ class InteractiveShell(SingletonConfigurable):
|
||||
# The following was in post_config_initialization
|
||||
self.init_inspector()
|
||||
self.raw_input_original = input
|
||||
self.input_splitter.engine(self.yapeng)
|
||||
self.input_transformer_manager.engine(self.yapeng)
|
||||
#self.input_transformer_manager.engine(self.yapeng)
|
||||
self.init_completer()
|
||||
# TODO: init_io() needs to happen before init_traceback handlers
|
||||
# because the traceback handlers hardcode the stdout/stderr streams.
|
||||
@@ -2671,7 +2670,6 @@ class InteractiveShell(SingletonConfigurable):
|
||||
self.events.trigger('post_execute')
|
||||
if not silent:
|
||||
self.events.trigger('post_run_cell', result)
|
||||
print("go", result)
|
||||
return result
|
||||
|
||||
def _run_cell(self, raw_cell, store_history, silent, shell_futures):
|
||||
|
@@ -59,11 +59,12 @@ class YAPInputSplitter(InputSplitter):
|
||||
# List with lines of raw input accumulated so far.
|
||||
_buffer_raw = None
|
||||
|
||||
def __init__(self, line_input_checker=True, physical_line_transforms=None,
|
||||
def __init__(self, engine=None, shell=None, line_input_checker=True, physical_line_transforms=None,
|
||||
logical_line_transforms=None):
|
||||
self._buffer_raw = []
|
||||
self._validate = True
|
||||
self.yapeng = None
|
||||
self.yapeng = engine
|
||||
self.shell = shell
|
||||
|
||||
if physical_line_transforms is not None:
|
||||
self.physical_line_transforms = physical_line_transforms
|
||||
@@ -102,19 +103,16 @@ class YAPInputSplitter(InputSplitter):
|
||||
[self.assemble_logical_lines] + self.logical_line_transforms
|
||||
return t
|
||||
|
||||
def engine(self, engine):
|
||||
self.yapeng = engine
|
||||
|
||||
def validQuery(self, text, line=None):
|
||||
def validQuery(self, text, engine, shell, line=None):
|
||||
"""Return whether a legal query
|
||||
"""
|
||||
if text == self.shell.os:
|
||||
if text == shell.os:
|
||||
return True
|
||||
if not line:
|
||||
line = text.rstrip()
|
||||
(line, _, _, _)=self.shell.clean_end(line)
|
||||
self.errors = []
|
||||
self.yapeng.mgoal(errors(self, line),"user")
|
||||
engine.mgoal(errors(self, line),"user")
|
||||
return self.errors != []
|
||||
|
||||
|
||||
@@ -183,7 +181,7 @@ class YAPInputSplitter(InputSplitter):
|
||||
if self.transformer_accumulating:
|
||||
return True
|
||||
else:
|
||||
return self,validQuery(self.source)
|
||||
return self.validQuery(self.source, self.yapeng, self)
|
||||
|
||||
def transform_cell(self, cell):
|
||||
"""Process and translate a cell of input.
|
||||
|
@@ -472,7 +472,18 @@ class YAPKernelApp(BaseYAPApplication, InteractiveShellApp,
|
||||
return self.subapp.start()
|
||||
if self.poller is not None:
|
||||
self.poller.start()
|
||||
self.kernel.start()
|
||||
|
||||
import trace
|
||||
#create a Trace object, telling it what to ignore, and whether to
|
||||
# do tracing or line-counting or both.
|
||||
tracer = trace.Trace(
|
||||
#ignoredirs=[sys.prefix, sys.exec_prefix],
|
||||
trace=1,
|
||||
count=0)
|
||||
|
||||
tracer.runfunc(self.kernel.start)
|
||||
|
||||
#self.kernel.start()
|
||||
self.io_loop = ioloop.IOLoop.current()
|
||||
try:
|
||||
self.io_loop.start()
|
||||
@@ -485,6 +496,7 @@ def main():
|
||||
"""Run an IPKernel as an application"""
|
||||
app = YAPKernelApp.instance()
|
||||
app.initialize()
|
||||
|
||||
app.start()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user