Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb3c0c1

Browse files
committed
RF: The format expected by publish_display_data is a list of dicts.
1 parent aa58cf9 commit fb3c0c1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pymatbridge/matlab_magic.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def matlab(self, line, cell=None, local_ns=None):
210210
else:
211211
e_s = "There was an error running the code:\n %s"%code
212212
result_dict = self.eval(code)
213+
213214
except URLError:
214215
e_s += "\n-----------------------"
215216
e_s += "\nAre you sure Matlab is started?"
@@ -224,19 +225,17 @@ def matlab(self, line, cell=None, local_ns=None):
224225

225226
display_data = []
226227
if text_output and not args.silent:
227-
display_data.append(('MatlabMagic.matlab',
228-
{'text/plain':text_output}))
228+
display_data.append({'text/plain':text_output})
229229

230230
for imgf in imgfiles:
231231
if len(imgf):
232232
# Store the path to the directory so that you can delete it
233233
# later on:
234234
image = open(imgf, 'rb').read()
235-
display_data.append(('MatlabMagic.matlab',
236-
{'image/png': image}))
235+
display_data.append({'image/png': image})
237236

238-
for tag, disp_d in display_data:
239-
publish_display_data(tag, disp_d)
237+
for disp_d in display_data:
238+
publish_display_data(disp_d)
240239

241240
# Delete the temporary data files created by matlab:
242241
if len(data_dir):

0 commit comments

Comments
 (0)