python-awips/dynamicserialize/adapters/__init__.py

89 lines
3 KiB
Python
Raw Permalink Normal View History

2015-06-18 10:25:33 -06:00
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
2017-01-06 12:00:14 -07:00
#
2015-06-18 10:25:33 -06:00
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
2017-01-06 12:00:14 -07:00
#
2015-06-18 10:25:33 -06:00
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
2017-01-06 12:00:14 -07:00
#
2015-06-18 10:25:33 -06:00
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
#
# __init__.py for Dynamic Serialize adapters.
2017-01-06 12:00:14 -07:00
#
#
2015-06-18 10:25:33 -06:00
# SOFTWARE HISTORY
2017-01-06 12:00:14 -07:00
#
2015-06-18 10:25:33 -06:00
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 08/31/10 njensen Initial Creation.
# 03/20/13 #1774 randerso Added TimeConstraintsAdapter
# 04/22/13 #1949 rjpeter Added LockTableAdapter
# 02/06/14 #2672 bsteffen Added JTSEnvelopeAdapter
# 06/22/2015 #4573 randerso Added JobProgressAdapter
# 09/21/2015 #4486 rjpeter Added FormattedDateAdapter
2017-01-06 12:00:14 -07:00
# 06/23/2016 #5696 rjpeter Added CommutativeTimestampAdapter
2015-06-18 10:25:33 -06:00
#
__all__ = [
'PointAdapter',
'StackTraceElementAdapter',
'WsIdAdapter',
'CalendarAdapter',
'GregorianCalendarAdapter',
'ActiveTableModeAdapter',
'DateAdapter',
'FormattedDateAdapter',
2015-06-18 10:25:33 -06:00
'LocalizationLevelSerializationAdapter',
'LocalizationTypeSerializationAdapter',
'GeometryTypeAdapter',
'CoordAdapter',
'TimeRangeTypeAdapter',
'ParmIDAdapter',
'DatabaseIDAdapter',
'TimestampAdapter',
2017-01-06 12:00:14 -07:00
'CommutativeTimestampAdapter',
2015-06-18 10:25:33 -06:00
'EnumSetAdapter',
'FloatBufferAdapter',
'ByteBufferAdapter',
'TimeConstraintsAdapter',
'LockTableAdapter',
'JTSEnvelopeAdapter',
'JobProgressAdapter',
2015-06-18 10:25:33 -06:00
]
2017-01-06 12:00:14 -07:00
2015-06-18 10:25:33 -06:00
classAdapterRegistry = {}
2017-01-06 12:00:14 -07:00
2015-06-18 10:25:33 -06:00
def getAdapterRegistry():
2017-01-06 12:00:14 -07:00
import sys
2015-06-18 10:25:33 -06:00
for x in __all__:
exec 'import ' + x
m = sys.modules['dynamicserialize.adapters.' + x]
d = m.__dict__
if d.has_key('ClassAdapter'):
if isinstance(m.ClassAdapter, list):
for clz in m.ClassAdapter:
classAdapterRegistry[clz] = m
else:
clzName = m.ClassAdapter
classAdapterRegistry[clzName] = m
else:
raise LookupError('Adapter class ' + x + ' has no ClassAdapter field ' + \
'and cannot be registered.')
2017-01-06 12:00:14 -07:00
2015-06-18 10:25:33 -06:00
getAdapterRegistry()