diff --git a/examples/widgets/directview/directview.ipynb b/examples/widgets/directview/directview.ipynb
deleted file mode 100644
index e477e90..0000000
--- a/examples/widgets/directview/directview.ipynb
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "metadata": {
- "name": "directview"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from directview import interact\n",
- "from IPython.parallel import Client"
- ],
- "language": "python",
- "metadata": {},
- "outputs": []
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "c = Client()\n",
- "dv = c[:]"
- ],
- "language": "python",
- "metadata": {},
- "outputs": []
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "interact(dv)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": []
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/widgets/directview/directview.js b/examples/widgets/directview/directview.js
deleted file mode 100644
index 37c6ab4..0000000
--- a/examples/widgets/directview/directview.js
+++ /dev/null
@@ -1,172 +0,0 @@
-//----------------------------------------------------------------------------
-// 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.
-//----------------------------------------------------------------------------
-
-//============================================================================
-// EngineInteract
-//============================================================================
-
-var key = IPython.utils.keycodes;
-
-
-var DirectViewWidget = function (selector, kernel, targets) {
- // The kernel doesn't have to be set at creation time, in that case
- // it will be null and set_kernel has to be called later.
- this.selector = selector;
- this.element = $(selector);
- this.kernel = kernel || null;
- this.code_mirror = null;
- this.targets = targets;
- this.create_element();
-};
-
-
-DirectViewWidget.prototype.create_element = function () {
- this.element.addClass('cell border-box-sizing code_cell vbox');
- this.element.attr('tabindex','2');
- this.element.css('padding-right',0);
-
- var control = $('
').addClass('dv_control').height('30px');
- var control_label = $('').html('Select engine(s) to run code on interactively: ');
- control_label.css('line-height','30px');
- var select = $('').addClass('dv_select ui-widget ui-widget-content');
- select.css('font-size','85%%').css('margin-bottom','5px');
- var n = this.targets.length;
- select.append($('').html('all').attr('value','all'));
- for (var i=0; i').html(this.targets[i]).attr('value',this.targets[i]))
- }
- control.append(control_label).append(select);
-
- var input = $('').addClass('input hbox');
- var input_area = $('').addClass('input_area box-flex1');
- this.code_mirror = CodeMirror(input_area.get(0), {
- indentUnit : 4,
- mode: 'python',
- theme: 'ipython',
- onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this)
- });
- input.append(input_area);
- var output = $('');
-
-
- this.element.append(control).append(input).append(output);
- this.output_area = new IPython.OutputArea(output, false);
-
-};
-
-
-DirectViewWidget.prototype.handle_codemirror_keyevent = function (editor, event) {
- // This method gets called in CodeMirror's onKeyDown/onKeyPress
- // handlers and is used to provide custom key handling. Its return
- // value is used to determine if CodeMirror should ignore the event:
- // true = ignore, false = don't ignore.
-
- var that = this;
- var cur = editor.getCursor();
-
- if (event.keyCode === key.ENTER && event.shiftKey && event.type === 'keydown') {
- // Always ignore shift-enter in CodeMirror as we handle it.
- event.stop();
- that.execute();
- return true;
- } else if (event.keyCode === key.UP && event.type === 'keydown') {
- event.stop();
- return false;
- } else if (event.keyCode === key.DOWN && event.type === 'keydown') {
- event.stop();
- return false;
- } else if (event.keyCode === key.BACKSPACE && event.type == 'keydown') {
- // If backspace and the line ends with 4 spaces, remove them.
- var line = editor.getLine(cur.line);
- var ending = line.slice(-4);
- if (ending === ' ') {
- editor.replaceRange('',
- {line: cur.line, ch: cur.ch-4},
- {line: cur.line, ch: cur.ch}
- );
- event.stop();
- return true;
- } else {
- return false;
- };
- };
-
- return false;
-};
-
-
-// Kernel related calls.
-
-
-DirectViewWidget.prototype.set_kernel = function (kernel) {
- this.kernel = kernel;
-}
-
-
-DirectViewWidget.prototype.execute = function () {
- this.output_area.clear_output();
- this.element.addClass("running");
- var callbacks = {
- 'execute_reply': $.proxy(this._handle_execute_reply, this),
- 'output': $.proxy(this.output_area.handle_output, this.output_area),
- 'clear_output': $.proxy(this.output_area.handle_clear_output, this.output_area),
- };
- var target = this.element.find('.dv_select option:selected').attr('value');
- if (target === 'all') {
- target = '"all"';
- }
- var code = '%(widget_var)s.execute("""'+this.get_text()+'""",targets='+target+')';
- var msg_id = this.kernel.execute(code, callbacks, {silent: false});
- this.clear_input();
- this.code_mirror.focus();
-};
-
-
-DirectViewWidget.prototype._handle_execute_reply = function (content) {
- this.element.removeClass("running");
- // this.dirty = true;
-}
-
-// Basic cell manipulation.
-
-
-DirectViewWidget.prototype.select_all = function () {
- var start = {line: 0, ch: 0};
- var nlines = this.code_mirror.lineCount();
- var last_line = this.code_mirror.getLine(nlines-1);
- var end = {line: nlines-1, ch: last_line.length};
- this.code_mirror.setSelection(start, end);
-};
-
-
-DirectViewWidget.prototype.clear_input = function () {
- this.code_mirror.setValue('');
-};
-
-
-DirectViewWidget.prototype.get_text = function () {
- return this.code_mirror.getValue();
-};
-
-
-DirectViewWidget.prototype.set_text = function (code) {
- return this.code_mirror.setValue(code);
-};
-
-container.show();
-var widget = $('')
-// When templating over a JSON string, we must use single quotes.
-var targets = '%(targets)s';
-targets = $.parseJSON(targets);
-var eiw = new DirectViewWidget(widget, IPython.notebook.kernel, targets);
-element.append(widget);
-element.css('padding',0);
-setTimeout(function () {
- eiw.code_mirror.refresh();
- eiw.code_mirror.focus();
-}, 1);
-
diff --git a/examples/widgets/directview/directview.py b/examples/widgets/directview/directview.py
deleted file mode 100644
index 59fa0fb..0000000
--- a/examples/widgets/directview/directview.py
+++ /dev/null
@@ -1,68 +0,0 @@
-"""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
-
-from widget import JavascriptWidget
-
-
-class DirectViewWidget(JavascriptWidget):
-
- def __init__(self, dv):
- self.dv = dv
- self.targets = self.dv.targets
- super(DirectViewWidget,self).__init__()
-
- def render(self):
- fname = os.path.join(os.path.dirname(__file__), u'directview.js')
- with open(fname, 'r') as f:
- jscode = f.read()
- data = {
- 'widget_var': self.widget_var,
- 'targets' : self.encode_json(self.targets)
- }
- jscode = jscode % data
- return jscode
-
- def execute(self, code, targets='all'):
- if targets == 'all':
- targets = self.targets
- result = self.dv.execute(code,silent=False,block=False,targets=targets)
- result.wait()
- result.display_outputs()
-
-
-def interact(dv):
- w = DirectViewWidget(dv)
- w.interact()
- return w
-
-
diff --git a/examples/widgets/directview/widget.py b/examples/widgets/directview/widget.py
deleted file mode 100644
index a209913..0000000
--- a/examples/widgets/directview/widget.py
+++ /dev/null
@@ -1,58 +0,0 @@
-"""Python support code for JavaScript based widgets.
-
-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 zmq.utils import jsonapi
-
-#-----------------------------------------------------------------------------
-# Code
-#-----------------------------------------------------------------------------
-
-
-
-class JavascriptWidget(object):
-
- jslibs = []
-
- def __init__(self):
- self.widget_id = unicode(uuid.uuid4()).replace('-','')
- self.widget_var = '__widget_%s' % self.widget_id
- ns = get_ipython().user_ns
- ns[self.widget_var] = self
-
- def encode_json(self, o):
- return jsonapi.dumps(o)
-
- def decode_json(self, s):
- return jsonapi.loads(s)
-
- def interact(self):
- """This should call display(Javascript(jscode))."""
- jscode = self.render()
- display(Javascript(data=jscode,lib=self.jslibs))
-
- def render(self):
- """Return the final JavaScript code that will be eval'd in the client."""
- raise NotImplementedError('render is not implemented in this base class')
-
-
-