summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index b79c18e..0e95240 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
from distutils.core import setup
from distutils.command.install import install
+import json
import os
import sys
@@ -9,11 +10,27 @@ if sys.argv[-1] == 'publish':
sys.exit()
+kernel_json = {"argv": [sys.executable, "-m", "scilab_kernel", "-f",
+ "{connection_file}"],
+ "display_name": "Scilab",
+ "language": "scilab",
+ "codemirror_mode": "Octave"
+ }
+
+
class install_with_kernelspec(install):
def run(self):
+ # Regular installation
install.run(self)
- from IPython.kernel.kernelspec import install_kernel_spec
- install_kernel_spec('kernelspec', 'scilab', replace=True)
+
+ # Now write the kernelspec
+ from IPython.kernel.kernelspec import KernelSpecManager
+ from IPython.utils.path import ensure_dir_exists
+ destdir = os.path.join(KernelSpecManager().user_kernel_dir, 'scilab')
+ ensure_dir_exists(destdir)
+ with open(os.path.join(destdir, 'kernel.json'), 'w') as f:
+ json.dump(kernel_json, f, sort_keys=True)
+
with open('README.rst') as f:
readme = f.read()