Skip to content
Snippets Groups Projects
Commit 59a2027e authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Remove support for updating the IPython banner

It's not required for now and newer versions of Jupyter work quite
differently.
Refs #21251
parent 5c4a4cb2
No related branches found
No related tags found
No related merge requests found
...@@ -42,12 +42,8 @@ class InProcessIPythonConsole(RichIPythonWidget): ...@@ -42,12 +42,8 @@ class InProcessIPythonConsole(RichIPythonWidget):
""" """
A constructor matching that of RichIPythonWidget A constructor matching that of RichIPythonWidget
:param args: Positional arguments passed directly to RichIPythonWidget :param args: Positional arguments passed directly to RichIPythonWidget
:param kwargs: Keyword arguments. The following are used by this :param kwargs: Keyword arguments passed directly to RichIPythonWidget
widget:
- banner_extra: An additinal string to append to the default banner
""" """
# remove our arguments
banner_extra = kwargs.pop("banner_extra", "")
super(InProcessIPythonConsole, self).__init__(*args, **kwargs) super(InProcessIPythonConsole, self).__init__(*args, **kwargs)
# create an in-process kernel # create an in-process kernel
...@@ -60,10 +56,6 @@ class InProcessIPythonConsole(RichIPythonWidget): ...@@ -60,10 +56,6 @@ class InProcessIPythonConsole(RichIPythonWidget):
shell = kernel.shell shell = kernel.shell
shell.run_code = async_wrapper(shell.run_code, shell) shell.run_code = async_wrapper(shell.run_code, shell)
# custom banner
if banner_extra:
self.banner += "\n" + banner_extra
# attach channels and start kenel # attach channels and start kenel
kernel_client = kernel_manager.client() kernel_client = kernel_manager.client()
kernel_client.start_channels() kernel_client.start_channels()
......
...@@ -33,11 +33,8 @@ class InProcessIPythonConsoleTest(unittest.TestCase): ...@@ -33,11 +33,8 @@ class InProcessIPythonConsoleTest(unittest.TestCase):
widget = InProcessIPythonConsole() widget = InProcessIPythonConsole()
self.assertTrue(hasattr(widget, "kernel_manager")) self.assertTrue(hasattr(widget, "kernel_manager"))
self.assertTrue(hasattr(widget, "kernel_client")) self.assertTrue(hasattr(widget, "kernel_client"))
self.assertTrue(len(widget.banner) > 0)
def test_banner_extra_updates_banner(self):
widget = InProcessIPythonConsole(banner_extra="foo")
self.assertTrue(widget.banner.endswith("foo"))
self.assertTrue(widget.banner.startswith("Python"))
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment