Skip to content
Snippets Groups Projects
Commit d71eb698 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Re #13987. Removing pylint warnings

parent 5920967c
No related branches found
No related tags found
No related merge requests found
...@@ -10,19 +10,19 @@ def convertToVTU(infile, outpath): ...@@ -10,19 +10,19 @@ def convertToVTU(infile, outpath):
planelist=[] planelist=[]
npoints = 0 npoints = 0
for line in datafile: for line in datafile:
numbers = line.split(); numbers = line.split()
if( len(numbers) != 4 ): if len(numbers) != 4 :
continue continue
if( npoints == 0 ): if npoints == 0 :
curz = numbers[2] curz = numbers[2]
if( numbers[2] != curz ): if numbers[2] != curz :
datalist.append(planelist) datalist.append(planelist)
curz = numbers[2] curz = numbers[2]
planelist=[] planelist=[]
planelist.append(numbers) planelist.append(numbers)
npoints += 1 npoints += 1
# Append last set # Append last set
datalist.append(planelist) datalist.append(planelist)
datafile.close() datafile.close()
...@@ -43,7 +43,7 @@ def convertToVTU(infile, outpath): ...@@ -43,7 +43,7 @@ def convertToVTU(infile, outpath):
piece.setAttribute( "NumberOfPoints", str(npoints)) piece.setAttribute( "NumberOfPoints", str(npoints))
piece.setAttribute( "NumberOfCells", str(ncells)) piece.setAttribute( "NumberOfCells", str(ncells))
# First the PointData element # First the PointData element
point_data = doc.createElement("PointData") point_data = doc.createElement("PointData")
piece.appendChild(point_data) piece.appendChild(point_data)
point_data.setAttribute("Scalars", "Intensity") point_data.setAttribute("Scalars", "Intensity")
...@@ -59,7 +59,7 @@ def convertToVTU(infile, outpath): ...@@ -59,7 +59,7 @@ def convertToVTU(infile, outpath):
txt = doc.createTextNode(str(point[3])) txt = doc.createTextNode(str(point[3]))
data_array.appendChild(txt) data_array.appendChild(txt)
# Now the Points element # Now the Points element
points = doc.createElement("Points") points = doc.createElement("Points")
piece.appendChild(points) piece.appendChild(points)
...@@ -111,12 +111,12 @@ def convertToVTU(infile, outpath): ...@@ -111,12 +111,12 @@ def convertToVTU(infile, outpath):
txt = doc.createTextNode("4") txt = doc.createTextNode("4")
data_array.appendChild(txt) data_array.appendChild(txt)
# #print doc.toprettyxml(newl="\n") #print doc.toprettyxml(newl="\n")
shortname = infile.split('/') shortname = infile.split('/')
name = outpath + shortname[len(shortname)-1] + ".vtu" name = outpath + shortname[len(shortname)-1] + ".vtu"
file = open(name,'w') handle = open(name,'w')
doc.writexml(file, newl="\n") doc.writexml(handle, newl="\n")
file.close() handle.close()
del datalist del datalist
del planelist del planelist
...@@ -160,6 +160,6 @@ def writeParallelVTU(files, prefix): ...@@ -160,6 +160,6 @@ def writeParallelVTU(files, prefix):
# print doc.toprettyxml(newl="\n") # print doc.toprettyxml(newl="\n")
filename = prefix + files[0].split('.')[0] + ".pvtu" filename = prefix + files[0].split('.')[0] + ".pvtu"
# print filename # print filename
file = open(filename,'w') handle = open(filename,'w')
doc.writexml(file, newl="\n") doc.writexml(handle, newl="\n")
file.close() handle.close()
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