diff python/timeline_view.py @ 2274:2b5990868aa7

timeline_view.py and timeline_view_movement.py compatible with Python 2.7 and 3.x: print ... --> print(...)
author Brecht De Man <b.deman@qmul.ac.uk>
date Wed, 20 Apr 2016 19:12:16 +0200
parents 556b79c72eee
children 3004c6a5665c
line wrap: on
line diff
--- a/python/timeline_view.py	Wed Apr 20 19:07:03 2016 +0200
+++ b/python/timeline_view.py	Wed Apr 20 19:12:16 2016 +0200
@@ -14,19 +14,19 @@
 # XML results files location
 if len(sys.argv) == 1:
     folder_name = "../saves"    # Looks in 'saves/' folder from 'scripts/' folder
-    print "Use: python timeline_view.py [XML_files_location]"
-    print "Using default path: " + folder_name
+    print("Use: python timeline_view.py [XML_files_location]")
+    print("Using default path: " + folder_name)
 elif len(sys.argv) == 2:
     folder_name = sys.argv[1]   # First command line argument is folder
 
 # check if folder_name exists
 if not os.path.exists(folder_name):
     #the file is not there
-    print "Folder '"+folder_name+"' does not exist."
+    print("Folder '"+folder_name+"' does not exist.")
     sys.exit() # terminate script execution
 elif not os.access(os.path.dirname(folder_name), os.W_OK):
     #the file does exist but write privileges are not given
-    print "No write privileges in folder '"+folder_name+"'."
+    print("No write privileges in folder '"+folder_name+"'.")
 
 
 # CONFIGURATION 
@@ -76,11 +76,11 @@
             plot_empty = True                               # check if any data is plotted
             
             if page_name is None: # ignore 'empty' audio_holders
-                print "WARNING: " + file + " contains empty page. (comment_parser.py)"
+                print("WARNING: " + file + " contains empty page. (comment_parser.py)")
                 break
                 
             if audioholder.get("state") != "complete":
-                print "WARNING: " + file + "test page " + page_name + " is not complete, skipping."
+                print("WARNING: " + file + "test page " + page_name + " is not complete, skipping.")
                 break;
             # SORT AUDIO ELEMENTS ALPHABETICALLY
             audioelements = audioholder.findall("./audioelement")