From 565e56cc7e174381f988aa09578a9e49ad959a3f Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 19 May 2015 13:37:50 -0700 Subject: [PATCH] allow specifying CLING_EXE env --- tools/Jupyter/kernel/README.md | 7 +++++-- tools/Jupyter/kernel/clingkernel.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/Jupyter/kernel/README.md b/tools/Jupyter/kernel/README.md index a1c9ae4c..0766e1ac 100644 --- a/tools/Jupyter/kernel/README.md +++ b/tools/Jupyter/kernel/README.md @@ -1,2 +1,5 @@ -# clingkernel -C++ Kernel for Jupyter with Cling +# Cling Kernel + +C++ Kernel for Jupyter with Cling. + +You will probably need to specify the path to cling with the `CLING_EXE` env variable. diff --git a/tools/Jupyter/kernel/clingkernel.py b/tools/Jupyter/kernel/clingkernel.py index a9b2164f..35fae60f 100644 --- a/tools/Jupyter/kernel/clingkernel.py +++ b/tools/Jupyter/kernel/clingkernel.py @@ -2,6 +2,7 @@ from __future__ import print_function +import os from pipes import quote import re import signal @@ -87,9 +88,12 @@ class ClingKernel(Kernel): 'mimetype': ' text/x-c++src', 'file_extension': '.c++'} - cling = Unicode('cling', config=True, + cling = Unicode(config=True, help="Path to cling if not on your PATH." ) + def _cling_default(self): + return os.environ.get('CLING_EXE') or 'cling' + def __init__(self, **kwargs): Kernel.__init__(self, **kwargs)