Mercurial > hg > webaudioevaluationtool
diff scripts/timeline_view.py @ 1063:e67a76e9ba7a
Scripts: choose input/output folder from command line; score_plot also choose options from command line (WIP)
author | Brecht De Man <BrechtDeMan@users.noreply.github.com> |
---|---|
date | Mon, 20 Jul 2015 12:47:16 +0100 |
parents | b7fd0296c6ab |
children | b2492aeafe8b |
line wrap: on
line diff
--- a/scripts/timeline_view.py Wed Jul 15 15:52:56 2015 +0100 +++ b/scripts/timeline_view.py Mon Jul 20 12:47:16 2015 +0100 @@ -1,14 +1,25 @@ #!/usr/bin/python import xml.etree.ElementTree as ET -import os -import matplotlib.pyplot as plt +import os # list files in directory +import sys # command line arguments +import matplotlib.pyplot as plt # plots + +# COMMAND LINE ARGUMENTS + +assert len(sys.argv)<3, "timeline_view takes at most 1 command line argument\n"+\ + "Use: python timeline_view.py [timeline_folder_location]" + +# 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 [timeline_folder_location]" + print "Using default path: " + folder_name +elif len(sys.argv) == 2: + folder_name = sys.argv[1] # First command line argument is folder # CONFIGURATION -# XML results files location (modify as needed): -folder_name = "../saves" # Looks in 'saves/' folder from 'scripts/' folder - # Folder where to store timelines timeline_folder = folder_name + '/timelines/' # Stores in 'saves/timelines/'