Changeset bdc38391e869150773124fd0afe1027671146cc6


Ignore:
Timestamp:
07/29/11 11:29:49 (10 months ago)
Author:
Luper Rouch <luper.rouch@…>
Children:
721e76160f9384fb67bb7844b1ecefe4d9b8cfd1
Parents:
b353777e30837cddb30ae89a91209cabb59218be
git-committer:
Luper Rouch <luper.rouch@…> (07/29/11 11:29:49)
Message:

checking return code of mkvmerge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/avi2mkv/src/avi2mkv/__init__.py

    rb353777 rbdc3839  
    55import multiprocessing 
    66import tempfile 
     7import sys 
    78from avi2mkv import subrip 
    89 
     
    1314 
    1415    *args* must be a pair containing *(input_files, options)*. *options* must 
    15     be an object containing the command line arguments parsed by argparse. 
     16    be an object containing the command line arguments parsed by 
     17    :mod:`argparse`. 
    1618    """ 
    1719    input_file, options = args 
     
    2224        subtitles_file = root + ".srt" 
    2325        if not options.quiet: 
    24             print "Found subtitles file '%s'" % subtitles_file 
     26            sys.stdout.write("Found subtitles file '%s'\n" % subtitles_file) 
    2527    else: 
    2628        subtitles_file = None 
     
    6365    kwargs = {} 
    6466    if not options.quiet: 
    65         print "Muxing '%s' to '%s'..." % (input_file, output_file) 
     67        sys.stdout.write("Muxing '%s' to '%s'...\n" %  
     68                (input_file, output_file)) 
    6669    else: 
    6770        fnull = open(os.devnull, "w") 
    6871        kwargs["stdout"] = fnull 
    6972        kwargs["stderr"] = fnull 
    70     subprocess.call(args, **kwargs) 
     73    try: 
     74        subprocess.check_call(args, **kwargs) 
     75    except subprocess.CalledProcessError, err: 
     76        sys.stderr.write("Error muxing '%s', mkvmerge exited with error " 
     77                "code %s" % (input_file, err.returncode)) 
    7178 
    7279 
Note: See TracChangeset for help on using the changeset viewer.