@@ -190,32 +190,34 @@ def update_subchannel_msgs(debug=False):
190
190
vim .command (" syn match Red /^Out\[ [0-9]*\]\: /" )
191
191
b = vim .current.buffer
192
192
for m in msgs:
193
- db.append (str (m ).splitlines ())
193
+ #db.append (str (m ).splitlines ())
194
+ s = ' '
194
195
if ' msg_type' not in m :
195
196
# debug information
196
197
#echo (' skipping a message on sub_channel' ,' WarningMsg' )
197
198
#echo (str (m ))
198
199
continue
199
- if m [' msg_type' ] == ' status' :
200
+ elif m [' msg_type' ] == ' status' :
200
201
continue
201
- if m [' msg_type' ] == ' stream' :
202
+ elif m [' msg_type' ] == ' stream' :
202
203
s = strip_color_escapes (m [' content' ][' data' ])
203
- if m [' msg_type' ] == ' pyout' :
204
+ elif m [' msg_type' ] == ' pyout' :
204
205
s = " Out[%d]: " % m [' content' ][' execution_count' ]
205
206
s += m [' content' ][' data' ][' text/plain' ]
206
- if m [' msg_type' ] == ' pyin' :
207
+ elif m [' msg_type' ] == ' pyin' :
207
208
# TODO : the next line allows us to resend a line to ipython if
208
209
# % doctest_mode is on . In the future, IPython will send the
209
210
# execution_count on subchannel, so this will need to be updated
210
211
# once that happens
211
212
s = " \n In [00]: "
212
213
s += m [' content' ][' code' ].strip ()
213
- if m [' msg_type' ] == ' pyerr' :
214
+ elif m [' msg_type' ] == ' pyerr' :
214
215
c = m [' content' ]
215
216
s = " \n " .join (map (strip_color_escapes,c [' traceback' ]))
216
217
s += c [' ename' ] + " :" + c [' evalue' ]
217
- if s .find (' \n' )== -1 :
218
- # somewhat ugly unicode workaround from http:// vim .1045645 .n5.nabble.com /Limitations- of- vim - python - interface - with- respect- to - character - encodings- td1223881.html
218
+ if s .find (' \n' ) == -1 :
219
+ # somewhat ugly unicode workaround from
220
+ # http:// vim .1045645 .n5.nabble.com /Limitations- of- vim - python - interface - with- respect- to - character - encodings- td1223881.html
219
221
if isinstance (s ,unicode):
220
222
s = s .encode (vim_encoding)
221
223
b .append (s )
0 commit comments