Show More
@@ -774,6 +774,7 b' aliases.update(shell_aliases)' | |||||
774 |
|
774 | |||
775 | # it's possible we don't want short aliases for *all* of these: |
|
775 | # it's possible we don't want short aliases for *all* of these: | |
776 | aliases.update(dict( |
|
776 | aliases.update(dict( | |
|
777 | gui='IPKernelApp.gui', | |||
777 | pylab='IPKernelApp.pylab', |
|
778 | pylab='IPKernelApp.pylab', | |
778 | )) |
|
779 | )) | |
779 |
|
780 | |||
@@ -789,6 +790,9 b' class IPKernelApp(KernelApp, InteractiveShellApp):' | |||||
789 | classes = [Kernel, ZMQInteractiveShell, ProfileDir, Session] |
|
790 | classes = [Kernel, ZMQInteractiveShell, ProfileDir, Session] | |
790 |
|
791 | |||
791 | # configurables |
|
792 | # configurables | |
|
793 | gui = CaselessStrEnum(('qt', 'wx', 'gtk', 'glut', 'pyglet'), config=True, | |||
|
794 | help="Enable GUI event loop integration ('qt', 'wx', 'gtk', 'glut', 'pyglet')." | |||
|
795 | ) | |||
792 | pylab = CaselessStrEnum(['tk', 'qt', 'wx', 'gtk', 'osx', 'inline', 'auto'], |
|
796 | pylab = CaselessStrEnum(['tk', 'qt', 'wx', 'gtk', 'osx', 'inline', 'auto'], | |
793 | config=True, |
|
797 | config=True, | |
794 | help="""Pre-load matplotlib and numpy for interactive use, |
|
798 | help="""Pre-load matplotlib and numpy for interactive use, | |
@@ -801,6 +805,7 b' class IPKernelApp(KernelApp, InteractiveShellApp):' | |||||
801 | super(IPKernelApp, self).initialize(argv) |
|
805 | super(IPKernelApp, self).initialize(argv) | |
802 | self.init_path() |
|
806 | self.init_path() | |
803 | self.init_shell() |
|
807 | self.init_shell() | |
|
808 | self.init_gui_pylab() | |||
804 | self.init_extensions() |
|
809 | self.init_extensions() | |
805 | self.init_code() |
|
810 | self.init_code() | |
806 |
|
811 | |||
@@ -818,10 +823,17 b' class IPKernelApp(KernelApp, InteractiveShellApp):' | |||||
818 | self.kernel = kernel |
|
823 | self.kernel = kernel | |
819 | kernel.record_ports(self.ports) |
|
824 | kernel.record_ports(self.ports) | |
820 | shell = kernel.shell |
|
825 | shell = kernel.shell | |
821 | if self.pylab: |
|
826 | ||
|
827 | def init_gui_pylab(self): | |||
|
828 | """Enable GUI event loop integration, taking pylab into account.""" | |||
|
829 | if self.gui or self.pylab: | |||
|
830 | shell = self.shell | |||
822 | try: |
|
831 | try: | |
823 | gui, backend = pylabtools.find_gui_and_backend(self.pylab) |
|
832 | if self.pylab: | |
824 | shell.enable_pylab(gui, import_all=self.pylab_import_all) |
|
833 | gui, backend = pylabtools.find_gui_and_backend(self.pylab) | |
|
834 | shell.enable_pylab(gui, import_all=self.pylab_import_all) | |||
|
835 | else: | |||
|
836 | shell.enable_gui(self.gui) | |||
825 | except Exception: |
|
837 | except Exception: | |
826 | self.log.error("Pylab initialization failed", exc_info=True) |
|
838 | self.log.error("Pylab initialization failed", exc_info=True) | |
827 | # print exception straight to stdout, because normally |
|
839 | # print exception straight to stdout, because normally |
General Comments 0
You need to be logged in to leave comments.
Login now