def track_rip(tracknumber, outfile, ripper, logfile): cmd = ripper['format'] % { 'binary': ripper['binary'], 'options': ripper['options'], 'tracknumber': int(tracknumber), 'outfile': outfile, } return command_run(cmd, logfile)
def track_enc(infile, outfile, encoder, logfile): cmd = encoder['format'] % { 'binary': encoder['binary'], 'options': encoder['options'], 'infile': infile, 'outfile': outfile, } result = command_run(cmd, logfile) #remove input if encoder['need_input_remove']: os.remove(infile) return result