<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from optparse import OptionParser <EOL> from moshion . core import Moshion <EOL> from moshion import sequence <EOL> from moshion . util import IS_TTY , HR , hilite <EOL> def interactive ( ) : <EOL> opts = { } <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> print "<STR_LIT>" <EOL> inseq_input = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) <EOL> inseqs = sequence . glob ( inseq_input . split ( '<STR_LIT:.>' ) [ <NUM_LIT:0> ] ) <EOL> if len ( inseqs ) > <NUM_LIT:1> : <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> for k , v in enumerate ( inseqs ) : <EOL> print "<STR_LIT>" . format ( k + <NUM_LIT:1> , v ) <EOL> inseq_input = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) or <NUM_LIT:1> <EOL> inseq = inseqs [ int ( inseq_input ) - <NUM_LIT:1> ] <EOL> else : <EOL> inseq = inseqs [ <NUM_LIT:0> ] <EOL> inseq_path = inseq . __str__ ( ) . split ( '<STR_LIT:U+0020>' ) [ <NUM_LIT:0> ] <EOL> inseq_start = inseq . __str__ ( ) . split ( '<STR_LIT:U+0020>' ) [ <NUM_LIT:1> ] <EOL> inseq_end = inseq . __str__ ( ) . split ( '<STR_LIT:U+0020>' ) [ <NUM_LIT:2> ] <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> print "<STR_LIT>" <EOL> start = raw_input ( hilite ( "<STR_LIT>" . format ( inseq_start ) , <NUM_LIT:16> ) ) or inseq_start <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> print "<STR_LIT>" <EOL> end = raw_input ( hilite ( "<STR_LIT>" . format ( inseq_end ) , <NUM_LIT:16> ) ) or inseq_end <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> print "<STR_LIT>" <EOL> moshseq_input = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) <EOL> moshseqs = sequence . glob ( moshseq_input . split ( '<STR_LIT:.>' ) [ <NUM_LIT:0> ] ) <EOL> if len ( moshseqs ) > <NUM_LIT:1> : <EOL> print "<STR_LIT>" <EOL> for k , v in enumerate ( moshseqs ) : <EOL> print "<STR_LIT>" . format ( k + <NUM_LIT:1> , v ) <EOL> moshseq_input = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) or <NUM_LIT:1> <EOL> moshseq = moshseqs [ int ( moshseq_input ) - <NUM_LIT:1> ] <EOL> else : <EOL> moshseq = moshseqs [ <NUM_LIT:0> ] <EOL> moshseq_path = moshseq . __str__ ( ) . split ( '<STR_LIT:U+0020>' ) [ <NUM_LIT:0> ] <EOL> moshseq_start = moshseq . __str__ ( ) . split ( '<STR_LIT:U+0020>' ) [ <NUM_LIT:1> ] <EOL> moshseq_end = moshseq . __str__ ( ) . split ( '<STR_LIT:U+0020>' ) [ <NUM_LIT:2> ] <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> print "<STR_LIT>" <EOL> moshfirst = raw_input ( hilite ( "<STR_LIT>" . format ( moshseq_start ) , <NUM_LIT:16> ) ) or moshseq_start <EOL> print hilite ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> print "<STR_LIT>" <EOL> outdir = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) <EOL> bitrate = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) or "<STR_LIT>" <EOL> keyframe = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) or "<STR_LIT>" <EOL> threshold = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) or "<STR_LIT>" <EOL> interval = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:16> ) ) or "<STR_LIT>" <EOL> uber = raw_input ( hilite ( "<STR_LIT>" , <NUM_LIT:12> ) ) or "<STR_LIT:N>" <EOL> if uber in [ '<STR_LIT:Y>' , '<STR_LIT:y>' , '<STR_LIT:yes>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> uber = True <EOL> else : <EOL> uber = False <EOL> return { <EOL> '<STR_LIT>' : inseq_path , <EOL> '<STR_LIT:start>' : start , <EOL> '<STR_LIT:end>' : end , <EOL> '<STR_LIT>' : moshseq_path , <EOL> '<STR_LIT>' : moshfirst , <EOL> '<STR_LIT>' : outdir , <EOL> '<STR_LIT>' : bitrate , <EOL> '<STR_LIT>' : keyframe , <EOL> '<STR_LIT>' : threshold , <EOL> '<STR_LIT>' : interval , <EOL> '<STR_LIT>' : uber <EOL> } <EOL> def main ( ) : <EOL> usage = "<STR_LIT>" <EOL> version = __import__ ( '<STR_LIT>' ) . get_version ( ) <EOL> description = "<STR_LIT>" % version <EOL> parser = OptionParser ( usage = usage , version = version , description = description ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT:start>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT:end>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> if options . interactive : <EOL> moshion_options = interactive ( ) <EOL> moshion = Moshion ( ** moshion_options ) <EOL> moshion . do_full_mosh ( ) <EOL> else : <EOL> if None in [ options . start , options . end , options . inseq , options . moshseq , options . moshstart , options . outdir ] : <EOL> parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if IS_TTY : print hilite ( "<STR_LIT>" . format ( version , HR ) , <NUM_LIT:7> ) <EOL> moshion_options = { <EOL> '<STR_LIT:start>' : options . start , <EOL> '<STR_LIT:end>' : options . end , <EOL> '<STR_LIT>' : options . inseq , <EOL> '<STR_LIT>' : options . moshseq , <EOL> '<STR_LIT>' : options . moshstart , <EOL> '<STR_LIT>' : options . outdir , <EOL> '<STR_LIT>' : options . avionly , <EOL> '<STR_LIT>' : options . uber <EOL> } <EOL> moshion_options [ '<STR_LIT>' ] = options . bitrate if options . bitrate else "<STR_LIT>" <EOL> moshion_options [ '<STR_LIT>' ] = options . keyframe if options . keyframe else "<STR_LIT>" <EOL> moshion_options [ '<STR_LIT>' ] = options . threshold if options . threshold else "<STR_LIT>" <EOL> moshion_options [ '<STR_LIT>' ] = options . interval if options . interval else "<STR_LIT>" <EOL> if options . avionly and options . writeseq : <EOL> if IS_TTY : print hilite ( "<STR_LIT>" , <NUM_LIT:10> ) <EOL> parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> moshion = Moshion ( ** moshion_options ) <EOL> if not moshion_options [ '<STR_LIT>' ] and not options . noseq and not options . writeseq : <EOL> moshion . do_full_mosh ( ) <EOL> if options . avionly : <EOL> moshion . write_movie ( ) <EOL> if options . noseq : <EOL> moshion . write_movie ( ) <EOL> moshion . mosh ( ) <EOL> if options . writeseq : <EOL> moshion . write_sequence ( ) <EOL> echo_cmd = "<STR_LIT>" <EOL> echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" . format ( start = moshion_options [ '<STR_LIT:start>' ] , end = moshion_options [ '<STR_LIT:end>' ] , moshstart = moshion_options [ '<STR_LIT>' ] ) ] ) <EOL> echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" . format ( inseq = moshion_options [ '<STR_LIT>' ] , moshseq = moshion_options [ '<STR_LIT>' ] ) ] ) <EOL> echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" . format ( outdir = moshion_options [ '<STR_LIT>' ] ) ] ) <EOL> echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" . format ( bitrate = moshion_options [ '<STR_LIT>' ] , keyframe = moshion_options [ '<STR_LIT>' ] , threshold = moshion_options [ '<STR_LIT>' ] , interval = moshion_options [ '<STR_LIT>' ] ) ] ) <EOL> if options . avionly : echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" ] ) <EOL> if options . noseq : echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" ] ) <EOL> if options . writeseq : echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" ] ) <EOL> if moshion_options [ '<STR_LIT>' ] : echo_cmd = "<STR_LIT:U+0020>" . join ( [ echo_cmd , "<STR_LIT>" ] ) <EOL> if IS_TTY : print hilite ( "<STR_LIT>" . format ( HR , echo_cmd ) , <NUM_LIT:12> ) <EOL> if IS_TTY : print hilite ( "<STR_LIT>" . format ( HR ) , <NUM_LIT:3> ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
