Changeset 30008

Show
Ignore:
Timestamp:
07.07.2015 15:43:31 (4 years ago)
Author:
davidb
Message:

Generalization of command line args to accept 2 arguments

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • other-projects/mirex/grand-challenge/generate-jamendo-dataset/scripts-2015/get-audio-download-mp3.py

    r30005 r30008  
    77import sys 
    88 
    9 #input_dir = sys.argv[1] if len(sys.argv)==2 else "download-json" 
    10 input_dir = sys.argv[1] if len(sys.argv)==2 else "download-json-musicinfo" 
     9argc = len(sys.argv) 
    1110 
    12 output_dir = "download-audio" 
     11input_idir  = sys.argv[1] if (argc==2) or (argc==3)  else "download-json-all" 
     12output_dir = sys.argv[2] if argc==3 else "download-audio" 
     13 
     14if not os.path.isdir(output_dir): 
     15    print "Creating directory: " + output_dir 
     16    os.mkdir(output_dir) 
     17     
    1318 
    1419json_files = [ jf for jf in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir,jf)) ]