From 4eae005c789a2243b690c6607a84d1a682a14d74 2012-06-10 03:17:19 From: Stefan van der Walt Date: 2012-06-10 03:17:19 Subject: [PATCH] Hide pre- and post-call from user. --- diff --git a/IPython/extensions/octavemagic.py b/IPython/extensions/octavemagic.py index ddae434..3f60ebd 100644 --- a/IPython/extensions/octavemagic.py +++ b/IPython/extensions/octavemagic.py @@ -271,9 +271,12 @@ class OctaveMagics(Magics): close all; clear ans; + + # ______ # ''' post_call = ''' + # ______ # # Save output of the last execution if exist("ans") == 1 @@ -296,9 +299,12 @@ class OctaveMagics(Magics): try: text_output = self._oct.run(code, verbose=False) except (oct2py.Oct2PyError) as exception: + msg = exception.message + msg = msg.split('# ______ #')[1] + msg = msg.split('# ______ #')[0] raise OctaveMagicError('Octave could not complete execution. ' 'Traceback (currently broken in oct2py): %s' - % exception.message) + % msg) key = 'OctaveMagic.Octave' display_data = []