qtconsole icon indicating copy to clipboard operation
qtconsole copied to clipboard

Custom banner

Open astrofrog opened this issue 9 years ago • 3 comments

It used to be possible to customize the banner of RichIPythonWidget using something like:

class MyConsole(RichIPythonWidget):
    banner = 'Custom banner\n'

However, if I now do:

class MyConsole(RichJupyterWidget):
    banner = 'Custom banner\n'

control = MyConsole()
control.kernel_manager = kernel_manager
control.kernel_client = kernel_client
control.exit_requested.connect(stop)
control.show()

Then the output of the console is as follows:

screen shot 2016-10-15 at 18 29 20

If I add:

control._display_banner = False

Then no banner is shown at all. Is there a way to have a fully customized banner?

astrofrog avatar Oct 15 '16 17:10 astrofrog

The second part is coming from the kernel; I don't think there's a way to disable that.

You could override the reset() method, but that would involve a bit of copy-pasting. Maybe it makes sense to pull out a display_banner() method which you could more easily override.

takluyver avatar Oct 17 '16 10:10 takluyver

@takluyver - thanks! Just to check, this has changed recently though, correct? (it used to be that what was assigned to the banner attribute was the last thing shown before the prompt).

astrofrog avatar Oct 17 '16 12:10 astrofrog

I'm not sure exactly when it changed, but probably at some point post big-split.

takluyver avatar Oct 17 '16 12:10 takluyver