#NEWLINE# def _prepare_token( self , argv ) : #NEWLINE# #INDENT# if ( argv is None ) : #NEWLINE# #INDENT# argv = sys . argv #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( argv , StrType ) : #NEWLINE# #INDENT# argv = argv . split ( ) #NEWLINE# #UNINDENT# #UNINDENT# all_opt_requried_max_args = dict . fromkeys ( self . extra , 0 ) #NEWLINE# all_opt_requried_max_args . update ( self . opt_names_required_max_args ) #NEWLINE# token = Argv ( argv [ 1 : ] , ( self . auto2dashes or self . options_first ) , all_opt_requried_max_args . stdopt , self . attachopt , self . attachvalue , all_opt_requried_max_args ) #NEWLINE# none_or_error = token . formal ( self . options_first ) #NEWLINE# logger . debug ( 'formal token: %s; error: %s' , token , none_or_error ) #NEWLINE# if ( none_or_error is not None ) : #NEWLINE# #INDENT# return self . exception_handler ( none_or_error ) #NEWLINE# #UNINDENT# return token