summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst8
-rw-r--r--kernelspec/kernel.json6
-rw-r--r--octave_kernel.py (renamed from bash_kernel.py)20
-rw-r--r--setup.py21
4 files changed, 27 insertions, 28 deletions
diff --git a/README.rst b/README.rst
index 6824169..dd8d5e6 100644
--- a/README.rst
+++ b/README.rst
@@ -1,12 +1,10 @@
-A simple IPython kernel for bash
+A simple IPython kernel for Octave
This requires IPython 3, which is not yet released.
To test it, install with ``setup.py``, then::
- ipython qtconsole --kernel bash
+ ipython qtconsole --kernel octave
For details of how this works, see IPython's docs on `wrapper kernels
-<http://ipython.org/ipython-doc/dev/development/wrapperkernels.html>`_, and
-Pexpect's docs on the `replwrap module
-<http://pexpect.readthedocs.org/en/latest/api/replwrap.html>`_
+<http://ipython.org/ipython-doc/dev/development/wrapperkernels.html>`_.
diff --git a/kernelspec/kernel.json b/kernelspec/kernel.json
index 9e9dbf2..775480f 100644
--- a/kernelspec/kernel.json
+++ b/kernelspec/kernel.json
@@ -1,5 +1,5 @@
-{"argv":["python3","-m","bash_kernel", "-f", "{connection_file}"],
- "display_name":"Bash",
- "language":"bash",
+{"argv":["python3","-m","octave_kernel", "-f", "{connection_file}"],
+ "display_name":"Octave",
+ "language":"octave",
"codemirror_mode":"shell"
}
diff --git a/bash_kernel.py b/octave_kernel.py
index 00cc795..129ce01 100644
--- a/bash_kernel.py
+++ b/octave_kernel.py
@@ -1,18 +1,18 @@
from IPython.kernel.zmq.kernelbase import Kernel
-from pexpect import replwrap
import signal
from subprocess import check_output
import re
-__version__ = '0.2'
+__version__ = '0.1'
version_pat = re.compile(r'version (\d+(\.\d+)+)')
-class BashKernel(Kernel):
- implementation = 'bash_kernel'
+
+class OctaveKernel(Kernel):
+ implementation = 'octave_kernel'
implementation_version = __version__
- language = 'bash'
+ language = 'octave'
@property
def language_version(self):
m = version_pat.search(self.banner)
@@ -22,9 +22,9 @@ class BashKernel(Kernel):
@property
def banner(self):
if self._banner is None:
- self._banner = check_output(['bash', '--version']).decode('utf-8')
+ self._banner = check_output(['octave', '--version']).decode('utf-8')
return self._banner
-
+
def __init__(self, **kwargs):
Kernel.__init__(self, **kwargs)
# Signal handlers are inherited by forked processes, and we can't easily
@@ -55,10 +55,10 @@ class BashKernel(Kernel):
if not silent:
stream_content = {'name': 'stdout', 'data':output}
self.send_response(self.iopub_socket, 'stream', stream_content)
-
+
if interrupted:
return {'status': 'abort', 'execution_count': self.execution_count}
-
+
try:
exitcode = int(self.run_command('echo $?').rstrip())
except Exception:
@@ -73,4 +73,4 @@ class BashKernel(Kernel):
if __name__ == '__main__':
from IPython.kernel.zmq.kernelapp import IPKernelApp
- IPKernelApp.launch_instance(kernel_class=BashKernel)
+ IPKernelApp.launch_instance(kernel_class=OctaveKernel)
diff --git a/setup.py b/setup.py
index c20ddd8..26e4fea 100644
--- a/setup.py
+++ b/setup.py
@@ -2,11 +2,12 @@ from distutils.core import setup
from distutils.command.install import install
import sys
+
class install_with_kernelspec(install):
def run(self):
install.run(self)
from IPython.kernel.kernelspec import install_kernel_spec
- install_kernel_spec('kernelspec', 'bash', replace=True)
+ install_kernel_spec('kernelspec', 'octave', replace=True)
with open('README.rst') as f:
readme = f.read()
@@ -16,20 +17,20 @@ if svem_flag in sys.argv:
# Die, setuptools, die.
sys.argv.remove(svem_flag)
-setup(name='bash_kernel',
- version='0.2',
- description='A bash kernel for IPython',
+setup(name='octave_kernel',
+ version='0.1',
+ description='An Octave kernel for IPython',
long_description=readme,
- author='Thomas Kluyver',
- author_email='thomas@kluyver.me.uk',
- url='https://github.com/takluyver/bash_kernel',
- py_modules=['bash_kernel'],
+ author='Steven Silvester',
+ author_email='steven.silvester@ieee.org',
+ url='https://github.com/blink1073/octave_kernel',
+ py_modules=['octave_kernel'],
cmdclass={'install': install_with_kernelspec},
- install_requires=['pexpect>=3.3'],
+ install_requires=['oct2py'],
classifiers = [
'Framework :: IPython',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Topic :: System :: Shells',
]
-) \ No newline at end of file
+)