Skip to content
Snippets Groups Projects
Commit ec538f03 authored by Attila Bagoly's avatar Attila Bagoly Committed by Enric Tejedor Saavedra
Browse files

JsMVA: jsmva magic extra lines fix

parent 3603094e
No related branches found
No related tags found
No related merge requests found
......@@ -208,16 +208,17 @@ class JsDraw:
</script>
""")
## Template containing requirejs configuration with JsMVA location
__jsCodeRequireJSConfig = Template("""
<script type="text/javascript">
require.config({
paths: {
'JsMVA':'$PATH/JsMVA.min'
}
});
</script>
""")
## Template containing JsMVA initialization code (adding JsMVA script location, and CSS)
__JsMVAInitCode = Template("""
<script type="text/javascript">
require.config({
paths: {
'JsMVA':'$PATH/JsMVA.min'
}
});
</script>
<link rel="stylesheet" href="$CSSFile"></link>
""")
## Template containing data insertion JavaScript code
__jsCodeForDataInsert = Template("""<script id="dataInserterScript">
......@@ -233,13 +234,13 @@ jsmva.$funcName('$divid', '$dat');
});
</script>""")
## Inserts requirejs config script
## Inserts initialization codes to notebook
@staticmethod
def InitJsMVA():
display(HTML(JsDraw.__jsCodeRequireJSConfig.substitute({
'PATH': JsDraw.__jsMVASourceDir
display(HTML(JsDraw.__JsMVAInitCode.substitute({
'PATH': JsDraw.__jsMVASourceDir,
'CSSFile': JsDraw.__jsMVACSSDir + '/TMVAHTMLOutput.min.css'
})))
JsDraw.InsertCSS("TMVAHTMLOutput.min.css")
## Inserts the draw area and drawing JavaScript to output
# @param obj ROOT object (will be converted to JSON) or JSON string containing the data to be drawed
......
......@@ -311,7 +311,7 @@ class transformTMVAOutputToHTML:
self.err = ""
if str(error).find(", time left:")==-1:
self.err = error
self.out = "<table class='tmva_output_table'>"
self.out = ""
self.lines = output.splitlines()
self.iterLines = iter(xrange(len(self.lines)))
for self.lineIndex in self.iterLines:
......@@ -357,5 +357,7 @@ class transformTMVAOutputToHTML:
self.out += "<tr><td>"+lines[ii]+"</td></tr>"
else:
self.out += line
self.out += "</table>"
if len(self.out) < 1 and len(self.err) < 1:
return ("", "", "")
self.out = "<table class='tmva_output_table'>" + self.out + "</table>"
return (self.out, self.err, "html")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment