##// END OF EJS Templates
rebuild example notebooks...
rebuild example notebooks * no longer reference left panel * no longer suggest starting the notebook with `--pylab`.

File last commit:

r7211:49a9eba4
r7739:dff285da
Show More
directview.py
68 lines | 1.8 KiB | text/x-python | PythonLexer
Brian Granger
Adding new widgets subpackage with base widget and example.
r7198 """Widget for interacting with an IPython parallel engine.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import uuid
from IPython.core.display import display, Javascript
from IPython.core.displaypub import publish_pretty
#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------
import os, sys
from IPython.core.display import Javascript
Brian Granger
Moving direct view widget to docs/examples.
r7211 from widget import JavascriptWidget
Brian Granger
Adding new widgets subpackage with base widget and example.
r7198
class DirectViewWidget(JavascriptWidget):
def __init__(self, dv):
self.dv = dv
self.targets = self.dv.targets
super(DirectViewWidget,self).__init__()
def render(self):
Brian Granger
Moving direct view widget to docs/examples.
r7211 fname = os.path.join(os.path.dirname(__file__), u'directview.js')
with open(fname, 'r') as f:
jscode = f.read()
Brian Granger
Adding new widgets subpackage with base widget and example.
r7198 data = {
'widget_var': self.widget_var,
'targets' : self.encode_json(self.targets)
}
jscode = jscode % data
return jscode
Brian Granger
Adding engine selection UI control to DirectViewWidget.
r7200 def execute(self, code, targets='all'):
if targets == 'all':
targets = self.targets
Brian Granger
Finishing the DirectView widget and adding an example notebook.
r7210 result = self.dv.execute(code,silent=False,block=False,targets=targets)
result.wait()
result.display_outputs()
Brian Granger
Adding new widgets subpackage with base widget and example.
r7198
def interact(dv):
w = DirectViewWidget(dv)
w.interact()
return w