JsMVA
JsMVAMagic.py
Go to the documentation of this file.
1 # -*- coding:utf-8 -*-
2 ## @package JsMVA.JsMVAMagic
3 # IPython magic class for JsMVA
4 # @authors: Attila Bagoly <battila93@gmail.com>
5 
6 from IPython.core.magic import Magics, magics_class, line_magic
7 from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring
8 
9 
10 @magics_class
11 class JsMVAMagic(Magics):
12 
13  ## Standard constructor
14  def __init__(self, shell):
15  super(JsMVAMagic, self).__init__(shell)
16 
17  ## jsmva magic
18  @line_magic
19  @magic_arguments()
20  @argument('arg', nargs="?", default="on", help='Enable/Disable JavaScript visualisation for TMVA')
21  def jsmva(self, line):
22  from JPyInterface import functions
23  args = parse_argstring(self.jsmva, line)
24  if args.arg == 'on':
25  functions.register()
26  elif args.arg == 'off':
27  functions.unregister()
28 
29 
30 ## Function for registering the magic class
32  ipython.register_magics(JsMVAMagic)
def load_ipython_extension(ipython)
Function for registering the magic class.
Definition: JsMVAMagic.py:31
def __init__(self, shell)
Standard constructor.
Definition: JsMVAMagic.py:14
def jsmva(self, line)
Definition: JsMVAMagic.py:21