Mercurial > hg > webaudioevaluationtool
diff scripts/timeline_view.py @ 1066:a2a245542ae6
Scripts: test if folder name (default or provided via command line) exists
author | Brecht De Man <BrechtDeMan@users.noreply.github.com> |
---|---|
date | Tue, 11 Aug 2015 10:15:17 +0200 |
parents | b2492aeafe8b |
children | 8d0061336b90 |
line wrap: on
line diff
--- a/scripts/timeline_view.py Mon Aug 10 18:45:45 2015 +0200 +++ b/scripts/timeline_view.py Tue Aug 11 10:15:17 2015 +0200 @@ -17,6 +17,16 @@ 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." + 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+"'." + # CONFIGURATION