diff --git a/awips/TimeUtil.py b/awips/TimeUtil.py index adb58a2..67adde9 100644 --- a/awips/TimeUtil.py +++ b/awips/TimeUtil.py @@ -67,7 +67,7 @@ def determineDrtOffset(timeStr): # i.e. "truncate" cur_t to most recent hour. if synch: cur_t = time.mktime((gm[0], gm[1], gm[2], gm[3], 0, 0, 0, 0, 0)) - curStr = '%4s%2s%2s_%2s00\n' % (gm[0],gm[1],gm[2],gm[3]) + curStr = '%4s%2s%2s_%2s00\n' % (repr(gm[0]),repr(gm[1]),repr(gm[2]),repr(gm[3])) curStr = curStr.replace(' ','0') launchStr = timeStr + "," + curStr diff --git a/dynamicserialize/adapters/__init__.py b/dynamicserialize/adapters/__init__.py index d69ddf8..29cb8d4 100644 --- a/dynamicserialize/adapters/__init__.py +++ b/dynamicserialize/adapters/__init__.py @@ -34,19 +34,32 @@ # 01/09/2017 #5997 nabowle Allow contribution from plugins. # + __all__ = [ 'PointAdapter', 'StackTraceElementAdapter', + 'WsIdAdapter', 'CalendarAdapter', 'GregorianCalendarAdapter', + 'ActiveTableModeAdapter', 'DateAdapter', + 'FormattedDateAdapter', + 'LocalizationLevelSerializationAdapter', + 'LocalizationTypeSerializationAdapter', 'GeometryTypeAdapter', 'CoordAdapter', + 'TimeRangeTypeAdapter', + 'ParmIDAdapter', + 'DatabaseIDAdapter', 'TimestampAdapter', + 'CommutativeTimestampAdapter', 'EnumSetAdapter', 'FloatBufferAdapter', 'ByteBufferAdapter', - 'JTSEnvelopeAdapter' + 'TimeConstraintsAdapter', + 'LockTableAdapter', + 'JTSEnvelopeAdapter', + 'JobProgressAdapter' ] classAdapterRegistry = {} diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py index a28e35f..1c6f73e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py @@ -3,13 +3,22 @@ # File auto-generated against equivalent DynamicSerialize Java class -import os, pwd +import os + +try: + import pwd + pwd_error = False +except ImportError: + pwd_error = True class UserId(object): def __init__(self, id = None): if id is None: - self.id = pwd.getpwuid(os.getuid()).pw_name + if not pwd_error: + self.id = pwd.getpwuid(os.getuid()).pw_name + else: + self.id = "GenericUsername" else: self.id = id diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py index 1630c3f..f69c092 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py @@ -44,5 +44,5 @@ class ServerResponse(object): def __str__(self): return self.message() - def __nonzero__(self): - return self.isOkay() \ No newline at end of file + def __bool__(self): + return self.isOkay() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py index 752676b..97310df 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py @@ -66,7 +66,7 @@ class TimeRange(object): totalSecs = int(timeArg) micros = int((timeArg - totalSecs) * MICROS_IN_SECOND) return self.__convertSecsAndMicros(totalSecs, micros) - elif isinstance(timeArg, (int, int)): + elif isinstance(timeArg, int): # seconds as integer totalSecs = timeArg return self.__convertSecsAndMicros(totalSecs, 0)