1  #!/usr/bin/env python
 2
 3  import os
 4  import sys
 5
 6  from Playlist import Playlist
 7
 8  if len(sys.argv) < 2:
 9          print "usage: burnpls playlist-file-path"
10          sys.exit(1)
11
12  if os.path.isfile(sys.argv[1]):
13          pls = Playlist(sys.argv[1])
14          song_list = ""
15
16          for filepath in pls.get_song_list():
17                  if os.path.isfile(filepath):
18                          song_list += "\"" + filepath + "\" "
19                  else:
20                          print "couldn't find " + filepath
21
22          if len(song_list) > 0:
23              #os.system("burncd " + song_list)
24              print "executing: burncd " + song_list
25  else:
26          if not os.path.isfile(sys.argv[1]):
27                  print sys.argv[1] + " doesn't exist!"
28          else:
29                  print "oops.. unknown error happened while trying to burn the files specified in " + sys.argv[1]