#NEWLINE# def parseArgs( self , argv ) : #NEWLINE# #INDENT# if ( ( len ( argv ) > 1 ) and ( argv [ 1 ] . lower ( ) == 'discover' ) ) : #NEWLINE# #INDENT# self . _do_discovery ( argv [ 2 : ] ) #NEWLINE# return #NEWLINE# #UNINDENT# import getopt #NEWLINE# long_opts = [ 'help' , 'verbose' , 'quiet' , 'failfast' , 'catch' , 'buffer' , 'list' , 'load-list=' ] #NEWLINE# try : #NEWLINE# #INDENT# ( options , args ) = getopt . getopt ( argv [ 1 : ] , 'hHvqfcbl' , long_opts ) #NEWLINE# for ( opt , value ) in options : #NEWLINE# #INDENT# if ( opt in ( '-h' , '-H' , '--help' ) ) : #NEWLINE# #INDENT# self . usageExit ( ) #NEWLINE# #UNINDENT# if ( opt in ( '-q' , '--quiet' ) ) : #NEWLINE# #INDENT# self . verbosity = 0 #NEWLINE# #UNINDENT# if ( opt in ( '-v' , '--verbose' ) ) : #NEWLINE# #INDENT# self . verbosity = 2 #NEWLINE# #UNINDENT# if ( opt in ( '-f' , '--failfast' ) ) : #NEWLINE# #INDENT# if ( self . failfast is None ) : #NEWLINE# #INDENT# self . failfast = True #NEWLINE# #UNINDENT# #UNINDENT# if ( opt in ( '-c' , '--catch' ) ) : #NEWLINE# #INDENT# if ( self . catchbreak is None ) : #NEWLINE# #INDENT# self . catchbreak = True #NEWLINE# #UNINDENT# #UNINDENT# if ( opt in ( '-b' , '--buffer' ) ) : #NEWLINE# #INDENT# if ( self . buffer is None ) : #NEWLINE# #INDENT# self . buffer = True #NEWLINE# #UNINDENT# #UNINDENT# if ( opt in ( '-l' , '--list' ) ) : #NEWLINE# #INDENT# self . listtests = True #NEWLINE# #UNINDENT# if ( opt == '--load-list' ) : #NEWLINE# #INDENT# self . load_list = value #NEWLINE# #UNINDENT# #UNINDENT# if ( ( len ( long_opts ) == 0 ) and ( self . defaultTest is None ) ) : #NEWLINE# #INDENT# self . testNames = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( args ) > 0 ) : #NEWLINE# #INDENT# self . testNames = args #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . testNames = ( self . defaultTest , ) #NEWLINE# #UNINDENT# #UNINDENT# self . createTests ( ) #NEWLINE# #UNINDENT# except getopt . error : #NEWLINE# #INDENT# self . usageExit ( sys . exc_info ( ) [ 1 ] )