ROOT  6.06/09
Reference Guide
Classes | Functions | Variables
ROOTaaS.iPyROOT.utils Namespace Reference

Classes

class  CanvasDrawer
 
class  CaptureDrawnCanvases
 
class  StreamCapture
 

Functions

def enableJSVis ()
 
def disableJSVis ()
 
def enableJSVisDebug ()
 
def disableJSVisDebug ()
 
def _getPlatform ()
 
def _getLibExtension (thePlatform)
 
def welcomeMsg ()
 
def _setIgnoreLevel (level)
 
def commentRemover (text)
 
def processCppCodeImpl (code)
 
def declareCppCodeImpl (code)
 
def processCppCode (code)
 
def declareCppCode (code)
 
def _checkOutput
 
def _invokeAclicMac (fileName)
 
def _codeToFilename (code)
 
def _dumpToUniqueFile (code)
 
def invokeAclic (cell)
 
def toCpp ()
 
def _PyDraw (thePad)
 
def setStyle ()
 
def loadExtensionsAndCapturers ()
 
def enhanceROOTModule ()
 
def enableCppHighlighting ()
 
def iPythonize ()
 

Variables

string cppMIME = 'text/x-c++src'
 
string ipyMIME = 'text/x-ipython'
 
string _jsDefaultHighlight
 
string _jsMagicHighlight = "IPython.CodeCell.config_defaults.highlight_modes['magic_{cppMIME}'] = {{'reg':[/^%%cpp/]}};"
 
list _jsNotDrawableClassesPatterns = ["TGraph[23]D","TH3*","TGraphPolar","TProf*","TEve*","TF[23]","TGeo*","TPolyLine3D"]
 
string _jsROOTSourceDir = "https://root.cern.ch/js/dev/"
 
int _jsCanvasWidth = 800
 
int _jsCanvasHeight = 600
 
string _jsCode
 
 _enableJSVis = False
 
 _enableJSVisDebug = False
 
list captures
 

Function Documentation

def ROOTaaS.iPyROOT.utils._checkOutput (   command,
  errMsg = None 
)
private

Definition at line 163 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils._invokeAclicMac().

def ROOTaaS.iPyROOT.utils._codeToFilename (   code)
private
Convert code to a unique file name

>>> _codeToFilename("int f(i){return i*i;}")
'dbf7e731.C'

Definition at line 186 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils._dumpToUniqueFile().

def ROOTaaS.iPyROOT.utils._dumpToUniqueFile (   code)
private
Dump code to file whose name is unique

>>> _codeToFilename("int f(i){return i*i;}")
'dbf7e731.C'

Definition at line 195 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.invokeAclic().

def ROOTaaS.iPyROOT.utils._getLibExtension (   thePlatform)
private
Return appropriate file extension for a shared library
>>> _getLibExtension('darwin')
'.dylib'
>>> _getLibExtension('win32')
'.dll'
>>> _getLibExtension('OddPlatform')
'.so'

Definition at line 97 of file utils.py.

def ROOTaaS.iPyROOT.utils._getPlatform ( )
private

Definition at line 94 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.invokeAclic().

def ROOTaaS.iPyROOT.utils._invokeAclicMac (   fileName)
private
FIXME!
This function is a workaround. On osx, it is impossible to link against
libzmq.so, among the others. The error is known and is
"ld: can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB)"
We cannot at the moment force Aclic to change the linker command in order
to exclude these libraries, so we launch a second root session to compile
the library, which we then load.

Definition at line 172 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.invokeAclic().

def ROOTaaS.iPyROOT.utils._PyDraw (   thePad)
private
Invoke the draw function and intercept the graphics

Definition at line 366 of file utils.py.

def ROOTaaS.iPyROOT.utils._setIgnoreLevel (   level)
private

Definition at line 116 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.CanvasDrawer._pngDisplay().

def ROOTaaS.iPyROOT.utils.commentRemover (   text)
>>> s="// hello"
>>> commentRemover(s)
''
>>> s="int /** Test **/ main() {return 0;}"
>>> commentRemover(s)
'int  main() {return 0;}'

Definition at line 122 of file utils.py.

def ROOTaaS.iPyROOT.utils.declareCppCode (   code)

Definition at line 160 of file utils.py.

def ROOTaaS.iPyROOT.utils.declareCppCodeImpl (   code)

Definition at line 153 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.declareCppCode().

def ROOTaaS.iPyROOT.utils.disableJSVis ( )

Definition at line 78 of file utils.py.

def ROOTaaS.iPyROOT.utils.disableJSVisDebug ( )

Definition at line 88 of file utils.py.

def ROOTaaS.iPyROOT.utils.enableCppHighlighting ( )

Definition at line 402 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.iPythonize().

def ROOTaaS.iPyROOT.utils.enableJSVis ( )

Definition at line 74 of file utils.py.

def ROOTaaS.iPyROOT.utils.enableJSVisDebug ( )

Definition at line 82 of file utils.py.

def ROOTaaS.iPyROOT.utils.enhanceROOTModule ( )

Definition at line 393 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.iPythonize().

def ROOTaaS.iPyROOT.utils.invokeAclic (   cell)

Definition at line 206 of file utils.py.

def ROOTaaS.iPyROOT.utils.iPythonize ( )

Definition at line 409 of file utils.py.

def ROOTaaS.iPyROOT.utils.loadExtensionsAndCapturers ( )

Definition at line 383 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.iPythonize().

def ROOTaaS.iPyROOT.utils.processCppCode (   code)

Definition at line 157 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.invokeAclic().

def ROOTaaS.iPyROOT.utils.processCppCodeImpl (   code)

Definition at line 149 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.processCppCode().

def ROOTaaS.iPyROOT.utils.setStyle ( )

Definition at line 374 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.iPythonize().

def ROOTaaS.iPyROOT.utils.toCpp ( )
Change the mode of the notebook to CPP. It is preferred to use cell magic,
but this option is handy to set up servers and for debugging purposes.

Definition at line 271 of file utils.py.

def ROOTaaS.iPyROOT.utils.welcomeMsg ( )

Definition at line 112 of file utils.py.

Referenced by ROOTaaS.iPyROOT.utils.iPythonize().

Variable Documentation

ROOTaaS.iPyROOT.utils._enableJSVis = False

Definition at line 72 of file utils.py.

ROOTaaS.iPyROOT.utils._enableJSVisDebug = False

Definition at line 73 of file utils.py.

int ROOTaaS.iPyROOT.utils._jsCanvasHeight = 600

Definition at line 47 of file utils.py.

int ROOTaaS.iPyROOT.utils._jsCanvasWidth = 800

Definition at line 46 of file utils.py.

string ROOTaaS.iPyROOT.utils._jsCode
Initial value:
1 = """
2 <div id="{jsDivId}"
3  style="width: {jsCanvasWidth}px; height: {jsCanvasHeight}px">
4 </div>
5 
6 <script>
7 requirejs.config(
8 {{
9  paths: {{
10  'JSRootCore' : '{jsROOTSourceDir}/scripts/JSRootCore',
11  'JSRootPainter' : '{jsROOTSourceDir}/scripts/JSRootPainter',
12  }}
13 }}
14 );
15 require(['JSRootCore', 'JSRootPainter'],
16  function(Core, Painter) {{
17  var obj = Core.parse('{jsonContent}');
18  Painter.draw("{jsDivId}", obj, "{jsDrawOptions}");
19  }}
20 );
21 </script>
22 """

Definition at line 49 of file utils.py.

string ROOTaaS.iPyROOT.utils._jsDefaultHighlight
Initial value:
1 = """
2 // Set default mode for code cells
3 IPython.CodeCell.options_default.cm_config.mode = '{mimeType}';
4 // Set CodeMirror's current mode
5 var cells = IPython.notebook.get_cells();
6 cells[cells.length-1].code_mirror.setOption('mode', '{mimeType}');
7 // Set current mode for newly created cell
8 cells[cells.length-1].cm_config.mode = '{mimeType}';
9 """

Definition at line 29 of file utils.py.

string ROOTaaS.iPyROOT.utils._jsMagicHighlight = "IPython.CodeCell.config_defaults.highlight_modes['magic_{cppMIME}'] = {{'reg':[/^%%cpp/]}};"

Definition at line 39 of file utils.py.

list ROOTaaS.iPyROOT.utils._jsNotDrawableClassesPatterns = ["TGraph[23]D","TH3*","TGraphPolar","TProf*","TEve*","TF[23]","TGeo*","TPolyLine3D"]

Definition at line 42 of file utils.py.

string ROOTaaS.iPyROOT.utils._jsROOTSourceDir = "https://root.cern.ch/js/dev/"

Definition at line 45 of file utils.py.

list ROOTaaS.iPyROOT.utils.captures
Initial value:

Definition at line 267 of file utils.py.

string ROOTaaS.iPyROOT.utils.cppMIME = 'text/x-c++src'

Definition at line 26 of file utils.py.

string ROOTaaS.iPyROOT.utils.ipyMIME = 'text/x-ipython'

Definition at line 27 of file utils.py.