ROOT  6.06/08
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 (command, errMsg=None)
 
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
 
bool _enableJSVis = False
 
bool _enableJSVisDebug = False
 
list captures
 

Function Documentation

§ _checkOutput()

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

Definition at line 162 of file utils.py.

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

§ _codeToFilename()

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 185 of file utils.py.

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

§ _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 194 of file utils.py.

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

§ _getLibExtension()

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 96 of file utils.py.

§ _getPlatform()

def ROOTaaS.iPyROOT.utils._getPlatform ( )
private

Definition at line 93 of file utils.py.

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

§ _invokeAclicMac()

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 171 of file utils.py.

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

§ _PyDraw()

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

Definition at line 365 of file utils.py.

§ _setIgnoreLevel()

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

Definition at line 115 of file utils.py.

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

§ commentRemover()

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 121 of file utils.py.

§ declareCppCode()

def ROOTaaS.iPyROOT.utils.declareCppCode (   code)

Definition at line 159 of file utils.py.

§ declareCppCodeImpl()

def ROOTaaS.iPyROOT.utils.declareCppCodeImpl (   code)

Definition at line 152 of file utils.py.

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

§ disableJSVis()

def ROOTaaS.iPyROOT.utils.disableJSVis ( )

Definition at line 77 of file utils.py.

§ disableJSVisDebug()

def ROOTaaS.iPyROOT.utils.disableJSVisDebug ( )

Definition at line 87 of file utils.py.

§ enableCppHighlighting()

def ROOTaaS.iPyROOT.utils.enableCppHighlighting ( )

Definition at line 401 of file utils.py.

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

§ enableJSVis()

def ROOTaaS.iPyROOT.utils.enableJSVis ( )

Definition at line 73 of file utils.py.

§ enableJSVisDebug()

def ROOTaaS.iPyROOT.utils.enableJSVisDebug ( )

Definition at line 81 of file utils.py.

§ enhanceROOTModule()

def ROOTaaS.iPyROOT.utils.enhanceROOTModule ( )

Definition at line 392 of file utils.py.

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

§ invokeAclic()

def ROOTaaS.iPyROOT.utils.invokeAclic (   cell)

Definition at line 205 of file utils.py.

§ iPythonize()

def ROOTaaS.iPyROOT.utils.iPythonize ( )

Definition at line 408 of file utils.py.

§ loadExtensionsAndCapturers()

def ROOTaaS.iPyROOT.utils.loadExtensionsAndCapturers ( )

Definition at line 382 of file utils.py.

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

§ processCppCode()

def ROOTaaS.iPyROOT.utils.processCppCode (   code)

Definition at line 156 of file utils.py.

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

§ processCppCodeImpl()

def ROOTaaS.iPyROOT.utils.processCppCodeImpl (   code)

Definition at line 148 of file utils.py.

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

§ setStyle()

def ROOTaaS.iPyROOT.utils.setStyle ( )

Definition at line 373 of file utils.py.

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

§ toCpp()

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 270 of file utils.py.

§ welcomeMsg()

def ROOTaaS.iPyROOT.utils.welcomeMsg ( )

Definition at line 111 of file utils.py.

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

Variable Documentation

§ _enableJSVis

bool ROOTaaS.iPyROOT.utils._enableJSVis = False
private

Definition at line 71 of file utils.py.

§ _enableJSVisDebug

bool ROOTaaS.iPyROOT.utils._enableJSVisDebug = False
private

Definition at line 72 of file utils.py.

§ _jsCanvasHeight

int ROOTaaS.iPyROOT.utils._jsCanvasHeight = 600
private

Definition at line 46 of file utils.py.

§ _jsCanvasWidth

int ROOTaaS.iPyROOT.utils._jsCanvasWidth = 800
private

Definition at line 45 of file utils.py.

§ _jsCode

string ROOTaaS.iPyROOT.utils._jsCode
private
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 48 of file utils.py.

§ _jsDefaultHighlight

string ROOTaaS.iPyROOT.utils._jsDefaultHighlight
private
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 28 of file utils.py.

§ _jsMagicHighlight

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

Definition at line 38 of file utils.py.

§ _jsNotDrawableClassesPatterns

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

Definition at line 41 of file utils.py.

§ _jsROOTSourceDir

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

Definition at line 44 of file utils.py.

§ captures

list ROOTaaS.iPyROOT.utils.captures
Initial value:
1 = [StreamCapture(sys.stderr),
2  StreamCapture(sys.stdout),
3  CaptureDrawnCanvases()]

Definition at line 266 of file utils.py.

§ cppMIME

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

Definition at line 25 of file utils.py.

§ ipyMIME

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

Definition at line 26 of file utils.py.