##// END OF EJS Templates
Hide pre- and post-call from user.
Stefan van der Walt -
Show More
@@ -271,9 +271,12 b' class OctaveMagics(Magics):'
271
271
272 close all;
272 close all;
273 clear ans;
273 clear ans;
274
275 # ___<end_pre_call>___ #
274 '''
276 '''
275
277
276 post_call = '''
278 post_call = '''
279 # ___<start_post_call>___ #
277
280
278 # Save output of the last execution
281 # Save output of the last execution
279 if exist("ans") == 1
282 if exist("ans") == 1
@@ -296,9 +299,12 b' class OctaveMagics(Magics):'
296 try:
299 try:
297 text_output = self._oct.run(code, verbose=False)
300 text_output = self._oct.run(code, verbose=False)
298 except (oct2py.Oct2PyError) as exception:
301 except (oct2py.Oct2PyError) as exception:
302 msg = exception.message
303 msg = msg.split('# ___<end_pre_call>___ #')[1]
304 msg = msg.split('# ___<start_post_call>___ #')[0]
299 raise OctaveMagicError('Octave could not complete execution. '
305 raise OctaveMagicError('Octave could not complete execution. '
300 'Traceback (currently broken in oct2py): %s'
306 'Traceback (currently broken in oct2py): %s'
301 % exception.message)
307 % msg)
302
308
303 key = 'OctaveMagic.Octave'
309 key = 'OctaveMagic.Octave'
304 display_data = []
310 display_data = []
General Comments 0
You need to be logged in to leave comments. Login now