mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
Added JobProgressAdapter
This commit is contained in:
parent
b66bd7af3e
commit
e3b4fc8060
1 changed files with 34 additions and 0 deletions
34
dynamicserialize/adapters/JobProgressAdapter.py
Normal file
34
dynamicserialize/adapters/JobProgressAdapter.py
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue