ROOT  6.06/09
Reference Guide
cppmagic.py
Go to the documentation of this file.
1 
2 from IPython.core.magic import (Magics, magics_class, cell_magic)
3 from IPython.core.magic_arguments import (argument, magic_arguments, parse_argstring)
4 import utils
5 
6 
7 @magics_class
8 class CppMagics(Magics):
9  @cell_magic
10  @magic_arguments()
11  @argument('-a', '--aclic', action="store_true", help='Compile code with ACLiC.')
12  @argument('-d', '--declare', action="store_true", help='Declare functions and/or classes.')
13  def cpp(self, line, cell):
14  '''Executes the content of the cell as C++ code.'''
15  args = parse_argstring(self.cpp, line)
16  if args.aclic:
17  utils.invokeAclic(cell)
18  elif args.declare:
19  utils.declareCppCode(cell)
20  else:
21  utils.processCppCode(cell)
22 
24  ipython.register_magics(CppMagics)
def load_ipython_extension(ipython)
Definition: cppmagic.py:23
def cpp(self, line, cell)
Definition: cppmagic.py:13