<s> import os <EOL> import sys <EOL> import signal <EOL> import optparse <EOL> try : <EOL> import whisper <EOL> except ImportError : <EOL> raise SystemExit ( '<STR_LIT>' ) <EOL> try : <EOL> signal . signal ( signal . SIGPIPE , signal . SIG_DFL ) <EOL> except AttributeError : <EOL> pass <EOL> option_parser = optparse . OptionParser ( usage = '''<STR_LIT>''' ) <EOL> ( options , args ) = option_parser . parse_args ( ) <EOL> if len ( args ) < <NUM_LIT:1> : <EOL> option_parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> path = args [ <NUM_LIT:0> ] <EOL> if len ( args ) > <NUM_LIT:1> : <EOL> field = args [ <NUM_LIT:1> ] <EOL> else : <EOL> field = None <EOL> try : <EOL> info = whisper . info ( path ) <EOL> except whisper . WhisperException as exc : <EOL> raise SystemExit ( '<STR_LIT>' % str ( exc ) ) <EOL> info [ '<STR_LIT>' ] = os . stat ( path ) . st_size <EOL> if field : <EOL> if field not in info : <EOL> print ( '<STR_LIT>' % ( field , '<STR_LIT:U+002C>' . join ( info ) ) ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> print ( info [ field ] ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> archives = info . pop ( '<STR_LIT>' ) <EOL> for key , value in info . items ( ) : <EOL> print ( '<STR_LIT>' % ( key , value ) ) <EOL> print <EOL> for i , archive in enumerate ( archives ) : <EOL> print ( '<STR_LIT>' % i ) <EOL> for key , value in archive . items ( ) : <EOL> print ( '<STR_LIT>' % ( key , value ) ) <EOL> print </s>
