#NEWLINE# def _parse_as_shorthand( self , cli_argument , value ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# LOG . debug ( 'Parsing param %s as shorthand' , cli_argument . cli_name ) #NEWLINE# handled_value = self . _handle_special_cases ( cli_argument , value ) #NEWLINE# if ( handled_value is not None ) : #NEWLINE# #INDENT# return handled_value #NEWLINE# #UNINDENT# if isinstance ( value , list ) : #NEWLINE# #INDENT# parsed = [ self . _parser . parse ( v ) for v in value ] #NEWLINE# self . _visitor . visit ( parsed , cli_argument . argument_model ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# parsed = self . _parser . parse ( value ) #NEWLINE# self . _visitor . visit ( parsed , cli_argument . argument_model ) #NEWLINE# #UNINDENT# #UNINDENT# except shorthand . ShorthandParseError as e : #NEWLINE# #INDENT# raise ParamError ( cli_argument . cli_name , str ( e ) ) #NEWLINE# #UNINDENT# except ( ParamError , ParamUnknownKeyError ) as e : #NEWLINE# #INDENT# raise ParamError ( cli_argument . cli_name , str ( e ) ) #NEWLINE# #UNINDENT# return parsed