Show More
@@ -37,10 +37,10 b' class ExecutePreprocessor(Preprocessor):' | |||
|
37 | 37 | self.kc.start_channels() |
|
38 | 38 | self.iopub = self.kc.iopub_channel |
|
39 | 39 | self.shell = self.kc.shell_channel |
|
40 | ||
|
40 | ||
|
41 | 41 | self.shell.execute("pass") |
|
42 | 42 | self.shell.get_msg() |
|
43 | ||
|
43 | ||
|
44 | 44 | def preprocess_cell(self, cell, resources, cell_index): |
|
45 | 45 | """ |
|
46 | 46 | Apply a transformation on each code cell. See base.py for details. |
@@ -63,7 +63,7 b' class ExecutePreprocessor(Preprocessor):' | |||
|
63 | 63 | # wait for finish, maximum 20s |
|
64 | 64 | shell.get_msg(timeout=20) |
|
65 | 65 | outs = [] |
|
66 | ||
|
66 | ||
|
67 | 67 | while True: |
|
68 | 68 | try: |
|
69 | 69 | msg = iopub.get_msg(timeout=0.2) |
@@ -75,11 +75,11 b' class ExecutePreprocessor(Preprocessor):' | |||
|
75 | 75 | elif msg_type == 'clear_output': |
|
76 | 76 | outs = [] |
|
77 | 77 | continue |
|
78 | ||
|
78 | ||
|
79 | 79 | content = msg['content'] |
|
80 | 80 | # print msg_type, content |
|
81 | 81 | out = NotebookNode(output_type=msg_type) |
|
82 | ||
|
82 | ||
|
83 | 83 | if msg_type == 'stream': |
|
84 | 84 | out.stream = content['name'] |
|
85 | 85 | out.text = content['data'] |
@@ -98,10 +98,10 b' class ExecutePreprocessor(Preprocessor):' | |||
|
98 | 98 | out.traceback = content['traceback'] |
|
99 | 99 | else: |
|
100 | 100 | print >> sys.stderr, "unhandled iopub msg:", msg_type |
|
101 | ||
|
101 | ||
|
102 | 102 | outs.append(out) |
|
103 | 103 | return outs |
|
104 | ||
|
104 | ||
|
105 | 105 | |
|
106 | 106 | def __del__(self): |
|
107 | 107 | self.kc.stop_channels() |
General Comments 0
You need to be logged in to leave comments.
Login now