o ckF[±ã@s,ddlZGdd„deƒZGdd„deƒZdS)éNc@sTeZdZedd„ƒZedd„ƒZedd„ƒZedd„ƒZed d „ƒZed d „ƒZ d S)Ú ConvertercCst|tƒst‚|S©N)Ú isinstanceÚ basestringÚ ValueError©ÚclsÚparamÚvalue©r ú3/usr/lib/python3/dist-packages/boto/roboto/param.pyÚconvert_strings zConverter.convert_stringcCst|ƒSr)Úintrr r r Úconvert_integer"szConverter.convert_integercCsdS)zt For command line arguments, just the presence of the option means True so just return True Tr rr r r Úconvert_boolean'szConverter.convert_booleancCs tj |¡rtj |¡s|St‚r)ÚosÚpathÚexistsÚisdirrrr r r Ú convert_file/szConverter.convert_filecCstj |¡r|St‚r)rrrrrr r r Ú convert_dir5s zConverter.convert_dircCsFzt|d|jƒrt|d|jƒ}n|j}|||ƒWSt|dƒ‚)NÚconvert_Ú)ÚhasattrÚptypeÚgetattrr ÚValidationException)rr r Úmthdr r r Úconvert;s  zConverter.convertN) Ú__name__Ú __module__Ú __qualname__Ú classmethodr rrrrrr r r r rs     rcsveZdZ    ddd„Zedd „ƒZed d „ƒZed d „ƒZedd„ƒZedd„ƒZ edd„ƒZ ‡fdd„Z ‡Z S)ÚParamNÚstringTréc CsL||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ dSr) ÚnamerÚoptionalÚ short_nameÚ long_nameÚdocÚmetavarÚ cardinalityÚdefaultÚchoicesÚencoderÚ request_param) Úselfr&rr'r(r)r*r+r,r-r.r/r0r r r Ú__init__Hs zParam.__init__cCód}|jr d|j}|S©Nz--%s©r)©r1Úlnr r r Úoptparse_long_nameYó zParam.optparse_long_namecCr3r4r5r6r r r Úsynopsis_long_name`r9zParam.synopsis_long_namecCó*d}|jrd|j}|jdkr|d7}|S)Nú%sÚbooleanú=)r)rr6r r r Úgetopt_long_namegó   zParam.getopt_long_namecCr3©Nz-%s©r(©r1Úsnr r r Úoptparse_short_namepr9zParam.optparse_short_namecCr3rArBrCr r r Úsynopsis_short_namewr9zParam.synopsis_short_namecCr;)Nr<r=ú:)r(rrCr r r Úgetopt_short_name~r@zParam.getopt_short_namecstt|ƒ ||¡S)aB Convert a string value as received in the command line tools and convert to the appropriate type of value. Raise a ValidationError if the value can't be converted. :type value: str :param value: The value to convert. This should always be a string. )Úsuperr#r)r1r ©Ú __class__r r r‡s z Param.convert) Nr$TNNrNr%NNNT) rr r!r2Úpropertyr8r:r?rErFrHrÚ __classcell__r r rJr r#Fs& ý      r#)rÚobjectrr#r r r r Ús-