From e3b4fc80601cd346ac2ee0c12c328553a44b34ac Mon Sep 17 00:00:00 2001 From: mjames-upc Date: Thu, 6 Sep 2018 20:14:11 -0600 Subject: [PATCH] Added JobProgressAdapter --- .../adapters/JobProgressAdapter.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dynamicserialize/adapters/JobProgressAdapter.py diff --git a/dynamicserialize/adapters/JobProgressAdapter.py b/dynamicserialize/adapters/JobProgressAdapter.py new file mode 100644 index 0000000..3df0ae1 --- /dev/null +++ b/dynamicserialize/adapters/JobProgressAdapter.py @@ -0,0 +1,34 @@ +## +## + + +# +# Adapter for com.raytheon.uf.common.dataplugin.gfe.svcbu.JobProgress +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/22/2015 4573 randerso Initial creation +# +# +# + +from thrift.Thrift import TType +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.svcbu import JobProgress + +ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.svcbu.JobProgress' + +def serialize(context, mode): + context.protocol.writeFieldBegin('__enumValue__', TType.STRING, 0) + context.writeString(mode.value) + +def deserialize(context): + result = JobProgress() + # Read the TType.STRING, "__enumValue__", and id. + # We're not interested in any of those, so just discard them. + context.protocol.readFieldBegin() + # now get the actual enum value + result.value = context.readString() + return result