]> Creatis software - gdcm.git/blobdiff - gdcmPython/demo/PrintHeader.py.in
ENH: Finally found a version of GetMacAddress that actually works on Sun/Solaris...
[gdcm.git] / gdcmPython / demo / PrintHeader.py.in
index affa5f48425eb95bf2d65706ec7b75a9a672f08a..eb11bce6b42f2e2be53769366d205f20473012f1 100644 (file)
@@ -21,26 +21,18 @@ try:
 except IndexError:
    printLevel = 1
 
-#if not os.path.isfile(FileName):
-#   print "Cannot open file ", FileName
-#   sys.exit()
-
-# On debugging purposes uncomment the next line
-#s = raw_input("Hit any key in this window to exit")
-
 ### Build the header element list
 print fileName, type(fileName)
 header = gdcm.Header(fileName)
 if not header.IsReadable():
-   print "The ", fileName, " file is not readable with gdcm. Sorry."
-   sys.exit()
+   raise RuntimeError,"The '%s' file is not readable with gdcm." % fileName
 
 print "##############################################################"
 print "### Display all the elements and their respective values"
 print "## found in the ", fileName, " file."
 print "##############################################################"
 
-header.Initialize()
+header.InitTraversal()
 val=header.GetNextEntry()
 while(val):
        val.Print()