Commit 3e44939d authored by Shawn Waldon's avatar Shawn Waldon

More print statements need parentheses

parent 8e4e6c37
Pipeline #39663 passed with stage
import sys
if len(sys.argv) != 3:
print "command is 'python <python driver code> <script name> <number of time steps>'"
print("command is 'python <python driver code> <script name> <number of time steps>'")
sys.exit(1)
import paraview
import paraview.vtk as vtk
......@@ -22,13 +22,13 @@ def coProcess(grid, time, step, scriptname, wholeExtent):
scriptpath, scriptname = os.path.split(scriptname)
sys.path.append(scriptpath)
if scriptname.endswith(".py"):
print 'script name is ', scriptname
print('script name is %s' % scriptname)
scriptname = scriptname[0:len(scriptname)-3]
try:
cpscript = __import__(scriptname)
except:
print sys.exc_info()
print 'Cannot find ', scriptname, ' -- no coprocessing will be performed.'
print(sys.exc_info())
print('Cannot find %s -- no coprocessing will be performed.' % scriptname)
sys.exit(1)
return
......@@ -52,14 +52,14 @@ def coProcess(grid, time, step, scriptname, wholeExtent):
try:
numsteps = int(sys.argv[2])
except ValueError:
print 'the last argument should be a number'
print('the last argument should be a number')
numsteps = 10
#imageData2 = vtk.vtkImageData()
for step in range(numsteps):
print "Timestep ", step
print("Timestep %d" % step)
# assume simulation time starts at 0
time = step/float(numsteps)
......
......@@ -110,7 +110,7 @@
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="set_string" arguments="for i in range(0,20):&#xA; print i&#xA;&#xA;print &quot;passe" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="set_string" arguments="for i in range(0,20):&#xA; print i&#xA;&#xA;print &quot;passe" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="set_string" arguments="for i in range(0,20):&#xA; print i&#xA;&#xA;print &quot;passed" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="set_string" arguments="for i in range(0,20):&#xA; print i&#xA;&#xA;print &quot;passed&quot;" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="set_string" arguments="for i in range(0,20):&#xA; print(i)&#xA;&#xA;print(&quot;passed&quot;)" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="key" arguments="34" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Script/1pqPopOutWidget0/Script" command="key" arguments="16777248" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
......
......@@ -2,4 +2,4 @@ import paraview.simple
pxm = paraview.simple.servermanager.ProxyManager()
proxy = pxm.NewProxy('testcase', 'None')
print proxy
print(proxy)
......@@ -83,7 +83,7 @@ def RequestDataDescription(datadescription):
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
print 'input dname ', datadescription.GetInputDescriptionName(i)
print('input dname %s' % datadescription.GetInputDescriptionName(i))
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
......
......@@ -67,7 +67,7 @@ def RequestDataDescription(datadescription):
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
print 'input dname ', datadescription.GetInputDescriptionName(i)
print('input dname %s' % datadescription.GetInputDescriptionName(i))
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
......
......@@ -93,9 +93,9 @@ class WriterAccessor(smtrace.RealProxyAccessor):
# writer that's not available in this build but is available
# with the build used by the simulation code (probably through a plugin)
# this stub must have the proper name in the coprocessing hints
print "WARNING: Could not find", xmlname, "writer in", xmlgroup, \
print("WARNING: Could not find %s writer in %s" \
"XML group. This is not a problem as long as the writer is available with " \
"the ParaView build used by the simulation code."
"the ParaView build used by the simulation code." % (xmlname, xmlgroup))
ctor = servermanager._make_name_valid(xmlname)
else:
ctor = servermanager._make_name_valid(prototype.GetXMLLabel())
......
......@@ -17,7 +17,7 @@ for yMag in (18, 36, 72):
fTime = open(fileNameTime, "w");
fEnsemble.write ("{:d},{:d},{:s}\n".format(yMag, zMag, fileNameTime))
for step in range(numSteps):
print "Timestep ", step
print("Timestep %d" % step)
wavelet = pvsimple.Wavelet()
wavelet.Maximum = 300+50*math.sin(step * 2 * 3.1415927 / 10)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment