15 from tempfile
import NamedTemporaryFile
23 raise Exception(
"Error: JupyROOT not found")
37 from ROOT
import JupyROOTExecutorHandler
38 _ioHandler = JupyROOTExecutorHandler()
44 from ROOT
import JupyROOTExecutor
45 _Executor = JupyROOTExecutor
51 from ROOT
import JupyROOTDeclarer
52 _Declarer = JupyROOTDeclarer
61 tmpfile = NamedTemporaryFile(delete=
False,suffix=
'.C',dir=os.getcwd())
63 tmpfilename = tmpfile.name
66 status = Executor(
'.L %s+'%tmpfilename)
70 '''Class to load JupyROOT Magics'''
72 magics_path = os.path.dirname(__file__)+
"/magics/*.py"
73 for file
in glob(magics_path):
74 if file != magics_path.replace(
"*.py",
"__init__.py"):
75 module_path=
"JupyROOT.kernel.magics."+file.split(
"/")[-1].replace(
".py",
"")
77 module= __builtin__.__import__(module_path, globals(), locals(), [
'register_magics'], -1)
78 module.register_magics(kernel)
80 raise Exception(
"Error importing Magic: %s"%module_path)
ROOT::R::TRInterface & Exception()