o .&a @sHdZddlmZddlmZddZddZdd Zd d Zd d Z dS)aAChange the scalar response parsing behavior for the AWS CLI. The underlying library used by botocore has some response parsing behavior that we'd like to modify in the AWS CLI. There are two: * Parsing binary content. * Parsing timestamps (dates) For the first option we can't print binary content to the terminal, so this customization leaves the binary content base64 encoded. If the user wants the binary content, they can then base64 decode the appropriate fields as needed. There's nothing currently done for timestamps, but this will change in the future. )parse_timestamp)ProfileNotFoundcCs|dtdS)Nzsession-initialized)register_firstadd_scalar_parsers)event_handlersrC/usr/lib/python3/dist-packages/awscli/customizations/scalarparse.pyregister_scalar_parser"sr cCs|SNr)xrrridentity'sr cCs t|Sr )r isoformat)valuerrr iso_format+s rcCsn|d}z |dd}Wn tyd}Ynw|dkr"t}n |dkr)t}ntd||j|ddS)Nresponse_parser_factorycli_timestamp_formatnoneiso8601zLUnknown cli_timestamp_format value: %s, valid values are "none" or "iso8601")timestamp_parser) get_componentget_scoped_configgetrr r ValueErrorset_parser_defaults)sessionfactorytimestamp_formatrrrradd_timestamp_parser/s"   rcKs"|d}|jtdt|dS)Nr) blob_parser)rrr r)rkwargsrrrrrLs   rN) __doc__botocore.utilsrbotocore.exceptionsrr r rrrrrrrs