Ask Your Question

Revision history [back]

About sage.plot.plot.EMBEDDED_MODE

Cantor program used sage-cli, and in this program there is need to disable external viewers. I found sage variable, which, I hope, will do it: sage.plot.plot.EMBEDDED_MODE.

But after setting sage.plot.plot.EMBEDDED_MODE to True I haven't any changes: external viewer starts, for example, for plots.

But in src/sage/structure/graphics_file.py on line 161 we have launch_viewer function, which, I think, start external viewer and where there is this condition:


from sage.plot.plot import EMBEDDED_MODE
if EMBEDDED_MODE:
    raise RuntimeError('should never launch viewer in embedded mode')

So, as I see, if sage.plot.plot.EMBEDDED_MODE is True, we don't start external viewer, because we exit from function launc_viewer with RuntimeError. But sage works fine with EMBEDDED_MODE = True. Could anyone explain this behavior, is it a bug with sage.plot.plot.EMBEDDED_MODE or I am wrong?