##// END OF EJS Templates
Use client.execute in execute preoprocessor
Thomas Kluyver -
Show More
@@ -46,7 +46,7 b' class ExecutePreprocessor(Preprocessor):'
46 46 if cell.cell_type != 'code':
47 47 return cell, resources
48 48 try:
49 outputs = self.run_cell(self.kc.shell_channel, self.kc.iopub_channel, cell)
49 outputs = self.run_cell(cell)
50 50 except Exception as e:
51 51 self.log.error("failed to run cell: " + repr(e))
52 52 self.log.error(str(cell.source))
@@ -54,13 +54,13 b' class ExecutePreprocessor(Preprocessor):'
54 54 cell.outputs = outputs
55 55 return cell, resources
56 56
57 def run_cell(self, shell, iopub, cell):
58 msg_id = shell.execute(cell.source)
57 def run_cell(self, cell):
58 msg_id = self.kc.execute(cell.source)
59 59 self.log.debug("Executing cell:\n%s", cell.source)
60 60 # wait for finish, with timeout
61 61 while True:
62 62 try:
63 msg = shell.get_msg(timeout=self.timeout)
63 msg = self.kc.shell_channel.get_msg(timeout=self.timeout)
64 64 except Empty:
65 65 self.log.error("Timeout waiting for execute reply")
66 66 raise
@@ -74,7 +74,7 b' class ExecutePreprocessor(Preprocessor):'
74 74
75 75 while True:
76 76 try:
77 msg = iopub.get_msg(timeout=self.timeout)
77 msg = self.kc.iopub_channel.get_msg(timeout=self.timeout)
78 78 except Empty:
79 79 self.log.warn("Timeout waiting for IOPub output")
80 80 break
General Comments 0
You need to be logged in to leave comments. Login now