Skip to content

Commit bf31f39

Browse files
committed
make messaging work with IPython trunk
1 parent 3d9f962 commit bf31f39

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Vim, like what you get with: ``object?<enter>`` and ``object.<tab>`` in
1515
IPython.
1616

1717
The big change from previous versions of ``ipy.vim`` is that it no longer
18-
the old requires the brittle ``ipy_vimserver.py`` instantiation, and since
18+
requires the old brittle ``ipy_vimserver.py`` instantiation, and since
1919
it uses just vim and python, it is platform independent (i.e. should work
2020
even on windows, unlike the previous \*nix only solution). The requirements
2121
are IPython 0.11+ with zeromq capabilities, vim compiled with +python.

ftplugin/python/ipy.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,26 @@ def update_subchannel_msgs(debug=False):
192192
for m in msgs:
193193
#db.append(str(m).splitlines())
194194
s = ''
195-
if 'msg_type' not in m:
195+
if 'msg_type' not in m['header']:
196196
# debug information
197197
#echo('skipping a message on sub_channel','WarningMsg')
198198
#echo(str(m))
199199
continue
200-
elif m['msg_type'] == 'status':
200+
elif m['header']['msg_type'] == 'status':
201201
continue
202-
elif m['msg_type'] == 'stream':
202+
elif m['header']['msg_type'] == 'stream':
203203
s = strip_color_escapes(m['content']['data'])
204-
elif m['msg_type'] == 'pyout':
204+
elif m['header']['msg_type'] == 'pyout':
205205
s = "Out[%d]: " % m['content']['execution_count']
206206
s += m['content']['data']['text/plain']
207-
elif m['msg_type'] == 'pyin':
207+
elif m['header']['msg_type'] == 'pyin':
208208
# TODO: the next line allows us to resend a line to ipython if
209209
# %doctest_mode is on. In the future, IPython will send the
210210
# execution_count on subchannel, so this will need to be updated
211211
# once that happens
212212
s = "\nIn [00]: "
213213
s += m['content']['code'].strip()
214-
elif m['msg_type'] == 'pyerr':
214+
elif m['header']['msg_type'] == 'pyerr':
215215
c = m['content']
216216
s = "\n".join(map(strip_color_escapes,c['traceback']))
217217
s += c['ename'] + ":" + c['evalue']

0 commit comments

Comments
 (0)