[xdmf] 16/38: Python3 changes to .py files
Alastair McKinstry
mckinstry at moszumanska.debian.org
Thu Apr 13 15:16:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository xdmf.
commit 434bd759b061ce8c571eaeaa8e1a6525ccc626df
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Sun Aug 14 19:44:23 2016 +0100
Python3 changes to .py files
---
debian/patches/python3.patch | 1879 +++++++++++++++++++++++++++++++++++++++---
debian/patches/series | 1 +
2 files changed, 1747 insertions(+), 133 deletions(-)
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 5df9803..37f0167 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -1,138 +1,73 @@
-Index: xdmf-2.1.dfsg.1/Examples/Python/FromOBJ.py
+Index: xdmf-2.1.dfsg.1/Data/Data/Iron Protein/GenerateData.py
===================================================================
---- xdmf-2.1.dfsg.1.orig/Examples/Python/FromOBJ.py
-+++ xdmf-2.1.dfsg.1/Examples/Python/FromOBJ.py
-@@ -23,11 +23,12 @@
- #/* for more information. */
- #/* */
- #/*******************************************************************/
+--- xdmf-2.1.dfsg.1.orig/Data/Data/Iron Protein/GenerateData.py
++++ xdmf-2.1.dfsg.1/Data/Data/Iron Protein/GenerateData.py
+@@ -1,3 +1,4 @@
+from __future__ import print_function
import sys
- import string
+ import os
+@@ -12,7 +13,7 @@ except:
+ import sys
--print 'Loading vtk'
-+print ('Loading vtk')
- from libVTKCommonPython import *
- from libVTKGraphicsPython import *
- from libVTKImagingPython import *
-@@ -35,7 +36,7 @@ from libVTKPatentedPython import *
- from libVTKContribPython import *
- from libVTKLocalPython import *
+ if len(sys.argv) != 4:
+- print "Usage: %s <data directory> <input dataset> <output file name>"
++ print ("Usage: %s <data directory> <input dataset> <output file name>")
+ sys.exit(1)
--print 'Loading Xdmf'
-+print ('Loading Xdmf')
- import Xdmf
+ reader = vtk.vtkDataSetReader()
+@@ -27,7 +28,7 @@ array = image.GetPointData().GetArray("B
+ image.GetPointData().RemoveArray("BrownianVectors")
+ array.SetName("UnnamedNodeArray0")
+ image.GetPointData().AddArray(array)
+-print image
++print (image)
+ dataext = image.GetWholeExtent()
-@@ -51,14 +52,14 @@ class FromOBJ :
- def CreateXdmf( self ) :
- ObjReader = vtkOBJReader()
- ObjReader.SetFileName( self.FileName )
-- print 'Reading ' + self.FileName
-+ print ('Reading ' + self.FileName)
- ObjReader.Update()
- TriFilter = vtkTriangleFilter()
- TriFilter.SetInput( ObjReader.GetOutput() )
- TriFilter.Update()
- if self.Convert == 1 :
- Points = TriFilter.GetOutput().GetPoints()
-- print 'Converting %d Points' % Points.GetNumberOfPoints()
-+ print ('Converting %d Points' % Points.GetNumberOfPoints())
- for i in range ( Points.GetNumberOfPoints() ) :
- x, y, z = Points.GetPoint( i )
- x = x * .0254
-@@ -99,6 +100,6 @@ if __name__ == '__main__' :
- FileName = sys.argv[ argc - 1 ]
- fobj = FromOBJ( FileName )
- if argc > 2 :
-- print 'Converting From inches'
-+ print ('Converting From inches')
- fobj.Convert = 1
- fobj.CreateXdmf()
-Index: xdmf-2.1.dfsg.1/Examples/Python/NdgmCp.py
-===================================================================
---- xdmf-2.1.dfsg.1.orig/Examples/Python/NdgmCp.py
-+++ xdmf-2.1.dfsg.1/Examples/Python/NdgmCp.py
-@@ -24,6 +24,7 @@
- #/* */
- #/*******************************************************************/
+@@ -97,14 +98,14 @@ strgrid.SetPoints(pts)
-+from __future__ import print_function
- import os
- import sys
- import string
-@@ -72,18 +73,18 @@ class NdgmCp :
- self.FromStart = int( entry[1] )
- self.FromEnd = int( entry[2] )
- self.FromLength = self.FromEnd - self.FromStart
-- print 'Source Data is %d bytes' % self.FromLength
-+ print ('Source Data is %d bytes' % self.FromLength)
+ # Split to parts
+ for grid in range(8):
+- print "Create data: %s" % grid
++ print ("Create data: %s" % grid)
+ factors = globalFactors[grid]
+ ext = []
+ for ex in range(3):
+ ext.append(factors[2*ex])
+ ext.append(factors[2*ex+1])
+- print dataext
+- print ext
++ print (dataext)
++ print (ext)
- def Put( self ) :
- if self.ToIsFile :
- if self.FromIsFile :
- Cmd = 'cp ' + self.From + ' ' + self.To
-- print Cmd
-+ print (Cmd)
- os.system( Cmd )
- else :
- From = str(self.FromStart) + ':' + str(self.FromEnd)
- Cmd = 'ice ndgm_cat ' + From + ' ' + self.To
-- print Cmd
-+ print (Cmd)
- os.system( Cmd )
- else :
- Found = 0
-@@ -114,7 +115,7 @@ class NdgmCp :
- else :
- From = str(self.FromStart) + ':' + str(self.FromEnd)
- Cmd = 'ice ndgm_cat ' + From + ' ' + str( self.ToStart )
-- print Cmd
-+ print (Cmd)
- os.system( Cmd )
-
- if __name__ == '__main__' :
-Index: xdmf-2.1.dfsg.1/Examples/Python/NdgmLs.py
+ clip_id = vtk.vtkImageClip()
+ clip_id.SetInput(image)
+Index: xdmf-2.1.dfsg.1/CMake/setup_install_paths.py
===================================================================
---- xdmf-2.1.dfsg.1.orig/Examples/Python/NdgmLs.py
-+++ xdmf-2.1.dfsg.1/Examples/Python/NdgmLs.py
-@@ -24,7 +24,7 @@
- #/* */
- #/*******************************************************************/
+--- xdmf-2.1.dfsg.1.orig/CMake/setup_install_paths.py
++++ xdmf-2.1.dfsg.1/CMake/setup_install_paths.py
+@@ -12,7 +12,7 @@ of binary modules (.so or .dll).
+ Written by David Gobbi, Feb 25, 2006.
+ """
-
+from __future__ import print_function
- import sys
import string
- import Xdmf
-@@ -41,7 +41,7 @@ class NdgmLs :
- def Ls( self ) :
- status = self.Ndgm.Open()
- if status <= 0 :
-- print "Can't Connect to NDGM Server on " + self.Ndgm.GetNdgmHost()
-+ print ("Can't Connect to NDGM Server on " + self.Ndgm.GetNdgmHost())
- return None
- # Get the Length
- Length = self.Ndgm.GetTotalLength()
-@@ -82,10 +82,10 @@ if __name__ == '__main__' :
- e = n.Format()
- NumberOfEntries = len( e )
- if NumberOfEntries < 1 :
-- print '-1 : No Entries in NDGM'
-+ print ('-1 : No Entries in NDGM')
- else :
- for i in range( NumberOfEntries ) :
-- print '%2d : %s' % ( i, e[ i ])
-+ print ('%2d : %s' % ( i, e[ i ]))
-
-
+ import sys
+ import os
+@@ -134,5 +134,5 @@ def get_install_path(command, *args):
+
+ if __name__ == "__main__":
+- print apply(get_install_path, sys.argv[1:])
++ print (apply(get_install_path, sys.argv[1:]))
+
Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
===================================================================
--- xdmf-2.1.dfsg.1.orig/Examples/Python/PipeView.py
+++ xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
-@@ -24,19 +24,26 @@
+@@ -24,19 +24,24 @@
#/* */
#/*******************************************************************/
@@ -153,16 +88,14 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
-import Tkinter
+try:
-+ import tkinter
++ import tkinter
+except:
-+ # For Python2
-+ import Tkinter
-+ tkinter = Tkinter
-+
++ #python2
++ import Tkinter as tkinter
# from vtkPipeline import *
import vtkPipeline.vtkPipeline
-@@ -57,7 +64,7 @@ class ViewAll:
+@@ -57,7 +62,7 @@ class ViewAll:
sys.exit()
def SetUpPipeline( self, Ren ) :
@@ -171,7 +104,7 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
root.title("XDMF Viewer")
wid = vtkRenderWidget.vtkTkRenderWidget (root, width=500, height=500)
wid.pack (expand='true', fill='both')
-@@ -73,12 +80,12 @@ class ViewAll:
+@@ -73,7 +78,7 @@ class ViewAll:
root.mainloop ()
def View ( self, FileName ):
@@ -180,13 +113,7 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
if( self.EndGrid <= 0 ) :
self.FindGrids( FileName )
- self.EndGrid = self.NumberOfGrids - 1
--
-+
- Ren = vtkRenderer()
- for GridIndex in range( self.StartGrid, self.EndGrid + 1 ) :
- Reader = vtkXdmfReader()
-@@ -96,7 +103,7 @@ class ViewAll:
+@@ -96,7 +101,7 @@ class ViewAll:
Index = GridIndex - self.StartGrid
if Index < len( self.Attributes ) :
AttrIndex = self.Attributes[ Index ]
@@ -195,7 +122,7 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
Reader.SetAttributeStatusOn( AttrIndex )
-@@ -111,25 +118,25 @@ class ViewAll:
+@@ -111,25 +116,25 @@ class ViewAll:
# if necessary
Gridptr = Reader.GetXdmfGridHandle()
Grid = Xdmf.HandleToXdmfGrid( Gridptr )
@@ -231,7 +158,7 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
-@@ -166,12 +173,12 @@ class ViewAll:
+@@ -166,12 +171,12 @@ class ViewAll:
# iRen.Start()
def usage (self) :
@@ -246,7 +173,506 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
try :
opts, args = getopt.getopt(opts,
"aseh:",
-@@ -180,8 +187,8 @@ class ViewAll:
+@@ -180,8 +185,8 @@ class ViewAll:
+ except getopt.GetoptError:
+ self.usage()
+ sys.exit(2)
+- print 'opts = ' + str( opts )
+- print 'args = ' + str( args )
++ print ('opts = ' + str( opts ))
++ print ('args = ' + str( args ))
+ output = None
+ for o, a in opts:
+ if o in ("-h", "--help"):
+@@ -192,11 +197,11 @@ class ViewAll:
+ if o in ("-e", "--end"):
+ self.EndGrid = int(a)
+ if o in ("-a", "--attribute"):
+- print 'Appending ' + a
++ print ('Appending ' + a)
+ self.Attributes.append( int(a) )
+- print 'StartGrid %d' % self.StartGrid
+- print 'EndGrid %d' % self.EndGrid
+- print 'Attributes = ' + str( self.Attributes )
++ print ('StartGrid %d' % self.StartGrid)
++ print ('EndGrid %d' % self.EndGrid)
++ print ('Attributes = ' + str( self.Attributes ))
+ if __name__ == '__main__' :
+ argc = len( sys.argv )
+ viewer = ViewAll()
+Index: xdmf-2.1.dfsg.1/Examples/Python/XVis.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XVis.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XVis.py
+@@ -2,6 +2,7 @@
+
+ """XVis for Python"""
+
++from __future__ import print_function
+ import sys
+ import getopt
+ import Xdmf
+@@ -31,7 +32,7 @@ class XVis :
+ PickMeasure = self.PickMeasure
+ PickViewFile = self.PickViewFile
+ if Picker.GetCellId < 0 :
+- print 'No Cell Picked'
++ print ('No Cell Picked')
+ return
+ else :
+ SelectionPoint = Picker.GetSelectionPoint()
+@@ -39,30 +40,30 @@ class XVis :
+ x = PickPosition[0]
+ y = PickPosition[1]
+ z = PickPosition[2]
+- print 'X Y Z : %f %f %f' % ( x, y, z )
++ print ('X Y Z : %f %f %f' % ( x, y, z ))
+ dx = x - self.LastX
+ dy = y - self.LastY
+ dz = z - self.LastZ
+ Length = math.sqrt( ( dx * dx ) + ( dy * dy ) + ( dz * dz))
+- print 'Dx Dy Dz : %f %f %f' % ( dx, dy, dz)
+- print 'Length : %f' % Length
++ print ('Dx Dy Dz : %f %f %f' % ( dx, dy, dz))
++ print ('Length : %f' % Length)
+ self.LastX = x
+ self.LastY = y
+ self.LastZ = z
+ if PickViewFile :
+- print 'Writing View in ' + PickViewFile
++ print ('Writing View in ' + PickViewFile)
+ Window = Picker.GetRenderer().GetRenderWindow()
+ WindowSize = Window.GetSize()
+- # print 'Window Size = ' + str( WindowSize )
++ # print ('Window Size = ' + str( WindowSize ))
+ WindowPosition = Window.GetPosition()
+- # print 'Window Position = ' + str( WindowPosition )
++ # print ('Window Position = ' + str( WindowPosition ))
+ Camera = Picker.GetRenderer().GetActiveCamera()
+ Position = Camera.GetPosition()
+- # print 'Camera Position = ' + str( Position )
++ # print ('Camera Position = ' + str( Position ))
+ FocalPoint = Camera.GetFocalPoint()
+- # print 'Camera FocalPoint = ' + str( FocalPoint )
++ # print ('Camera FocalPoint = ' + str( FocalPoint ))
+ ViewUp = Camera.GetViewUp()
+- # print 'Camera ViewUp = ' + str( ViewUp )
++ # print ('Camera ViewUp = ' + str( ViewUp ))
+ ViewFd = open( PickViewFile, "w" )
+ ViewFd.write('<!--\n')
+ ViewFd.write('<Reference Target="RenWin" Method="SetPosition" Args="%d, %d"/>\n' % ( WindowPosition[0], WindowPosition[1]))
+@@ -107,7 +108,7 @@ class XVis :
+ DOM = self.DOM
+ Reflector = self.Reflector
+ Type = DOM.Get( Node, "NodeType" )
+- # print 'Visit ' + Type
++ # print ('Visit ' + Type)
+ if Type == "Xvis" :
+ return( 1 )
+ elif Type == "Ndgm" :
+@@ -116,7 +117,7 @@ class XVis :
+ self.NdgmCheck.SetModeToClient()
+ Status = self.NdgmCheck.Open()
+ if Status <= 0 :
+- print "Can't Connect to Ndgm"
++ print ("Can't Connect to Ndgm")
+ return None
+ Ndgm = self.NdgmCheck
+ BarrierNumber = DOM.Get( Node, "Barrier" )
+@@ -131,9 +132,9 @@ class XVis :
+ DOM.Set(Node, "Value", str( CurrentValue ) )
+ else :
+ BarrierValue = int( BarrierValue )
+- # print 'NDGM Current Value od %d = %d' % ( BarrierNumber, CurrentValue)
++ # print ('NDGM Current Value od %d = %d' % ( BarrierNumber, CurrentValue))
+ if CurrentValue != BarrierValue :
+- print 'Barrier Update #%d' % CurrentValue
++ print ('Barrier Update #%d' % CurrentValue)
+ for i in range( DOM.GetNumberOfChildren( Node )) :
+ ChildNode = DOM.GetChild( i, Node )
+ ChildType = DOM.Get( ChildNode, "NodeType" )
+@@ -165,16 +166,16 @@ class XVis :
+ TargetObject = Reflector.NameToObject( TargetName )
+ if (NewLine != None ) and (string.upper( NewLine ) == "FALSE") :
+ if TargetObject != None :
+- print str( TargetObject ) ,
++ print (str( TargetObject ) ,)
+ else :
+ # print "Target == None"
+- print TargetName ,
++ print (TargetName ,)
+ else :
+ if TargetObject != None :
+- print str( TargetObject )
++ print (str( TargetObject ))
+ else :
+- # print "Target == None"
+- print TargetName
++ # print ("Target == None")
++ print (TargetName)
+ return( TargetObject )
+ elif (Type == "Reference") or (Type == "Invoke") :
+ Name = DOM.Get( Node, "Name" )
+@@ -188,7 +189,7 @@ class XVis :
+ if Method == None :
+ NewObject = TargetObject
+ else :
+- # print 'Calling Method ' + Method + ' on ' + str( TargetObject )
++ # print ('Calling Method ' + Method + ' on ' + str( TargetObject ))
+ NewObject = Reflector.CallMethod( TargetObject, Method, Args )
+ # Name == None is OK
+ Reflector.RegisterObject( NewObject, Name )
+@@ -209,12 +210,12 @@ class XVis :
+ Type = 'MesaRenderer'
+ if Type == 'RenderWindow' :
+ Type = 'XMesaRenderWindow'
+- # print 'Creating a ' + Type
++ # print ('Creating a ' + Type)
+ NewObject = Reflector.CreateObject( 'vtk' + Type, Name)
+ if NewObject == None :
+ NewObject = Reflector.CreateObject( Type, Name)
+ if NewObject == None :
+- # print "Can't Create " + Type
++ # print ("Can't Create " + Type)
+ return(None)
+ if (Type == 'XdmfRenderWindowInteractor') or (Type == 'RenderWindowInteractor') :
+ # Create a Picker
+@@ -229,7 +230,7 @@ class XVis :
+ pass
+ else :
+ Value = DOM.Get( Node, Attribute )
+- # print 'Try ' + Attribute + ' = ' + Value
++ # print ('Try ' + Attribute + ' = ' + Value)
+ Status = Reflector.CallMethod( NewObject, Attribute, Value)
+ if Status == None :
+ Status = Reflector.CallMethod( NewObject, 'Set' + Attribute, Value)
+@@ -251,22 +252,22 @@ class XVis :
+ ChildType = 'Mapper'
+ self.ParentObject = Parent
+ Child = self.Traverse( ChildNode )
+- # print 'Child = ' + str( Child )
++ # print ('Child = ' + str( Child ))
+ if ( Child != None ) and (ChildType != 'Reference') :
+ # Try Add
+- # print '... ChildType = ' + str( ChildType )
+- # print '.. Child = ' + str( Child )
+- # print '... try ' + 'Add' + ChildType
++ # print ('... ChildType = ' + str( ChildType ))
++ # print ('.. Child = ' + str( Child ))
++ # print ('... try ' + 'Add' + ChildType)
+ Attach = DOM.Get( ChildNode, "AttachAs" )
+ if Attach == None :
+ if hasattr( Parent, 'Add' + ChildType ) :
+- # print 'Calling Add' + ChildType
++ # print ('Calling Add' + ChildType)
+ eval('Parent.Add' + ChildType + '( Child )')
+ elif hasattr( Parent, 'Set' + ChildType ) :
+- # print 'Calling Set' + ChildType
++ # print ('Calling Set' + ChildType)
+ eval('Parent.Set' + ChildType + '( Child )')
+ elif hasattr( Child, 'GetOutput' ) :
+- # print 'Calling SetInput'
++ # print ('Calling SetInput')
+ if hasattr( Parent, 'SetInput') :
+ Parent.SetInput( Child.GetOutput())
+ else :
+@@ -281,8 +282,8 @@ class XVis :
+ return( Parent )
+
+ def usage ( self, argv ) :
+- print 'Usage ' + argv[0] + ' ' + \
+- str( self.XVisOptions )
++ print ('Usage ' + argv[0] + ' ' + \
++ str( self.XVisOptions ))
+
+ XVisOptions = ["help", "loop", "mesa", "replace=", "xml=", "input=" ]
+
+@@ -296,8 +297,8 @@ class XVis :
+ except getopt.GetoptError:
+ self.usage(argv)
+ return(-1)
+- # print 'opts = ' + str( opts )
+- # print 'args = ' + str( args )
++ # print ('opts = ' + str( opts ))
++ # print ('args = ' + str( args ))
+
+ if len(args) != 0 :
+ self.usage(argv)
+@@ -328,13 +329,13 @@ class XVis :
+ self.defines[ Key ] = Value
+
+ # self.DOM.SetInputFileName( a )
+- for key in self.defines.keys() :
++ for key in list(self.defines.keys()) :
+ self.txt = string.replace( self.txt, key, self.defines[ key ] )
+- # print 'txt = ' + self.txt
++ # print ('txt = ' + self.txt)
+ self.DOM.Parse( self.txt )
+ Node = self.DOM.FindElement( 'Xvis' )
+ if Node == None :
+- print "Can't Find XVis Node"
++ print ("Can't Find XVis Node")
+ return( -1 )
+ self.Traverse( Node )
+ return(0)
+Index: xdmf-2.1.dfsg.1/Examples/Python/XReflector.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XReflector.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XReflector.py
+@@ -70,12 +70,12 @@ class XReflector :
+
+ def NameToObject( self, Name ) :
+
+- if self.Lookup.has_key( Name ) :
++ if Name in self.Lookup :
+ return( self.Lookup[ Name ] )
+ return( None )
+
+ def ObjectToName ( self, Object ) :
+- for Name in self.Lookup.keys() :
++ for Name in list(self.Lookup.keys()) :
+ if self.Lookup[ Name ] == Object :
+ return( Name )
+ return( None )
+Index: xdmf-2.1.dfsg.1/Examples/Python/SetsMaps2.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/SetsMaps2.py
++++ xdmf-2.1.dfsg.1/Examples/Python/SetsMaps2.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ txt = """<?xml version="1.0" ?>
+@@ -135,42 +136,42 @@ g.UpdateInformation()
+ g.Update()
+
+
+-print 'Grid Sets :', g.GetNumberOfSets()
++print ('Grid Sets :', g.GetNumberOfSets())
+ for i in range(g.GetNumberOfSets()) :
+ s = g.GetSets(i)
+- print 'Set #', i
+- print ' Type: ', s.GetSetTypeAsString()
+- print ' Size: ', s.GetSize()
++ print ('Set #', i)
++ print (' Type: ', s.GetSetTypeAsString())
++ print (' Size: ', s.GetSize())
+ s.Update()
+ ids = s.GetIds()
+- print ' # Ids : ', ids.GetNumberOfElements()
+- print ' Ids : ', ids.GetValues()
++ print (' # Ids : ', ids.GetNumberOfElements())
++ print (' Ids : ', ids.GetValues())
+ cellids = s.GetCellIds()
+- print ' # Cell Ids : ', cellids.GetNumberOfElements()
+- print ' Cell Ids : ', cellids.GetValues()
++ print (' # Cell Ids : ', cellids.GetNumberOfElements())
++ print (' Cell Ids : ', cellids.GetValues())
+ faceids = s.GetFaceIds()
+- print ' # Face Ids : ', faceids.GetNumberOfElements()
+- print ' Face Ids : ', faceids.GetValues()
+- print ' #Attributes: ', s.GetNumberOfAttributes()
++ print (' # Face Ids : ', faceids.GetNumberOfElements())
++ print (' Face Ids : ', faceids.GetValues())
++ print (' #Attributes: ', s.GetNumberOfAttributes())
+ for j in range(s.GetNumberOfAttributes()) :
+ a = s.GetAttribute(j)
+- print ' Attribute #', j
+- print ' Attribute values: ', a.GetAttributeTypeAsString()
++ print (' Attribute #', j)
++ print (' Attribute values: ', a.GetAttributeTypeAsString())
+ a.Update()
+ v = a.GetValues()
+- print ' Attribute type: ', v.GetValues()
+- print ' #Maps: ', s.GetNumberOfMaps()
++ print (' Attribute type: ', v.GetValues())
++ print (' #Maps: ', s.GetNumberOfMaps())
+ for j in range(s.GetNumberOfMaps()) :
+ m = s.GetMap(j)
+- print ' Map #', j
+- print ' Map Type : ', m.GetMapTypeAsString()
+- print ' Item Length :', m.GetItemLength()
+- print ' Map Length :', m.GetMapLength()
++ print (' Map #', j)
++ print (' Map Type : ', m.GetMapTypeAsString())
++ print (' Item Length :', m.GetItemLength())
++ print (' Map Length :', m.GetMapLength())
+ m.Update()
+ ival = m.GetMapIndex()
+- print ' Map Index: ', ival.GetValues()
++ print (' Map Index: ', ival.GetValues())
+ v = m.GetMapData()
+- print ' all Map Values : ', v.GetValues()
++ print (' all Map Values : ', v.GetValues())
+ l = m.GetMapLength()
+ il = m.GetItemLength()
+ for k in range(l) :
+@@ -180,7 +181,7 @@ for i in range(g.GetNumberOfSets()) :
+ imapvals = tuple(int(x) for x in mapvals.split())
+ for ii in range(len(imapvals) / il) :
+ index = ii * il
+- print ' Map Vals[', k, '] = ', imapvals[index:index+il]
++ print (' Map Vals[', k, '] = ', imapvals[index:index+il])
+
+
+ ns = XdmfSet()
+Index: xdmf-2.1.dfsg.1/Examples/Python/SetsMaps.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/SetsMaps.py
++++ xdmf-2.1.dfsg.1/Examples/Python/SetsMaps.py
+@@ -1,5 +1,7 @@
+ #!/bin/env python
+
++
++from __future__ import print_function
+ from Xdmf import *
+
+ txt = """<?xml version="1.0" ?>
+@@ -113,30 +115,30 @@ g.UpdateInformation()
+ g.Update()
+
+
+-print 'Grid Sets :', g.GetNumberOfSets()
++print ('Grid Sets :', g.GetNumberOfSets())
+ for i in range(g.GetNumberOfSets()) :
+ s = g.GetSets(i)
+- print 'Set #', i
+- print ' Type: ', s.GetSetTypeAsString()
+- print ' Size: ', s.GetSize()
++ print ('Set #', i)
++ print (' Type: ', s.GetSetTypeAsString())
++ print (' Size: ', s.GetSize())
+ s.Update()
+ ids = s.GetIds()
+- print ' # Ids : ', ids.GetNumberOfElements()
+- print ' Ids : ', ids.GetValues()
++ print (' # Ids : ', ids.GetNumberOfElements())
++ print (' Ids : ', ids.GetValues())
+ cellids = s.GetCellIds()
+- print ' # Cell Ids : ', cellids.GetNumberOfElements()
+- print ' Cell Ids : ', cellids.GetValues()
++ print (' # Cell Ids : ', cellids.GetNumberOfElements())
++ print (' Cell Ids : ', cellids.GetValues())
+ faceids = s.GetFaceIds()
+- print ' # Face Ids : ', faceids.GetNumberOfElements()
+- print ' Face Ids : ', faceids.GetValues()
+- print ' #Attributes: ', s.GetNumberOfAttributes()
++ print (' # Face Ids : ', faceids.GetNumberOfElements())
++ print (' Face Ids : ', faceids.GetValues())
++ print (' #Attributes: ', s.GetNumberOfAttributes())
+ for j in range(s.GetNumberOfAttributes()) :
+ a = s.GetAttribute(j)
+- print ' Attribute #', j
+- print ' Attribute values: ', a.GetAttributeTypeAsString()
++ print (' Attribute #', j)
++ print (' Attribute values: ', a.GetAttributeTypeAsString())
+ a.Update()
+ v = a.GetValues()
+- print ' Attribute type: ', v.GetValues()
++ print (' Attribute type: ', v.GetValues())
+
+
+ ns = XdmfSet()
+@@ -149,5 +151,5 @@ a.SetValues(0, "100 200 300 400")
+ ns.SetIds(a)
+ g.Insert(ns)
+ ns.Build()
+-print d.Serialize()
++print (d.Serialize())
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/ViewAll.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/ViewAll.py
++++ xdmf-2.1.dfsg.1/Examples/Python/ViewAll.py
+@@ -24,13 +24,14 @@
+ #/* */
+ #/*******************************************************************/
+
++from __future__ import print_function
+ import getopt
+ import sys
+ import string
+
+-print 'Loading Xdmf'
++print ('Loading Xdmf')
+ import Xdmf
+-print 'Loading vtk'
++print ('Loading vtk')
+ from vtk import *
+ from libvtkXdmfPython import *
+
+@@ -48,7 +49,7 @@ class ViewAll:
+ self.NumberOfGrids = DOM.FindNumberOfElements( 'Grid' )
+
+ def View ( self, FileName ):
+- print 'Parsing ' + FileName
++ print ('Parsing ' + FileName)
+
+ if( self.EndGrid <= 0 ) :
+ self.FindGrids( FileName )
+@@ -71,7 +72,7 @@ class ViewAll:
+ Index = GridIndex - self.StartGrid
+ if Index < len( self.Attributes ) :
+ AttrIndex = self.Attributes[ Index ]
+- print 'Setting Attribute %d On' % AttrIndex
++ print ('Setting Attribute %d On' % AttrIndex)
+ Reader.SetAttributeStatusOn( AttrIndex )
+
+
+@@ -86,25 +87,25 @@ class ViewAll:
+ # if necessary
+ Gridptr = Reader.GetXdmfGridHandle()
+ Grid = Xdmf.HandleToXdmfGrid( Gridptr )
+- print 'Grid %d has %d ' % (GridIndex, Grid.GetNumberOfElements()) + \
+- Grid.GetTopologyTypeAsString()
++ print ('Grid %d has %d ' % (GridIndex, Grid.GetNumberOfElements()) + \
++ Grid.GetTopologyTypeAsString())
+ Nattr = Grid.GetNumberOfAttributes()
+- print '<XdmfGrid> has %d Attributes' % Nattr
++ print ('<XdmfGrid> has %d Attributes' % Nattr)
+ for i in range( Nattr ) :
+ Attribute = Grid.GetAttribute( i )
+- print '\tAttribute #%d' % i
+- print '\t\tName: ' + Attribute.GetName()
+- print '\t\tCenter: ' + Attribute.GetAttributeCenterAsString()
+- print '\t\tType: ' + Attribute.GetAttributeTypeAsString()
++ print ('\tAttribute #%d' % i)
++ print ('\t\tName: ' + Attribute.GetName())
++ print ('\t\tCenter: ' + Attribute.GetAttributeCenterAsString())
++ print ('\t\tType: ' + Attribute.GetAttributeTypeAsString())
+
+ # List All of the Available Arrays
+ PointData = Reader.GetOutput().GetPointData()
+ for i in range( PointData.GetNumberOfArrays() ) :
+ Array = PointData.GetArray( i )
+- print '\tArray #%d ' % i
+- print '\t\tName: ' + Array.GetName()
++ print ('\tArray #%d ' % i)
++ print ('\t\tName: ' + Array.GetName())
+ Min, Max = Array.GetRange()
+- print '\t\tRange: %f -> %f' % (Min, Max)
++ print ('\t\tRange: %f -> %f' % (Min, Max))
+
+
+
+@@ -140,12 +141,12 @@ class ViewAll:
+ iRen.Start()
+
+ def usage (self) :
+- print 'Options : --start=Grid# --end=Grid# --attribute=Index --attribute=Index ... File.xmf'
++ print ('Options : --start=Grid# --end=Grid# --attribute=Index --attribute=Index ... File.xmf')
+ sys.exit(0)
+
+ def Options( self, opts ) :
+ argc = len( opts )
+- print '%d Args = ' % argc + str( opts )
++ print ('%d Args = ' % argc + str( opts ))
+ try :
+ opts, args = getopt.getopt(opts,
+ "aseh:",
+@@ -154,8 +155,8 @@ class ViewAll:
except getopt.GetoptError:
self.usage()
sys.exit(2)
@@ -257,7 +683,7 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
output = None
for o, a in opts:
if o in ("-h", "--help"):
-@@ -192,11 +199,11 @@ class ViewAll:
+@@ -166,11 +167,11 @@ class ViewAll:
if o in ("-e", "--end"):
self.EndGrid = int(a)
if o in ("-a", "--attribute"):
@@ -273,3 +699,1190 @@ Index: xdmf-2.1.dfsg.1/Examples/Python/PipeView.py
if __name__ == '__main__' :
argc = len( sys.argv )
viewer = ViewAll()
+Index: xdmf-2.1.dfsg.1/Examples/Python/NdgmCp.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/NdgmCp.py
++++ xdmf-2.1.dfsg.1/Examples/Python/NdgmCp.py
+@@ -24,6 +24,7 @@
+ #/* */
+ #/*******************************************************************/
+
++from __future__ import print_function
+ import os
+ import sys
+ import string
+@@ -72,18 +73,18 @@ class NdgmCp :
+ self.FromStart = int( entry[1] )
+ self.FromEnd = int( entry[2] )
+ self.FromLength = self.FromEnd - self.FromStart
+- print 'Source Data is %d bytes' % self.FromLength
++ print ('Source Data is %d bytes' % self.FromLength)
+
+ def Put( self ) :
+ if self.ToIsFile :
+ if self.FromIsFile :
+ Cmd = 'cp ' + self.From + ' ' + self.To
+- print Cmd
++ print (Cmd)
+ os.system( Cmd )
+ else :
+ From = str(self.FromStart) + ':' + str(self.FromEnd)
+ Cmd = 'ice ndgm_cat ' + From + ' ' + self.To
+- print Cmd
++ print (Cmd)
+ os.system( Cmd )
+ else :
+ Found = 0
+@@ -114,7 +115,7 @@ class NdgmCp :
+ else :
+ From = str(self.FromStart) + ':' + str(self.FromEnd)
+ Cmd = 'ice ndgm_cat ' + From + ' ' + str( self.ToStart )
+- print Cmd
++ print (Cmd)
+ os.system( Cmd )
+
+ if __name__ == '__main__' :
+Index: xdmf-2.1.dfsg.1/Examples/Python/NdgmLs.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/NdgmLs.py
++++ xdmf-2.1.dfsg.1/Examples/Python/NdgmLs.py
+@@ -24,7 +24,7 @@
+ #/* */
+ #/*******************************************************************/
+
+-
++from __future__ import print_function
+ import sys
+ import string
+ import Xdmf
+@@ -41,11 +41,11 @@ class NdgmLs :
+ def Ls( self ) :
+ status = self.Ndgm.Open()
+ if status <= 0 :
+- print "Can't Connect to NDGM Server on " + self.Ndgm.GetNdgmHost()
++ print ("Can't Connect to NDGM Server on " + self.Ndgm.GetNdgmHost())
+ return None
+ # Get the Length
+ Length = self.Ndgm.GetTotalLength()
+- # print 'NDGM on %s is %d bytes' % ( self.Ndgm.GetNdgmHost(), Length )
++ # print ('NDGM on %s is %d bytes' % ( self.Ndgm.GetNdgmHost(), Length ))
+ self.RawString = string.split( Xdmf.XdmfGetNdgmEntries() )
+ return self.RawString
+
+@@ -82,7 +82,7 @@ if __name__ == '__main__' :
+ e = n.Format()
+ NumberOfEntries = len( e )
+ if NumberOfEntries < 1 :
+- print '-1 : No Entries in NDGM'
++ print ('-1 : No Entries in NDGM')
+ else :
+ for i in range( NumberOfEntries ) :
+ print '%2d : %s' % ( i, e[ i ])
+Index: xdmf-2.1.dfsg.1/Examples/Python/FromOBJ.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/FromOBJ.py
++++ xdmf-2.1.dfsg.1/Examples/Python/FromOBJ.py
+@@ -23,11 +23,12 @@
+ #/* for more information. */
+ #/* */
+ #/*******************************************************************/
++from __future__ import print_function
+ import sys
+ import string
+
+
+-print 'Loading vtk'
++print ('Loading vtk')
+ from libVTKCommonPython import *
+ from libVTKGraphicsPython import *
+ from libVTKImagingPython import *
+@@ -35,7 +36,7 @@ from libVTKPatentedPython import *
+ from libVTKContribPython import *
+ from libVTKLocalPython import *
+
+-print 'Loading Xdmf'
++print ('Loading Xdmf')
+ import Xdmf
+
+
+@@ -51,14 +52,14 @@ class FromOBJ :
+ def CreateXdmf( self ) :
+ ObjReader = vtkOBJReader()
+ ObjReader.SetFileName( self.FileName )
+- print 'Reading ' + self.FileName
++ print ('Reading ' + self.FileName)
+ ObjReader.Update()
+ TriFilter = vtkTriangleFilter()
+ TriFilter.SetInput( ObjReader.GetOutput() )
+ TriFilter.Update()
+ if self.Convert == 1 :
+ Points = TriFilter.GetOutput().GetPoints()
+- print 'Converting %d Points' % Points.GetNumberOfPoints()
++ print ('Converting %d Points' % Points.GetNumberOfPoints())
+ for i in range ( Points.GetNumberOfPoints() ) :
+ x, y, z = Points.GetPoint( i )
+ x = x * .0254
+@@ -99,6 +100,6 @@ if __name__ == '__main__' :
+ FileName = sys.argv[ argc - 1 ]
+ fobj = FromOBJ( FileName )
+ if argc > 2 :
+- print 'Converting From inches'
++ print ('Converting From inches')
+ fobj.Convert = 1
+ fobj.CreateXdmf()
+Index: xdmf-2.1.dfsg.1/Examples/Python/WriteCompressed.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/WriteCompressed.py
++++ xdmf-2.1.dfsg.1/Examples/Python/WriteCompressed.py
+@@ -9,6 +9,7 @@
+ # uses Compression for connectivity, geometry and attributes.
+ #
+
++from __future__ import print_function
+ from Xdmf import *
+
+ BaseName = 'test20'
+@@ -151,7 +152,7 @@ g.Insert(attr)
+
+ # Update XML and Write Values to DataItems
+ root.Build() # DataItems > 100 values are heavy
+-print d.Serialize() # prints to stdout
++print (d.Serialize()) # prints to stdout
+
+ d.Write( BaseName + r'.xmf') # write to file
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/WriteXdmf1.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/WriteXdmf1.py
++++ xdmf-2.1.dfsg.1/Examples/Python/WriteXdmf1.py
+@@ -1,5 +1,6 @@
+ #!/usr/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ # Example of How to Generate Xdmf
+@@ -45,6 +46,6 @@ p.Generate(0.0, 1.0, 0, p.GetNumberOfEle
+ g.Insert(attr)
+ # Update XML and Write Values to DataItems
+ root.Build() # DataItems > 100 values are heavy
+-print d.Serialize() # prints to stdout
++print (d.Serialize()) # prints to stdout
+
+ d.Write('SMesh.xmf') # write to file
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfArrays.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfArrays.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfArrays.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ def Expression(*args) :
+@@ -21,18 +22,18 @@ if __name__ == '__main__' :
+ a2.SetNumberType(XDMF_INT32_TYPE)
+ a2.SetNumberOfElements(5)
+ a2.Generate(2, 10)
+- print 'a1 Values = ', a1.GetValues()
+- print 'a1[2:10] = ' + Expression(a1 , '[ 2:10 ]').GetValues()
+- print 'a2 Values = ', a2.GetValues()
+- print 'a1[a2] = ' + Expression(a1 , '[', a2, ']').GetValues()
+- print 'a1 + a2 = ' + Expression(a1 , ' + ', a2).GetValues()
+- print 'a1 * a2 = ' + Expression(a1 , ' * ', a2).GetValues()
++ print ('a1 Values = ', a1.GetValues())
++ print ('a1[2:10] = ' + Expression(a1 , '[ 2:10 ]').GetValues())
++ print ('a2 Values = ', a2.GetValues())
++ print ('a1[a2] = ' + Expression(a1 , '[', a2, ']').GetValues())
++ print ('a1 + a2 = ' + Expression(a1 , ' + ', a2).GetValues())
++ print ('a1 * a2 = ' + Expression(a1 , ' * ', a2).GetValues())
+ a2.SetNumberType(XDMF_FLOAT32_TYPE)
+ a2.SetNumberOfElements(20)
+ a2.Generate(21, 40)
+- print 'a2 Values = ', a2.GetValues()
+- print 'a1 , a2 (Interlace) = ' + Expression(a1 , ' , ', a2).GetValues()
+- print 'a1 , a2, a1 (Interlace) = ' + Expression(a1 , ' , ', a2, ' , ', a1).GetValues()
+- print 'a1 ; a2 (Concat) = ' + Expression(a1 , ' ; ', a2).GetValues()
+- print 'where(a1 > 10) = ' + Expression('Where( ', a1 , ' > 10)').GetValues()
+- print 'a2[where(a1 > 10)] = ' + Expression(a2, '[Where( ', a1 , ' > 10)]').GetValues()
++ print ('a2 Values = ', a2.GetValues())
++ print ('a1 , a2 (Interlace) = ' + Expression(a1 , ' , ', a2).GetValues())
++ print ('a1 , a2, a1 (Interlace) = ' + Expression(a1 , ' , ', a2, ' , ', a1).GetValues())
++ print ('a1 ; a2 (Concat) = ' + Expression(a1 , ' ; ', a2).GetValues())
++ print ('where(a1 > 10) = ' + Expression('Where( ', a1 , ' > 10)').GetValues())
++ print ('a2[where(a1 > 10)] = ' + Expression(a2, '[Where( ', a1 , ' > 10)]').GetValues())
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest1.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDOMTest1.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest1.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+ import time
+
+@@ -22,64 +23,64 @@ XML += """</Domain>
+ dom = XdmfDOM()
+ dom.Parse(XML)
+ dm = dom.FindElement('Domain')
+-print 'dm = ', dm
+-print 'Domain has %d Children' % dom.GetNumberOfChildren(dm)
+-# print dom.Serialize(dm)
++print ('dm = ', dm)
++print ('Domain has %d Children' % dom.GetNumberOfChildren(dm))
++# print (dom.Serialize(dm))
+ ng = dom.FindNumberOfElements('Grid', dm)
+-print 'DOM has %d Grids' % ng
+-print 'Timing Access'
++print ('DOM has %d Grids' % ng)
++print ('Timing Access')
+ start = now = time.time()
+ for i in range(ng) :
+ g = dom.FindElement('Grid', i, dm)
+ # Name = dom.GetAttribute(g, 'Name')
+ Name = dom.GetAttribute(g, 'Name')
+ if (Name != "GridNumber%04d" % (i + 1)) :
+- print 'Error in Name'
++ print ('Error in Name')
+ now = time.time()
+-print 'Accessed %d Grid Attributes in %g Seconds' % (ng, now - start)
++print ('Accessed %d Grid Attributes in %g Seconds' % (ng, now - start))
+ g = dom.GetChild(ng / 2, dm)
+-print 'Middle Node = ', dom.GetAttribute(g, 'Name')
++print ('Middle Node = ', dom.GetAttribute(g, 'Name'))
+ g = dom.FindElement('Grid', ng / 2, dm)
+-print 'Middle Grid = ', dom.GetAttribute(g, 'Name')
++print ('Middle Grid = ', dom.GetAttribute(g, 'Name'))
+ dom.DeleteNode(g)
+ ng = dom.FindNumberOfElements('Grid', dm)
+-print 'After Deletion DOM has %d Grids' % ng
++print ('After Deletion DOM has %d Grids' % ng)
+ g = dom.FindElement('Grid', ng / 2, dm)
+-print 'Test Serialize'
++print ('Test Serialize')
+ print dom.Serialize(g)
+-print 'Test Add'
++print ('Test Add')
+ dom.InsertFromString(g, '<Information Name="Last3"> XXYYZZ </Information>')
+-print dom.Serialize(g)
+-# print 'Test Serialize'
+-# print dom.Serialize()
+-print 'Test Set Attribute an CDATA'
++print (dom.Serialize(g))
++# print ('Test Serialize')
++# print (dom.Serialize())
++print ('Test Set Attribute an CDATA')
+ info = dom.FindElement('Information', 1, g)
+ dom.Set(info, 'CDATA', 'AABBCC')
+ dom.Set(info, 'NewTag', 'NewValue')
+-print dom.Serialize(g)
+-print 'Testing Information'
++print (dom.Serialize(g))
++print ('Testing Information')
+ i = XdmfInformation()
+-print 'Setting DOM'
++print ('Setting DOM')
+ i.SetDOM(dom)
+-print 'Setting Element'
++print ('Setting Element')
+ i.SetElement(info)
+-print 'Update Information'
++print ('Update Information')
+ i.UpdateInformation()
+-print 'Ready'
+-print 'info.Get("NewTag") = ', i.Get('NewTag')
++print ('Ready')
++print ('info.Get("NewTag") = ', i.Get('NewTag'))
+ i.Set('NewTag', 'BrandNewValue')
+ i.Set('CData', 'DDEEFF')
+-print dom.Serialize(g)
+-print 'Name = ',i.GetName()
+-print 'Value = ',i.GetValue()
++print (dom.Serialize(g))
++print ('Name = ',i.GetName())
++print ('Value = ',i.GetValue())
+ i.Set('Value', 'New Value')
+-print dom.Serialize(g)
+-print 'Value = ',i.GetValue()
+-print dom.Serialize(g)
++print (dom.Serialize(g))
++print ('Value = ',i.GetValue())
++print (dom.Serialize(g))
+ i.SetName('Jerry')
+-print dom.Serialize(g)
+-print 'element Type = ', i.GetElementType()
++print (dom.Serialize(g))
++print ('element Type = ', i.GetElementType())
+ i.SetValue('Last Value of the Day')
+-print dom.Serialize(g)
++print (dom.Serialize(g))
+ i.Build()
+ dom.Write('Jerry.xmf')
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDataFunction.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDataFunction.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDataFunction.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -61,5 +62,5 @@ di.SetDOM(dom)
+ di.SetElement(die)
+ di.UpdateInformation()
+ di.Update()
+-print 'Dims = ', di.GetArray().GetShapeAsString()
+-print 'Values = ', di.GetDataValues()
++print ('Dims = ', di.GetArray().GetShapeAsString())
++print ('Values = ', di.GetDataValues())
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDataItem.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDataItem.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDataItem.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -85,7 +86,7 @@ ds.SetDOM(dom)
+ ds.SetElement(dse)
+ ds.UpdateInformation()
+ ds.Update()
+-print 'Values = ', ds.GetDataValues()
++print ('Values = ', ds.GetDataValues())
+
+ dsre = dom.FindElement('DataItem', 1, geo)
+ dsr = XdmfDataItem()
+@@ -96,10 +97,10 @@ dsr.SetElement(dsre)
+ dsr.UpdateInformation()
+ dsr.Update()
+ if(dsr.GetIsReference()) :
+- print 'Getting Values'
+- print 'Values = ', dsr.GetDataValues()
++ print ('Getting Values')
++ print ('Values = ', dsr.GetDataValues())
+ else :
+- print 'This is not a reference'
++ print ('This is not a reference')
+
+ dsre = dom.FindElement('DataItem', 3, geo)
+ dsr = XdmfDataItem()
+@@ -109,16 +110,16 @@ dsr.DebugOn()
+ dsr.SetElement(dsre)
+ # Cause an potential dangling reference
+ # dsr.SetCopyReferenceData(0)
+-print "UI"
++print ("UI")
+ dsr.UpdateInformation()
+-print "U"
++print ("U")
+ dsr.Update()
+ # Cause an dangling reference by deleting refernced object
+ # ds = 0
+ if(dsr.GetIsReference()) :
+- print 'Getting Values'
+- print 'Values = ', dsr.GetDataValues()
++ print ('Getting Values')
++ print ('Values = ', dsr.GetDataValues())
+ else :
+- print 'This is not a reference'
++ print ('This is not a reference')
+
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDataStructureTest.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDataStructureTest.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDataStructureTest.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -78,28 +79,28 @@ ds = XdmfDataStructure()
+ ds.SetDOM(dom)
+ ds.SetElement(dse)
+ ds.UpdateInformation()
+-print 'Rank ', ds.GetRank()
+-print 'Dimensions ', ds.GetDimensions()
++print ('Rank ', ds.GetRank())
++print ('Dimensions ', ds.GetDimensions())
+ dd = ds.GetDataDesc()
+-print "Number Type ", dd.GetNumberTypeAsString()
+-print "Number of Elements ", dd.GetNumberOfElements()
+-print "Name = ", ds.GetName()
++print ("Number Type ", dd.GetNumberTypeAsString())
++print ("Number of Elements ", dd.GetNumberOfElements())
++print ("Name = ", ds.GetName())
+ # ds.DebugOn()
+ ds.Update()
+ ds.Build()
+-print ds.Serialize()
+-print 'Values = ', ds.GetDataValues()
++print (ds.Serialize())
++print ('Values = ', ds.GetDataValues())
+ a = ds.GetArray()
+ a.SetNumberType(XDMF_FLOAT32_TYPE)
+ a.SetNumberOfElements(27)
+ # a.SetShapeFromString("5 5")
+-print "Shape = ", a.GetShapeAsString()
++print ("Shape = ", a.GetShapeAsString())
+ a.Generate(1, 10)
+ ds.DebugOn()
+ ds.SetFormat(XDMF_FORMAT_HDF)
+ ds.SetHeavyDataSetName('Jerry.h5:/NewData')
+ ds.Build()
+-print ds.Serialize()
++print (ds.Serialize())
+ dom.Write('NewPoints.xmf')
+
+ dsr = XdmfDataStructure()
+@@ -109,8 +110,8 @@ dsr.SetElement(ds.GetElement())
+ dsr.SetDOM(dom)
+ dsr.Reference(ds.GetElement())
+ if(dsr.GetIsReference()) :
+- print 'Values = ', dsr.GetDataValues()
++ print ('Values = ', dsr.GetDataValues())
+ else :
+- print 'This is not a reference'
++ print ('This is not a reference')
+
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDataStructureTest2.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDataStructureTest2.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDataStructureTest2.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -85,7 +86,7 @@ ds.SetDOM(dom)
+ ds.SetElement(dse)
+ ds.UpdateInformation()
+ ds.Update()
+-print 'Values = ', ds.GetDataValues()
++print ('Values = ', ds.GetDataValues())
+
+ dsre = dom.FindElement('DataStructure', 1, geo)
+ dsr = XdmfDataStructure()
+@@ -96,10 +97,10 @@ dsr.SetElement(dsre)
+ dsr.UpdateInformation()
+ dsr.Update()
+ if(dsr.GetIsReference()) :
+- print 'Getting Values'
+- print 'Values = ', dsr.GetDataValues()
++ print ('Getting Values')
++ print ('Values = ', dsr.GetDataValues())
+ else :
+- print 'This is not a reference'
++ print ('This is not a reference')
+
+ dsre = dom.FindElement('DataStructure', 3, geo)
+ dsr = XdmfDataStructure()
+@@ -109,16 +110,16 @@ dsr.DebugOn()
+ dsr.SetElement(dsre)
+ # Cause an potential dangling reference
+ # dsr.SetCopyReferenceData(0)
+-print "UI"
++print ("UI")
+ dsr.UpdateInformation()
+-print "U"
++print ("U")
+ dsr.Update()
+ # Cause an dangling reference by deleting refernced object
+ # ds = 0
+ if(dsr.GetIsReference()) :
+- print 'Getting Values'
+- print 'Values = ', dsr.GetDataValues()
++ print ('Getting Values')
++ print ('Values = ', dsr.GetDataValues())
+ else :
+- print 'This is not a reference'
++ print ('This is not a reference')
+
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/WriteXdmf2.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/WriteXdmf2.py
++++ xdmf-2.1.dfsg.1/Examples/Python/WriteXdmf2.py
+@@ -1,5 +1,6 @@
+ #!/usr/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ # Example of How to Generate Xdmf
+@@ -58,6 +59,6 @@ attr.SetDataXml(DataXml)
+ g.Insert(attr)
+ # Update XML and Write Values to DataItems
+ root.Build() # DataItems > 100 values are heavy
+-print d.Serialize() # prints to stdout
++print (d.Serialize()) # prints to stdout
+
+ d.Write('SMesh.xmf') # write to file
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest2.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDOMTest2.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest2.py
+@@ -1,8 +1,9 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ dom = XdmfDOM()
+ # dom.SetInputFileName('Example2.xmf')
+ dom.Parse('Example2.xmf')
+-print dom.Serialize()
++print (dom.Serialize())
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest4.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDOMTest4.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest4.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+ import time
+
+@@ -22,26 +23,26 @@ XML += """</Domain>
+ dom = XdmfDOM()
+ dom.Parse(XML)
+ dm = dom.FindElement('Domain')
+-print 'dm = ', dm
+-print 'Domain has %d Children' % dom.GetNumberOfChildren(dm)
++print ('dm = ', dm)
++print ('Domain has %d Children' % dom.GetNumberOfChildren(dm))
+ # Test XPath
+ node = dom.FindElementByPath('/Xdmf/Domain/Grid[10]')
+-print node
++print (node)
+ if(node) :
+- print dom.Serialize(node)
++ print (dom.Serialize(node))
+ node = dom.FindElementByPath('/Xdmf/Domain/Grid[11]')
+-print node
++print (node)
+ if(node) :
+- print dom.Serialize(node)
++ print (dom.Serialize(node))
+ node = dom.FindElementByPath('/Xdmf/Domain/Grid[Information]')
+-print node
++print (node)
+ if(node) :
+- print dom.Serialize(node)
++ print (dom.Serialize(node))
+ node = dom.FindElementByPath('/Xdmf/Domain/Grid[@Name = "GridNumber0020"]')
+-print node
++print (node)
+ if(node) :
+- print dom.Serialize(node)
++ print (dom.Serialize(node))
+ node = dom.FindElementByPath('/Xdmf/Domain/Grid[@Name = "GridNumber0020"]')
+-print node
++print (node)
+ if(node) :
+- print dom.Serialize(node)
++ print (dom.Serialize(node))
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest3.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfDOMTest3.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfDOMTest3.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ d = XdmfDOM()
+@@ -8,6 +9,6 @@ dm = d.InsertNew(root, 'Domain')
+ g = d.InsertNew(dm, 'Grid')
+ geo = d.InsertNew(g, 'Geometry')
+ ds = d.InsertNew(geo, 'DataStructure')
+-print d.Serialize(root)
++print (d.Serialize(root))
+
+ d.Write('junk.xmf')
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfGridTest.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfGridTest.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfGridTest.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -87,7 +88,7 @@ top.SetDOM(dom)
+ top.SetElement(te)
+ top.Update()
+ conn = top.GetConnectivity()
+-print 'Values = ', conn.GetValues()
++print ('Values = ', conn.GetValues())
+
+ ge = dom.FindElementByPath('/Xdmf/Domain/Grid/Geometry')
+ geo = XdmfGeometry()
+@@ -95,6 +96,6 @@ geo.SetDOM(dom)
+ geo.SetElement(ge)
+ geo.Update()
+ points = geo.GetPoints()
+-print 'Geo Type = ', geo.GetGeometryTypeAsString(), ' # Points = ', geo.GetNumberOfPoints()
+-print 'Points = ', points.GetValues(0, 6)
++print ('Geo Type = ', geo.GetGeometryTypeAsString(), ' # Points = ', geo.GetNumberOfPoints())
++print ('Points = ', points.GetValues(0, 6))
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfGridTest2.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfGridTest2.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfGridTest2.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -90,10 +91,10 @@ grid.Update()
+ top = grid.GetTopology()
+ top.DebugOn()
+ conn = top.GetConnectivity()
+-print 'Values = ', conn.GetValues()
++print ('Values = ', conn.GetValues())
+
+ geo = grid.GetGeometry()
+ points = geo.GetPoints()
+-print 'Geo Type = ', geo.GetGeometryTypeAsString(), ' # Points = ', geo.GetNumberOfPoints()
+-print 'Points = ', points.GetValues(0, 6)
++print ('Geo Type = ', geo.GetGeometryTypeAsString(), ' # Points = ', geo.GetNumberOfPoints())
++print ('Points = ', points.GetValues(0, 6))
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfGridTest3.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfGridTest3.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfGridTest3.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ PointsTxt = """<?xml version="1.0" ?>
+@@ -164,17 +165,17 @@ PointsTxt = """<?xml version="1.0" ?>
+ """
+
+ def PrintGrid(grid) :
+- print 'Grid ', grid.GetName(), ' Type = ', grid.GetGridTypeAsString()
++ print ('Grid ', grid.GetName(), ' Type = ', grid.GetGridTypeAsString())
+ if(grid.IsUniform()) :
+ top = grid.GetTopology()
+ top.DebugOn()
+ conn = top.GetConnectivity()
+- print 'Connectivity = ', conn.GetValues()
++ print ('Connectivity = ', conn.GetValues())
+
+ geo = grid.GetGeometry()
+ points = geo.GetPoints()
+- print 'Geo Type = ', geo.GetGeometryTypeAsString(), ' # Points = ', geo.GetNumberOfPoints()
+- print 'Points = ', points.GetValues()
++ print ('Geo Type = ', geo.GetGeometryTypeAsString(), ' # Points = ', geo.GetNumberOfPoints())
++ print ('Points = ', points.GetValues())
+ else :
+ nc = grid.GetNumberOfChildren()
+ for i in range(nc) :
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfReader.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfReader.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfReader.py
+@@ -2,6 +2,7 @@
+
+ """Reader for XDMF Grids"""
+
++from __future__ import print_function
+ from Xdmf import *
+ from vtk import *
+ from libvtkXdmfPython import *
+@@ -28,9 +29,9 @@ class XdmfReader :
+ if FileName == None :
+ FileName = DOM.Get( Node, "File" )
+ if FileName == None :
+- print 'No FileName set'
++ print ('No FileName set')
+ return
+- print 'SetInputFileName(' + FileName + ')'
++ print ('SetInputFileName(' + FileName + ')')
+ self.Reader.SetInputFileName( FileName )
+ # Which Grid ?
+ GridName = DOM.Get( Node, "Grid" )
+@@ -43,7 +44,7 @@ class XdmfReader :
+ # Set Up Attributes
+ Nparam = DOM.FindNumberOfElements( 'Parameter', Node )
+ if Nparam > 0 :
+-# print 'Setting %d Parameters' % Nparam
++# print ('Setting %d Parameters' % Nparam)
+ DOMHandle = self.Reader.GetXdmfDOMHandle()
+ RDOM = HandleToXdmfDOM(DOMHandle)
+ for i in range( Nparam) :
+@@ -64,7 +65,7 @@ class XdmfReader :
+ pnode = RDOM.FindElement('Parameter', j, None)
+ # Set Up Attributes
+ Nattr = DOM.FindNumberOfElements( 'Attribute', Node )
+- print 'Reading %d Attributes' % Nattr
++ print ('Reading %d Attributes' % Nattr)
+ if Nattr > 0 :
+ self.Reader.SetAllAttributeStatusOff()
+ for i in range( Nattr ) :
+@@ -73,7 +74,7 @@ class XdmfReader :
+ self.Reader.SetAttributeStatusOn( Name )
+
+ def Update(self) :
+- print 'Updating Grid'
++ print ('Updating Grid')
+ self.Reader.Update()
+ return( self.Reader )
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfTimeTest1.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfTimeTest1.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfTimeTest1.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+
+ TimeTestTxt = """<?xml version="1.0" ?>
+@@ -287,7 +288,7 @@ dom.Parse('TimeTest.xmf')
+
+ ### Loop thru the Four Collection Grids
+ for GridIndex in range(1, 5) :
+- print 'Reading /Xdmf/Domain/Grid[%d]' % GridIndex
++ print ('Reading /Xdmf/Domain/Grid[%d]' % GridIndex)
+ ge = dom.FindElementByPath('/Xdmf/Domain/Grid[%d]' % GridIndex)
+ g = XdmfGrid()
+ g.SetDOM(dom)
+@@ -296,34 +297,34 @@ for GridIndex in range(1, 5) :
+ # Time is available after Light Data is Read
+ t = g.GetTime()
+ tt = t.GetTimeType()
+- print 'Time Type = ', tt, ' : ', t.GetTimeTypeAsString()
++ print ('Time Type = ', tt, ' : ', t.GetTimeTypeAsString())
+ if(tt == XDMF_TIME_SINGLE) :
+- print "Value = ", t.GetValue()
++ print ("Value = ", t.GetValue())
+ elif (tt == XDMF_TIME_LIST) :
+- print "List of Times = ", t.GetArray().GetValues()
++ print ("List of Times = ", t.GetArray().GetValues())
+ elif (tt == XDMF_TIME_RANGE) :
+- print "Min/Max = ", t.GetArray().GetValues()
++ print ("Min/Max = ", t.GetArray().GetValues())
+ elif (tt == XDMF_TIME_HYPERSLAB) :
+- print "Start/Stride/Count = ", t.GetArray().GetValues()
++ print ("Start/Stride/Count = ", t.GetArray().GetValues())
+ # Evaluate will populate the array with the indecies of the
+ # XdmfGrids that are entirely in the range
+ a = XdmfArray()
+ if (t.Evaluate(g, a) == XDMF_SUCCESS) :
+- print "Valid times = ", a.GetValues()
+- print "MinMax = ", a.GetMinAsFloat64(), ',' , a.GetMaxAsFloat64()
++ print ("Valid times = ", a.GetValues())
++ print ("MinMax = ", a.GetMinAsFloat64(), ',' , a.GetMaxAsFloat64())
+ else :
+- print 'No Valid Times ... checking all children'
++ print ('No Valid Times ... checking all children')
+ # The "Descend" Parameter will recursively check the children
+ if (t.Evaluate(g, a, 1) == XDMF_SUCCESS) :
+- print "Valid times = ", a.GetValues()
+- print "MinMax = ", a.GetMinAsFloat64(), ',' , a.GetMaxAsFloat64()
++ print ("Valid times = ", a.GetValues())
++ print ("MinMax = ", a.GetMinAsFloat64(), ',' , a.GetMaxAsFloat64())
+ a = XdmfArray()
+ # By default XdmfTime::Epsilon is 1e-7. Use XdmfTime::SetEpsilon()
+ # to change it
+ if(g.FindGridsInTimeRange(0.05, 0.1, a) == XDMF_SUCCESS) :
+- print 'Grids in Range(0.05, 0.1) = ', a.GetValues()
++ print ('Grids in Range(0.05, 0.1) = ', a.GetValues())
+ else :
+- print "No times are in Range(0.05, 0.1)"
++ print ("No times are in Range(0.05, 0.1)")
+ # Read Heavy Data to See the DataItems
+ g.Update()
+ # print g.Serialize()
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfVtkTest1.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfVtkTest1.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfVtkTest1.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+ from vtk import *
+ from libvtkXdmfPython import *
+@@ -10,7 +11,7 @@ Controller = vtkMPIController()
+ Reader.SetController(Controller)
+ ProcId = Reader.GetController().GetLocalProcessId()
+ NumProcs = Reader.GetController().GetNumberOfProcesses()
+-print 'Hello from %d of %d' % (ProcId, NumProcs)
++print ('Hello from %d of %d' % (ProcId, NumProcs))
+ Reader.SetFileName('Points1.xmf')
+ # Reader.DebugOn()
+ Reader.UpdateInformation()
+@@ -18,21 +19,21 @@ Reader.DisableAllGrids()
+ Reader.EnableGrid(2)
+ Reader.EnableAllArrays()
+ Reader.Update()
+-print 'Output = ', Reader.GetOutput()
++print ('Output = ', Reader.GetOutput())
+ Append = vtkAppendFilter()
+-print ProcId," : Ports = ", Reader.GetNumberOfOutputPorts()
++print (ProcId," : Ports = ", Reader.GetNumberOfOutputPorts())
+ for on in range(Reader.GetNumberOfOutputPorts()) :
+ Output = Reader.GetOutput(on)
+- print ProcId, ' Number of Levels ',Output.GetNumberOfLevels()
+- print ProcId, ' Number of Groups ',Output.GetNumberOfGroups()
+- print ProcId, ' Number of DataSets in Group 0 ',Output.GetNumberOfDataSets(0)
++ print (ProcId, ' Number of Levels ',Output.GetNumberOfLevels())
++ print (ProcId, ' Number of Groups ',Output.GetNumberOfGroups())
++ print (ProcId, ' Number of DataSets in Group 0 ',Output.GetNumberOfDataSets(0))
+ for i in range(Output.GetNumberOfDataSets(0)) :
+ ds = Output.GetDataSet(0,i)
+ if ds :
+- print '%d : Output %d = %d Cells' % (ProcId, i, ds.GetNumberOfCells())
++ print ('%d : Output %d = %d Cells' % (ProcId, i, ds.GetNumberOfCells()))
+ Append.AddInput(ds)
+ else :
+- print '%d : Output %d = NONE' % (ProcId, i)
++ print ('%d : Output %d = NONE' % (ProcId, i))
+ Append.Update()
+-print Append.GetOutput()
++print (Append.GetOutput())
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfVtkTest2.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfVtkTest2.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfVtkTest2.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+ from vtk import *
+ from libvtkXdmfPython import *
+@@ -10,16 +11,16 @@ Controller = vtkMPIController()
+ Reader.SetController(Controller)
+ ProcId = Reader.GetController().GetLocalProcessId()
+ NumProcs = Reader.GetController().GetNumberOfProcesses()
+-print 'Hello from %d of %d' % (ProcId, NumProcs)
++print ('Hello from %d of %d' % (ProcId, NumProcs))
+ Reader.SetFileName('Mixed.xmf')
+ # Reader.DebugOn()
+ Reader.UpdateInformation()
+ Reader.EnableAllGrids()
+ Reader.EnableAllArrays()
+ Reader.Update()
+-print 'Output = ', Reader.GetOutput()
++print ('Output = ', Reader.GetOutput())
+ Append = vtkAppendFilter()
+-print ProcId," : Ports = ", Reader.GetNumberOfOutputPorts()
++print (ProcId," : Ports = ", Reader.GetNumberOfOutputPorts())
+ RenderWindow = vtkRenderWindow()
+ Renderer = vtkRenderer()
+ RenderWindow.AddRenderer(Renderer)
+@@ -31,10 +32,10 @@ RenderWindowInteractor.SetRenderWindow(R
+ RenderWindowInteractor.Initialize()
+ for on in range(Reader.GetNumberOfOutputPorts()) :
+ ds = Output = Reader.GetOutput(on)
+- print 'Output has %d Cells', Output.GetNumberOfCells()
++ print ('Output has %d Cells', Output.GetNumberOfCells())
+ # for i in range(Output.GetNumberOfCells()) :
+ # cell = Output.GetCell(i)
+-# print 'Cell = ', cell
++# print ('Cell = ', cell)
+ Geometry = vtkGeometryFilter()
+ Geometry.SetInput(Output)
+ Mapper = vtkPolyDataMapper()
+@@ -46,11 +47,11 @@ for on in range(Reader.GetNumberOfOutput
+ Renderer.AddActor(Actor)
+ i = 0
+ # if ds :
+-# print '%d : Output %d = %d Cells' % (ProcId, i, ds.GetNumberOfCells())
++# print ('%d : Output %d = %d Cells' % (ProcId, i, ds.GetNumberOfCells()))
+ # Append.AddInput(ds)
+ # else :
+-# print '%d : Output %d = NONE' % (ProcId, i)
++# print ('%d : Output %d = NONE' % (ProcId, i))
+ #Append.Update()
+-#print Append.GetOutput()
++#print (Append.GetOutput())
+ RenderWindowInteractor.Start(1)
+
+Index: xdmf-2.1.dfsg.1/Examples/Python/XdmfWriter.py
+===================================================================
+--- xdmf-2.1.dfsg.1.orig/Examples/Python/XdmfWriter.py
++++ xdmf-2.1.dfsg.1/Examples/Python/XdmfWriter.py
+@@ -1,5 +1,6 @@
+ #!/bin/env python
+
++from __future__ import print_function
+ from Xdmf import *
+ from vtk import *
+ from libvtkXdmfPython import *
+@@ -41,22 +42,22 @@ class DataParser :
+
+ def ParseUGrid(self, UGrid) :
+ if UGrid.IsHomogeneous() :
+- print 'Homogeneous UGrid ', UGrid
++ print ('Homogeneous UGrid ', UGrid)
+ Fd = UGrid.GetFieldData()
+ if Fd :
+ NameArray = Fd.GetArray('Name')
+- print 'NameArray = ', NameArray
+- print 'name = ', NameArray.GetValue(0)
++ print ('NameArray = ', NameArray)
++ print ('name = ', NameArray.GetValue(0))
+ CellArray = UGrid.GetCells()
+ Conns = CellArray.GetData()
+- print '%d Cells' % UGrid.GetNumberOfCells()
++ print ('%d Cells' % UGrid.GetNumberOfCells())
+ for i in range(UGrid.GetNumberOfCells()) :
+- print '(%d) %d = %s' % (i, UGrid.GetCellType(i), self.CellTypes[UGrid.GetCellType(i)])
+- print '%d Points' % UGrid.GetNumberOfPoints()
++ print ('(%d) %d = %s' % (i, UGrid.GetCellType(i), self.CellTypes[UGrid.GetCellType(i)]))
++ print ('%d Points' % UGrid.GetNumberOfPoints())
+ for i in range(UGrid.GetNumberOfPoints()) :
+ x, y, z = UGrid.GetPoint(i)
+- print '(%d) %f %f %f' % (i, x, y, z)
+- print '%d Connections' % CellArray.GetNumberOfConnectivityEntries()
++ print ('(%d) %f %f %f' % (i, x, y, z))
++ print ('%d Connections' % CellArray.GetNumberOfConnectivityEntries())
+ i = 0
+ while i < Conns.GetNumberOfTuples() :
+ n = Conns.GetValue(i)
+@@ -64,61 +65,61 @@ class DataParser :
+ for j in range(n) :
+ p = Conns.GetValue(i)
+ i += 1
+- print '%d ' % p
++ print ('%d ' % p)
+ Pd = UGrid.GetPointData()
+- print '# of Point Attributes = %d' % Pd.GetNumberOfArrays()
++ print ('# of Point Attributes = %d' % Pd.GetNumberOfArrays())
+ for i in range(Pd.GetNumberOfArrays()) :
+ Pa = Pd.GetArray(i)
+- print Pd.GetArrayName(i), ' = ',Pa
++ print (Pd.GetArrayName(i), ' = ',Pa)
+ for j in range(Pa.GetNumberOfTuples()) :
+- print '(%d) %f' % (j, Pa.GetValue(j))
++ print ('(%d) %f' % (j, Pa.GetValue(j)))
+ Cd = UGrid.GetCellData()
+- print '# of Cell Attributes = %d' % Cd.GetNumberOfArrays()
+- # print UGrid
++ print ('# of Cell Attributes = %d' % Cd.GetNumberOfArrays())
++ # print (UGrid)
+ else :
+- print 'Heterogeneous UGrid'
++ print ('Heterogeneous UGrid')
+
+ def DataArrayToXdmfArray(self, da) :
+- # print 'Converting ', da
+- print 'Data Type', da.GetDataType(), ' = ', da.GetDataTypeAsString()
++ # print ('Converting ', da)
++ print ('Data Type', da.GetDataType(), ' = ', da.GetDataTypeAsString())
+ Xda = XdmfArray()
+ Xda.SetNumberOfElements(da.GetNumberOfTuples() * da.GetNumberOfComponents())
+ Type = da.GetDataTypeAsString()
+ pntr = da.GetVoidPointer(0)
+ Xpntr = VoidPointerHandleToXdmfPointer(pntr)
+ if Type.upper() == 'FLOAT' :
+- # print 'Array is Float32'
++ # print ('Array is Float32')
+ Xda.SetNumberType(XDMF_FLOAT32_TYPE)
+ elif Type.upper() == 'INT' :
+- # print 'Array is Int32'
++ # print ('Array is Int32')
+ Xda.SetNumberType(XDMF_INT32_TYPE)
+ elif Type.upper() == 'DOUBLE' :
+- # print 'Array is Float64'
++ # print ('Array is Float64')
+ Xda.SetNumberType(XDMF_FLOAT64_TYPE)
+ elif Type.upper() == 'LONG' :
+- # print 'Array is Int64'
++ # print ('Array is Int64')
+ Xda.SetNumberType(XDMF_INT64_TYPE)
+ elif Type.upper() == 'IDTYPE' :
+- # print 'Array is Int64'
++ # print ('Array is Int64')
+ Xda.SetNumberType(XDMF_INT64_TYPE)
+ else :
+- print 'Illegal NumberType : ', Type
++ print ('Illegal NumberType : ', Type)
+ return None
+ Xda.SetDataPointer(Xpntr)
+- print 'Values ',Xda.GetValues(0, 10)
++ print ('Values ',Xda.GetValues(0, 10))
+ return Xda
+
+ def WriteIGrid(self, IGrid, Group, Index) :
+- print 'Homogeneous Image UGrid ', IGrid.GetDimensions()
++ print ('Homogeneous Image UGrid ', IGrid.GetDimensions())
+
+ def WriteUGrid(self, UGrid, Group, Index) :
+ if UGrid.IsHomogeneous() :
+- print 'Homogeneous UGrid '
++ print ('Homogeneous UGrid ')
+ Fd = UGrid.GetFieldData()
+ if Fd :
+ NameArray = Fd.GetArray('Name')
+- print 'NameArray = ', NameArray
+- print 'name = ', NameArray.GetValue(0)
++ print ('NameArray = ', NameArray)
++ print ('name = ', NameArray.GetValue(0))
+ Xgrid = XdmfGrid()
+ Xgrid.SetName('Group %05d Index %05d' % (Group, Index))
+ self.MainGrid.Insert(Xgrid)
+@@ -126,11 +127,11 @@ class DataParser :
+ CellArray = UGrid.GetCells()
+ Conns = CellArray.GetData()
+ XConns = self.DataArrayToXdmfArray(Conns)
+- print '%d Cells' % UGrid.GetNumberOfCells()
++ print ('%d Cells' % UGrid.GetNumberOfCells())
+ NodesPerElement = XConns.GetValueAsInt64(0)
+- print '%d NodesPerElement' % NodesPerElement
++ print ('%d NodesPerElement' % NodesPerElement)
+ XConns.SetShapeFromString("%d %d" % (UGrid.GetNumberOfCells(), NodesPerElement + 1))
+- print 'Shape ', XConns.GetShapeAsString()
++ print ('Shape ', XConns.GetShapeAsString())
+ Start = '0 1'
+ Stride = '1 1'
+ Count = '%d %d' % (UGrid.GetNumberOfCells(), NodesPerElement)
+@@ -152,10 +153,10 @@ class DataParser :
+ self.Arrays.append(JustConns)
+
+ # for i in range(UGrid.GetNumberOfCells()) :
+- # print '(%d) %d = %s' % (i, UGrid.GetCellType(i), self.CellTypes[UGrid.GetCellType(i)])
+- print '%d Points' % UGrid.GetNumberOfPoints()
++ # print ('(%d) %d = %s' % (i, UGrid.GetCellType(i), self.CellTypes[UGrid.GetCellType(i)]))
++ print ('%d Points' % UGrid.GetNumberOfPoints())
+ pnts = UGrid.GetPoints().GetData()
+- # print "Points = ", pnts
++ # print ("Points = ", pnts)
+ Xpnts = self.DataArrayToXdmfArray(pnts)
+ Xgeo = Xgrid.GetGeometry()
+ Xgeo.SetGeometryType(XDMF_GEOMETRY_XYZ)
+@@ -169,8 +170,8 @@ class DataParser :
+ # H5.Close()
+ # for i in range(UGrid.GetNumberOfPoints()) :
+ # x, y, z = UGrid.GetPoint(i)
+- # print '(%d) %f %f %f' % (i, x, y, z)
+- # print '%d Connections' % CellArray.GetNumberOfConnectivityEntries()
++ # print ('(%d) %f %f %f' % (i, x, y, z))
++ # print ('%d Connections' % CellArray.GetNumberOfConnectivityEntries())
+ # i = 0
+ # while i < Conns.GetNumberOfTuples() :
+ # n = Conns.GetValue(i)
+@@ -178,9 +179,9 @@ class DataParser :
+ # for j in range(n) :
+ # p = Conns.GetValue(i)
+ # i += 1
+- # print '%d ' % p
++ # print ('%d ' % p)
+ Pd = UGrid.GetPointData()
+- print '# of Point Attributes = %d' % Pd.GetNumberOfArrays()
++ print ('# of Point Attributes = %d' % Pd.GetNumberOfArrays())
+ for i in range(Pd.GetNumberOfArrays()) :
+ Pa = Pd.GetArray(i)
+ Xpa = self.DataArrayToXdmfArray(Pa)
+@@ -193,11 +194,11 @@ class DataParser :
+ self.Arrays.append(Xpa)
+ self.Arrays.append(Xattr)
+ # self.Arrays.append(Xpa)
+- # print Pd.GetArrayName(i), ' = ',Pa
++ # print (Pd.GetArrayName(i), ' = ',Pa)
+ # for j in range(Pa.GetNumberOfTuples()) :
+- # print '(%d) %f' % (j, Pa.GetValue(j))
++ # print ('(%d) %f' % (j, Pa.GetValue(j)))
+ Cd = UGrid.GetCellData()
+- print '# of Cell Attributes = %d' % Cd.GetNumberOfArrays()
++ print ('# of Cell Attributes = %d' % Cd.GetNumberOfArrays())
+ for i in range(Cd.GetNumberOfArrays()) :
+ Ca = Cd.GetArray(i)
+ Xca = self.DataArrayToXdmfArray(Ca)
+@@ -209,33 +210,33 @@ class DataParser :
+ Xgrid.Insert(Xattr)
+ self.Arrays.append(Xca)
+ self.Arrays.append(Xattr)
+- # print UGrid
++ # print (UGrid)
+ else :
+- print 'Heterogeneous UGrid'
++ print ('Heterogeneous UGrid')
+
+ def ParseMultiGroup(self, Output) :
+- print 'Parsing a vtkMultiGroupDataSet '
++ print ('Parsing a vtkMultiGroupDataSet ')
+ NGroups = Output.GetNumberOfGroups()
+- print 'Output has %d Groups' % NGroups
++ print ('Output has %d Groups' % NGroups)
+ for g in range(NGroups) :
+ NDataSets = Output.GetNumberOfDataSets(g)
+- print 'Group %d has %d DataSets' % (g + 1, NDataSets)
++ print ('Group %d has %d DataSets' % (g + 1, NDataSets))
+ for i in range(NDataSets) :
+ ds = Output.GetDataSet(g,i)
+- print 'Output Group %d Index %d (%s) has %d Cells' % (g + 1, i + 1, ds.GetClassName(), ds.GetNumberOfCells())
++ print ('Output Group %d Index %d (%s) has %d Cells' % (g + 1, i + 1, ds.GetClassName(), ds.GetNumberOfCells()))
+ if ds.IsA('vtkUnstructuredGrid') :
+ self.ParseUGrid(ds)
+ self.WriteUGrid(ds, g, i)
+ if ds.IsA('vtkImageData') :
+ self.WriteIGrid(ds, g, i)
+ else :
+- print 'Can not handle vtk class = ', ds.GetClassName()
++ print ('Can not handle vtk class = ', ds.GetClassName())
+
+ def Parse(self, Output) :
+ if Output.IsA('vtkMultiGroupDataSet') :
+ self.ParseMultiGroup(Output)
+ else :
+- print 'Can not handle vtk class = ', Output.GetClassName()
++ print ('Can not handle vtk class = ', Output.GetClassName())
+
+
+
+@@ -247,7 +248,7 @@ if __name__ == '__main__' :
+ # Reader.SetController(Controller)
+ # ProcId = Reader.GetController().GetLocalProcessId()
+ # NumProcs = Reader.GetController().GetNumberOfProcesses()
+-# print 'Hello from %d of %d' % (ProcId, NumProcs)
++# print ('Hello from %d of %d' % (ProcId, NumProcs))
+ # Reader.SetFileName('Points1.xmf')
+ # Reader.SetFileName('VtkTest.pvd')
+ Reader.SetFileName('VtkMulti.vtm')
+@@ -262,12 +263,12 @@ if __name__ == '__main__' :
+ Reader.Update()
+
+ p = DataParser()
+- print 'Reader has %d outputs' % Reader.GetNumberOfOutputPorts()
++ print ('Reader has %d outputs' % Reader.GetNumberOfOutputPorts())
+ for on in range(Reader.GetNumberOfOutputPorts()) :
+- print 'Reading Output ', on
++ print ('Reading Output ', on)
+ Output = Reader.GetOutput(on)
+ p.Parse(Output)
+ p.Root.Build()
+- print p.DOM.Serialize()
++ print (p.DOM.Serialize())
+ p.DOM.Write('junk.xmf')
+
diff --git a/debian/patches/series b/debian/patches/series
index fd12ad6..aca400c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ reproducible-build.patch
c++11.patch
gzstream.patch
python-install-dir.patch
+python3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/xdmf.git
More information about the debian-science-commits
mailing list