ó ByòYc@s€ddlZddlZddlZddlmZejeƒZejeƒe e_ ej ej ƒddd„ƒYZ dS(iÿÿÿÿN(tlocal_cloudwatch_handlertGreengrassMessagecBs;eZdZdd„Zed„ƒZd„Zd„ZRS(sŸ Holds the payload and extension_map fields making up messages exchanged over the IPC. Provides methods for encoding and decoding to/from strings. tcKs||_||_dS(N(tpayloadt extension_map(tselfRR((sš/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrass_common/greengrass_message.pyt__init__s cCsð|r×ytj|ƒ}WnJttfk re}tj|ƒtdjt|ƒt|ƒƒƒ‚nXyt j |dƒ}WnJttfk rÉ}tj|ƒtdjt|ƒt|ƒƒƒ‚nX|d}n d}i}|||S(NsHCould not load provided encoded string "{}" as JSON due to exception: {}tPayloadsXCould not decode payload of Greengrass Message data"{}" from base64 due to exception: {}t ExtensionMap_( tjsontloadst ValueErrort TypeErrortruntime_loggert exceptiontformattreprtstrtbase64t b64decodetNone(tclstencoded_stringtdata_mapteRR((sš/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrass_common/greengrass_message.pytdecodes$    cCsßytj|jƒjƒ}WnMttfk rk}tj|ƒtdjt |jƒt |ƒƒƒ‚nXy"t j i|d6|j d6ƒSWnJttfk rÚ}tj|ƒtdjt |ƒt |ƒƒƒ‚nXdS(NsOCould not encode Greengrass Message payload "{}" as base64 due to exception: {}RRsLCould not encode Greengrass Message fields "{}" as JSON due to exception: {}(Rt b64encodeRRR R R RRRRR tdumpsR(RRR((sš/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrass_common/greengrass_message.pytencode9s  ""  cCsti|jd6|jd6ƒS(NRR(RRR(R((sš/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrass_common/greengrass_message.pyt__str__Ks(t__name__t __module__t__doc__Rt classmethodRRR(((sš/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrass_common/greengrass_message.pyRs   ((RR tloggingt%greengrass_common.common_log_appenderRt getLoggerRR t addHandlertFalset propagatetsetLeveltDEBUGR(((sš/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrass_common/greengrass_message.pyts