Skip to content

Commit

Permalink
Merge pull request #23984 from davidlange6/printMig_180721T4_Geometry…
Browse files Browse the repository at this point in the history
…_TrackerCommonData

Print function migration for Geometry_TrackerCommonData
  • Loading branch information
cmsbuild committed Jul 24, 2018
2 parents f61b20d + ff5f51d commit c686b6f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Geometry/TrackerCommonData/data/Materials/insertMaterial.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from __future__ import print_function
import sys
import xml.dom.minidom
import math
Expand Down Expand Up @@ -102,30 +103,30 @@ def getAttributes(node):
#(not used but interessting for debug)
def dokument(domina):
for node in domina.childNodes:
print "NodeName:", node.nodeName,
print("NodeName:", node.nodeName, end=' ')
if node.nodeType == node.ELEMENT_NODE:
print "Typ ELEMENT_NODE"
print getAttributes(node)
print("Typ ELEMENT_NODE")
print(getAttributes(node))
elif node.nodeType == node.TEXT_NODE:
print "Typ TEXT_NODE, Content: ", node.nodeValue.strip()
print("Typ TEXT_NODE, Content: ", node.nodeValue.strip())
elif node.nodeType == node.COMMENT_NODE:
print "Typ COMMENT_NODE, "
print("Typ COMMENT_NODE, ")
#dokument(node)

#prints all CompositeMaterials beneeth [rootNode]
#(not used but interessting for debug)
def printMaterials(rootNode):
matNodes = getNodes(rootNode,"CompositeMaterial")
for name in matNodes:
print " "+name+" (dens = "+getAttributes(matNodes[name])["density"]+")"
print(" "+name+" (dens = "+getAttributes(matNodes[name])["density"]+")")
for fractionNode in matNodes[name].childNodes:
if fractionNode.nodeName == "MaterialFraction":
fractionString = getAttributes(fractionNode)["fraction"]
for materialNode in fractionNode.childNodes:
if materialNode.nodeName == "rMaterial":
fractionString += "\tof "+getAttributes(materialNode)["name"].split(":")[1]
fractionString += "\tfrom "+getAttributes(materialNode)["name"].split(":")[0]
print " |-- "+fractionString
print(" |-- "+fractionString)

#returns the Material Section doe of a DDD Material xmlfile
def getMaterialSection(rootNode):
Expand Down

0 comments on commit c686b6f

Please sign in to comment.