-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #5939. Add an IPython console as the script interpreter.
For now, requires IPython 1.0 to be installed locally.
- Loading branch information
1 parent
f4fa114
commit 1497115
Showing
8 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from mantid_ipython_widget import * |
25 changes: 25 additions & 0 deletions
25
Code/Mantid/MantidPlot/ipython_widget/mantid_ipython_widget.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget | ||
from IPython.qt.inprocess import QtInProcessKernelManager | ||
|
||
class MantidIPythonWidget(RichIPythonWidget): | ||
|
||
def __init__(self, *args, **kw): | ||
super(MantidIPythonWidget, self).__init__(*args, **kw) | ||
|
||
# Create an in-process kernel | ||
kernel_manager = QtInProcessKernelManager() | ||
kernel_manager.start_kernel() | ||
kernel = kernel_manager.kernel | ||
kernel.gui = 'qt4' | ||
|
||
import mantidplot | ||
kernel.shell.push(mantidplot.__dict__) | ||
import mantid.simpleapi | ||
kernel.shell.push(mantid.simpleapi.__dict__) | ||
|
||
kernel_client = kernel_manager.client() | ||
kernel_client.start_channels() | ||
|
||
self.kernel_manager = kernel_manager | ||
self.kernel_client = kernel_client | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters