From 1b68f8800c067542bc3e5295eeead5723f411337 Mon Sep 17 00:00:00 2001 From: Michael James Date: Tue, 16 Oct 2018 21:33:43 -0600 Subject: [PATCH] PEP 8 coding standards --- awips/DateTimeConverter.py | 2 + awips/QpidSubscriber.py | 12 +- awips/RadarCommon.py | 6 +- awips/ThriftClient.py | 23 ++- awips/TimeUtil.py | 7 +- awips/UsageArgumentParser.py | 9 +- awips/dataaccess/CombinedTimeQuery.py | 10 +- awips/dataaccess/DataAccessLayer.py | 45 +++--- awips/dataaccess/DataNotificationLayer.py | 4 +- awips/dataaccess/DataQueue.py | 5 +- awips/dataaccess/ModelSounding.py | 8 +- awips/dataaccess/PyGridData.py | 3 +- awips/dataaccess/PyGridNotification.py | 2 +- awips/dataaccess/ThriftClientRouter.py | 3 +- awips/gfe/IFPClient.py | 2 +- awips/qpidingest.py | 23 +-- awips/test/dafTests/baseDafTestCase.py | 26 +--- awips/test/dafTests/testCombinedTimeQuery.py | 8 +- awips/test/dafTests/testGfe.py | 9 +- awips/test/dafTests/testGrid.py | 4 +- awips/test/dafTests/testModelSounding.py | 12 +- awips/test/dafTests/testRadarSpatial.py | 1 + awips/test/dafTests/testTopo.py | 1 - .../SelfDescribingBinaryProtocol.py | 135 +++++++++--------- .../ThriftSerializationContext.py | 6 +- .../adapters/GeomDataRespAdapter.py | 2 +- .../adapters/TimeRangeTypeAdapter.py | 2 +- dynamicserialize/adapters/__init__.py | 2 +- dynamicserialize/dstypes/com/__init__.py | 2 - .../dstypes/com/raytheon/__init__.py | 2 - .../dstypes/com/raytheon/uf/__init__.py | 2 - .../com/raytheon/uf/common/__init__.py | 2 - .../uf/common/alertviz/AlertVizRequest.py | 11 +- .../com/raytheon/uf/common/auth/__init__.py | 2 - .../auth/resp/AbstractFailedResponse.py | 1 - .../auth/resp/AuthServerErrorResponse.py | 6 +- .../common/auth/resp/SuccessfulExecution.py | 1 - .../raytheon/uf/common/auth/resp/__init__.py | 1 - .../com/raytheon/uf/common/auth/user/User.py | 1 - .../raytheon/uf/common/auth/user/UserId.py | 2 +- .../raytheon/uf/common/dataaccess/__init__.py | 2 - .../dataaccess/impl/DefaultDataRequest.py | 2 +- .../GetAvailableLocationNamesRequest.py | 1 - .../request/GetGeometryDataRequest.py | 1 - .../dataaccess/request/GetGridDataRequest.py | 2 +- .../request/GetOptionalIdentifiersRequest.py | 1 - .../request/GetSupportedDatatypesRequest.py | 1 - .../response/GetGeometryDataResponse.py | 1 - .../response/GetGridDataResponse.py | 1 - .../response/GetGridLatLonResponse.py | 1 - .../raytheon/uf/common/dataplugin/__init__.py | 2 - .../uf/common/dataplugin/events/__init__.py | 2 - .../dataplugin/events/hazards/__init__.py | 2 - .../hazards/requests/RegionLookupRequest.py | 1 - .../events/hazards/requests/__init__.py | 1 - .../common/dataplugin/gfe/GridDataHistory.py | 1 - .../uf/common/dataplugin/gfe/__init__.py | 2 - .../dataplugin/gfe/config/ProjectionData.py | 1 - .../common/dataplugin/gfe/config/__init__.py | 1 - .../uf/common/dataplugin/gfe/db/__init__.py | 2 - .../dataplugin/gfe/db/objects/DatabaseID.py | 14 +- .../dataplugin/gfe/db/objects/GFERecord.py | 1 - .../dataplugin/gfe/db/objects/GridLocation.py | 10 +- .../dataplugin/gfe/db/objects/GridParmInfo.py | 11 +- .../dataplugin/gfe/db/objects/ParmID.py | 8 +- .../gfe/db/objects/TimeConstraints.py | 6 +- .../dataplugin/gfe/db/objects/__init__.py | 1 - .../dataplugin/gfe/discrete/DiscreteKey.py | 7 +- .../dataplugin/gfe/discrete/__init__.py | 1 - .../common/dataplugin/gfe/grid/Grid2DByte.py | 5 +- .../common/dataplugin/gfe/grid/Grid2DFloat.py | 4 +- .../uf/common/dataplugin/gfe/grid/__init__.py | 1 - .../gfe/request/CommitGridsRequest.py | 1 - .../request/ConfigureTextProductsRequest.py | 1 - .../gfe/request/ExportGridsRequest.py | 2 +- .../gfe/request/GetASCIIGridsRequest.py | 1 - .../gfe/request/GetGridDataRequest.py | 3 +- .../gfe/request/GetGridInventoryRequest.py | 1 - .../gfe/request/GetLockTablesRequest.py | 1 - .../gfe/request/GetOfficialDbNameRequest.py | 1 - .../gfe/request/GetParmListRequest.py | 1 - .../gfe/request/GetSelectTimeRangeRequest.py | 1 - .../gfe/request/GetSingletonDbIdsRequest.py | 1 - .../gfe/request/GetSiteTimeZoneInfoRequest.py | 1 - .../dataplugin/gfe/request/GridLocRequest.py | 1 - .../gfe/request/LockChangeRequest.py | 1 - .../gfe/request/SaveASCIIGridsRequest.py | 1 - .../gfe/request/SmartInitRequest.py | 1 - .../common/dataplugin/gfe/request/__init__.py | 1 - .../common/dataplugin/gfe/server/__init__.py | 2 - .../common/dataplugin/gfe/server/lock/Lock.py | 1 - .../dataplugin/gfe/server/lock/LockTable.py | 1 - .../dataplugin/gfe/server/lock/__init__.py | 1 - .../gfe/server/message/ServerMsg.py | 1 - .../gfe/server/message/ServerResponse.py | 4 +- .../dataplugin/gfe/server/message/__init__.py | 1 - .../server/notify/DBInvChangeNotification.py | 1 - .../gfe/server/notify/GfeNotification.py | 1 - .../notify/GridHistoryUpdateNotification.py | 1 - .../server/notify/GridUpdateNotification.py | 1 - .../gfe/server/notify/LockNotification.py | 1 - .../server/notify/UserMessageNotification.py | 1 - .../dataplugin/gfe/server/notify/__init__.py | 1 - .../gfe/server/request/CommitGridRequest.py | 1 - .../gfe/server/request/GetGridRequest.py | 1 - .../gfe/server/request/LockRequest.py | 1 - .../gfe/server/request/LockTableRequest.py | 1 - .../dataplugin/gfe/server/request/__init__.py | 1 - .../dataplugin/gfe/slice/DiscreteGridSlice.py | 2 +- .../dataplugin/gfe/slice/VectorGridSlice.py | 2 +- .../common/dataplugin/gfe/slice/__init__.py | 1 - .../dataplugin/gfe/weather/WeatherKey.py | 4 +- .../dataplugin/gfe/weather/WeatherSubKey.py | 2 +- .../common/dataplugin/gfe/weather/__init__.py | 1 - .../uf/common/dataplugin/grid/__init__.py | 2 - .../grid/request/DeleteAllGridDataRequest.py | 1 - .../dataplugin/grid/request/__init__.py | 1 - .../uf/common/dataplugin/level/MasterLevel.py | 1 - .../uf/common/dataplugin/level/__init__.py | 1 - .../message/DataURINotificationMessage.py | 1 - .../uf/common/dataplugin/message/__init__.py | 1 - .../uf/common/dataplugin/radar/__init__.py | 2 - .../request/GetRadarDataRecordRequest.py | 1 - .../dataplugin/radar/request/__init__.py | 1 - .../response/GetRadarDataRecordResponse.py | 1 - .../radar/response/RadarDataRecord.py | 1 - .../dataplugin/radar/response/__init__.py | 1 - .../uf/common/dataplugin/text/__init__.py | 2 - .../dataplugin/text/dbsrv/TextDBRequest.py | 1 - .../common/dataplugin/text/dbsrv/__init__.py | 1 - .../dataplugin/text/subscription/__init__.py | 2 - .../request/SubscriptionRequest.py | 1 - .../text/subscription/request/__init__.py | 1 - .../raytheon/uf/common/dataquery/__init__.py | 2 - .../dataquery/requests/RequestConstraint.py | 14 +- .../uf/common/dataquery/requests/__init__.py | 1 - .../raytheon/uf/common/datastorage/Request.py | 1 - .../common/datastorage/StorageProperties.py | 1 - .../uf/common/datastorage/StorageStatus.py | 1 - .../uf/common/datastorage/__init__.py | 1 - .../datastorage/records/ByteDataRecord.py | 1 - .../datastorage/records/StringDataRecord.py | 2 +- .../localization/LocalizationContext.py | 1 - .../common/localization/LocalizationLevel.py | 28 +--- .../common/localization/LocalizationType.py | 1 - .../uf/common/localization/__init__.py | 1 - .../localization/msgs/DeleteUtilityCommand.py | 1 - .../localization/msgs/ListResponseEntry.py | 1 - .../localization/msgs/ListUtilityCommand.py | 1 - .../msgs/PrivilegedUtilityRequestMessage.py | 1 - .../msgs/UtilityRequestMessage.py | 1 - .../msgs/UtilityResponseMessage.py | 1 - .../uf/common/localization/msgs/__init__.py | 1 - .../AbstractLocalizationStreamRequest.py | 1 - .../stream/LocalizationStreamGetRequest.py | 1 - .../stream/LocalizationStreamPutRequest.py | 1 - .../uf/common/localization/stream/__init__.py | 1 - .../raytheon/uf/common/management/__init__.py | 2 - .../request/ChangeContextRequest.py | 1 - .../management/request/PassThroughRequest.py | 1 - .../uf/common/management/request/__init__.py | 1 - .../request/diagnostic/GetContextsRequest.py | 1 - .../management/request/diagnostic/__init__.py | 1 - .../uf/common/management/response/__init__.py | 2 - .../diagnostic/ClusterMembersResponse.py | 1 - .../response/diagnostic/ContextsResponse.py | 1 - .../response/diagnostic/StatusResponse.py | 1 - .../response/diagnostic/__init__.py | 1 - .../com/raytheon/uf/common/message/Body.py | 1 - .../com/raytheon/uf/common/message/Header.py | 1 - .../com/raytheon/uf/common/message/Message.py | 1 - .../raytheon/uf/common/message/Property.py | 1 - .../com/raytheon/uf/common/message/WsId.py | 9 +- .../raytheon/uf/common/pointdata/__init__.py | 2 - .../requests/NewAdaptivePlotRequest.py | 1 - .../uf/common/pointdata/requests/__init__.py | 1 - .../raytheon/uf/common/pypies/PointTest.py | 1 - .../com/raytheon/uf/common/pypies/__init__.py | 1 - .../pypies/request/CreateDatasetRequest.py | 1 - .../pypies/request/DatasetDataRequest.py | 1 - .../pypies/request/DatasetNamesRequest.py | 1 - .../pypies/request/DeleteFilesRequest.py | 1 - .../pypies/request/DeleteOrphansRequest.py | 1 - .../uf/common/pypies/request/DeleteRequest.py | 1 - .../uf/common/pypies/request/GroupsRequest.py | 1 - .../common/pypies/request/RetrieveRequest.py | 1 - .../uf/common/pypies/request/StoreRequest.py | 1 - .../common/pypies/response/DeleteResponse.py | 1 - .../common/pypies/response/ErrorResponse.py | 1 - .../pypies/response/RetrieveResponse.py | 1 - .../common/pypies/response/StoreResponse.py | 1 - .../SerializableExceptionWrapper.py | 1 - .../uf/common/serialization/__init__.py | 12 -- .../uf/common/serialization/comm/__init__.py | 11 -- .../comm/response/ServerErrorResponse.py | 1 - .../com/raytheon/uf/common/site/__init__.py | 2 - .../uf/common/site/notify/__init__.py | 1 - .../site/requests/GetActiveSitesRequest.py | 1 - .../site/requests/GetPrimarySiteRequest.py | 1 - .../site/requests/ValidateConfigRequest.py | 1 - .../uf/common/site/requests/__init__.py | 1 - .../uf/common/time/CommutativeTimestamp.py | 1 - .../com/raytheon/uf/common/time/DataTime.py | 28 ++-- .../com/raytheon/uf/common/time/TimeRange.py | 13 +- .../com/raytheon/uf/common/time/__init__.py | 1 - .../dstypes/com/vividsolutions/__init__.py | 2 - .../com/vividsolutions/jts/__init__.py | 2 - .../com/vividsolutions/jts/geom/Coordinate.py | 1 - .../com/vividsolutions/jts/geom/Envelope.py | 1 - .../com/vividsolutions/jts/geom/Geometry.py | 1 - .../com/vividsolutions/jts/geom/__init__.py | 1 - .../gempak/request/GetGridDataRequest.py | 1 - .../gempak/request/GetGridInfoRequest.py | 1 - .../gempak/request/GetGridNavRequest.py | 1 - .../gempak/request/GetStationsRequest.py | 1 - .../gempak/request/GetTimesRequest.py | 1 - .../gempak/request/GetTimesResponse.py | 1 - .../dataplugin/gempak/request/Station.py | 1 - .../gempak/request/StationDataRequest.py | 1 - .../gempak/request/SurfaceDataRequest.py | 1 - .../gempak/request/UpperAirDataRequest.py | 1 - .../common/dataplugin/pgen/ActivityInfo.py | 1 - .../common/dataplugin/pgen/DerivedProduct.py | 1 - .../pgen/ResponseMessageValidate.py | 1 - .../request/RetrieveAllProductsRequest.py | 1 - .../pgen/request/StoreActivityRequest.py | 1 - .../request/StoreDerivedProductRequest.py | 1 - .../pgen/response/ActivityMapData.py | 1 - .../response/RetrieveActivityMapResponse.py | 1 - dynamicserialize/dstypes/java/awt/Point.py | 1 - .../dstypes/java/lang/StackTraceElement.py | 4 +- .../dstypes/java/sql/Timestamp.py | 3 +- .../dstypes/java/util/Calendar.py | 2 + setup.py | 6 +- 234 files changed, 272 insertions(+), 536 deletions(-) diff --git a/awips/DateTimeConverter.py b/awips/DateTimeConverter.py index 2446268..bab093b 100644 --- a/awips/DateTimeConverter.py +++ b/awips/DateTimeConverter.py @@ -56,6 +56,7 @@ def convertToDateTime(timeArg): objType = str(type(timeArg)) raise TypeError("Cannot convert object of type " + objType + " to datetime.") + def _convertSecsAndMicros(seconds, micros): if seconds < MAX_TIME: rval = datetime.datetime.utcfromtimestamp(seconds) @@ -64,6 +65,7 @@ def _convertSecsAndMicros(seconds, micros): rval = datetime.datetime.utcfromtimestamp(MAX_TIME) + extraTime return rval.replace(microsecond=micros) + def constructTimeRange(*args): """ Builds a python dynamicserialize TimeRange object from the given diff --git a/awips/QpidSubscriber.py b/awips/QpidSubscriber.py index bc33165..833511e 100644 --- a/awips/QpidSubscriber.py +++ b/awips/QpidSubscriber.py @@ -53,12 +53,13 @@ class QpidSubscriber: def topicSubscribe(self, topicName, callback): # if the queue is edex.alerts, set decompress to true always for now to # maintain compatibility with existing python scripts. - if (topicName == 'edex.alerts'): + if topicName == 'edex.alerts': self.decompress = True print("Establishing connection to broker on", self.host) queueName = topicName + self.__session.name - self.__session.queue_declare(queue=queueName, exclusive=True, auto_delete=True, arguments={'qpid.max_count':100, 'qpid.policy_type':'ring'}) + self.__session.queue_declare(queue=queueName, exclusive=True, auto_delete=True, + arguments={'qpid.max_count': 100, 'qpid.policy_type': 'ring'}) self.__session.exchange_bind(exchange='amq.topic', queue=queueName, binding_key=topicName) self.__innerSubscribe(queueName, callback) @@ -75,12 +76,12 @@ class QpidSubscriber: message = queue.get(timeout=10) content = message.body self.__session.message_accept(qpid.datatypes.RangedSet(message.id)) - if (self.decompress): + if self.decompress: try: # http://stackoverflow.com/questions/2423866/python-decompressing-gzip-chunk-by-chunk d = zlib.decompressobj(16+zlib.MAX_WBITS) content = d.decompress(content) - except Exception: + except ValueError: # decompression failed, return the original content pass callback(content) @@ -94,10 +95,9 @@ class QpidSubscriber: self.subscribed = False try: self.__session.close(timeout=10) - except Exception: + except ValueError: pass @property def queueStarted(self): return self.__queueStarted - diff --git a/awips/RadarCommon.py b/awips/RadarCommon.py index f41cace..af71a08 100644 --- a/awips/RadarCommon.py +++ b/awips/RadarCommon.py @@ -24,7 +24,7 @@ def get_datetime_str(record): Returns: datetime string. """ - return str(record.getDataTime())[0:19].replace(" ","_") + ".0" + return str(record.getDataTime())[0:19].replace(" ", "_") + ".0" def get_data_type(azdat): @@ -59,7 +59,7 @@ def get_hdf5_data(idra): elif idra[ii].getName() == "Thresholds": threshVals = idra[ii].getShortData() - return rdat,azdat,depVals,threshVals + return rdat, azdat, depVals, threshVals def get_header(record, headerFormat, xLen, yLen, azdat, description): @@ -90,7 +90,7 @@ def encode_thresh_vals(threshVals): nnn = len(threshVals) j = 0 msg = "" - while j 1): + if len(hostParts) > 1: hostString = hostParts[0] self.__uri = "/" + hostParts[1] self.__httpConn = httpcl.HTTPConnection(hostString) else: - if (port is None): + if port is None: self.__httpConn = httpcl.HTTPConnection(host) else: self.__httpConn = httpcl.HTTPConnection(host, port) @@ -53,7 +53,7 @@ class ThriftClient: self.__httpConn.request("POST", self.__uri + uri, message) response = self.__httpConn.getresponse() - if (response.status != 200): + if response.status != 200: raise ThriftRequestException("Unable to post request to server") rval = self.__dsm.deserializeBytes(response.read()) @@ -64,8 +64,8 @@ class ThriftClient: # with the original Java stack trace # ELSE: we have a valid response and pass it back try: - forceError = rval.getException() - raise ThriftRequestException(forceError) + forceError = rval.getException() + raise ThriftRequestException(forceError) except AttributeError: pass @@ -78,4 +78,3 @@ class ThriftRequestException(Exception): def __str__(self): return repr(self.parameter) - diff --git a/awips/TimeUtil.py b/awips/TimeUtil.py index 40c1e67..6543bea 100644 --- a/awips/TimeUtil.py +++ b/awips/TimeUtil.py @@ -49,7 +49,7 @@ import time def determineDrtOffset(timeStr): launchStr = timeStr # Check for time difference - if timeStr.find(",") >=0: + if timeStr.find(",") >= 0: times = timeStr.split(",") t1 = makeTime(times[0]) t2 = makeTime(times[1]) @@ -67,8 +67,9 @@ 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' % (repr(gm[0]),repr(gm[1]),repr(gm[2]),repr(gm[3])) - curStr = curStr.replace(' ','0') + 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 offset = drt_t - cur_t diff --git a/awips/UsageArgumentParser.py b/awips/UsageArgumentParser.py index 4268a5b..66823fc 100644 --- a/awips/UsageArgumentParser.py +++ b/awips/UsageArgumentParser.py @@ -27,7 +27,7 @@ class UsageArgumentParser(argparse.ArgumentParser): sys.exit(2) -## Custom actions for ArgumentParser objects ## +# Custom actions for ArgumentParser objects class StoreDatabaseIDAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): did = DatabaseID(values) @@ -41,8 +41,7 @@ class AppendParmNameAndLevelAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): tx = ParmID.parmNameAndLevel(values) comp = tx[0] + '_' + tx[1] - if (hasattr(namespace, self.dest)) and \ - (getattr(namespace, self.dest) is not None): + if (hasattr(namespace, self.dest)) and (getattr(namespace, self.dest) is not None): currentValues = getattr(namespace, self.dest) currentValues.append(comp) setattr(namespace, self.dest, currentValues) @@ -58,8 +57,6 @@ class StoreTimeAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): try: timeStruct = time.strptime(values, TIME_FORMAT) + setattr(namespace, self.dest, timeStruct) except ValueError: parser.error(str(values) + " is not a valid time string of the format YYYYMMDD_hhmm") - - setattr(namespace, self.dest, timeStruct) - diff --git a/awips/dataaccess/CombinedTimeQuery.py b/awips/dataaccess/CombinedTimeQuery.py index e74dfe3..06651ee 100644 --- a/awips/dataaccess/CombinedTimeQuery.py +++ b/awips/dataaccess/CombinedTimeQuery.py @@ -76,9 +76,9 @@ def __getAvailableTimesForEachLocation(request, refTimeOnly=False): def __cloneRequest(request): - return DataAccessLayer.newDataRequest(datatype = request.getDatatype(), - parameters = request.getParameters(), - levels = request.getLevels(), - locationNames = request.getLocationNames(), - envelope = request.getEnvelope(), + return DataAccessLayer.newDataRequest(datatype=request.getDatatype(), + parameters=request.getParameters(), + levels=request.getLevels(), + locationNames=request.getLocationNames(), + envelope=request.getEnvelope(), **request.getIdentifiers()) diff --git a/awips/dataaccess/DataAccessLayer.py b/awips/dataaccess/DataAccessLayer.py index 5e7e210..95f9599 100644 --- a/awips/dataaccess/DataAccessLayer.py +++ b/awips/dataaccess/DataAccessLayer.py @@ -4,24 +4,21 @@ # # SOFTWARE HISTORY # -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# 12/10/12 njensen Initial Creation. -# Feb 14, 2013 1614 bsteffen refactor data access framework -# to use single request. -# 04/10/13 1871 mnash move getLatLonCoords to JGridData and add default args -# 05/29/13 2023 dgilling Hook up ThriftClientRouter. -# 03/03/14 2673 bsteffen Add ability to query only ref times. -# 07/22/14 3185 njensen Added optional/default args to newDataRequest -# 07/30/14 3185 njensen Renamed valid identifiers to optional -# Apr 26, 2015 4259 njensen Updated for new JEP API -# Apr 13, 2016 5379 tgurney Add getIdentifierValues() -# Jun 01, 2016 5587 tgurney Add new signatures for -# getRequiredIdentifiers() and -# getOptionalIdentifiers() -# Oct 07, 2016 ---- mjames@ucar Added getForecastRun -# Oct 18, 2016 5916 bsteffen Add setLazyLoadGridLatLon -# Oct 11, 2018 mjames@ucar Added getMetarObs() getSynopticObs() +# Date Ticket# Engineer Description +# ------------ ------- ---------- ------------------------- +# 12/10/12 njensen Initial Creation. +# Feb 14, 2013 1614 bsteffen refactor data access framework to use single request. +# 04/10/13 1871 mnash move getLatLonCoords to JGridData and add default args +# 05/29/13 2023 dgilling Hook up ThriftClientRouter. +# 03/03/14 2673 bsteffen Add ability to query only ref times. +# 07/22/14 3185 njensen Added optional/default args to newDataRequest +# 07/30/14 3185 njensen Renamed valid identifiers to optional +# Apr 26, 2015 4259 njensen Updated for new JEP API +# Apr 13, 2016 5379 tgurney Add getIdentifierValues(), getRequiredIdentifiers(), +# and getOptionalIdentifiers() +# Oct 07, 2016 ---- mjames@ucar Added getForecastRun +# Oct 18, 2016 5916 bsteffen Add setLazyLoadGridLatLon +# Oct 11, 2018 ---- mjames@ucar Added getMetarObs() getSynopticObs() # import sys @@ -145,6 +142,7 @@ def getForecastRun(cycle, times): fcstRun.append(t) return fcstRun + def getAvailableTimes(request, refTimeOnly=False): """ Get the times of available data to the request. @@ -152,7 +150,7 @@ def getAvailableTimes(request, refTimeOnly=False): Args: request: the IDataRequest to get data for refTimeOnly: optional, use True if only unique refTimes should be - returned (without a forecastHr) + returned (without a forecastHr) Returns: a list of DataTimes @@ -169,7 +167,7 @@ def getGridData(request, times=[]): Args: request: the IDataRequest to get data for times: a list of DataTimes, a TimeRange, or None if the data is time - agnostic + agnostic Returns: a list of IGridData @@ -186,7 +184,7 @@ def getGeometryData(request, times=[]): Args: request: the IDataRequest to get data for times: a list of DataTimes, a TimeRange, or None if the data is time - agnostic + agnostic Returns: a list of IGeometryData @@ -282,6 +280,7 @@ def getIdentifierValues(request, identifierKey): """ return router.getIdentifierValues(request, identifierKey) + def newDataRequest(datatype=None, **kwargs): """ Creates a new instance of IDataRequest suitable for the runtime environment. @@ -300,6 +299,7 @@ def newDataRequest(datatype=None, **kwargs): """ return router.newDataRequest(datatype, **kwargs) + def getSupportedDatatypes(): """ Gets the datatypes that are supported by the framework @@ -317,7 +317,7 @@ def changeEDEXHost(newHostName): method will throw a TypeError. Args: - newHostHame: the EDEX host to connect to + newHostName: the EDEX host to connect to """ if USING_NATIVE_THRIFT: global THRIFT_HOST @@ -327,6 +327,7 @@ def changeEDEXHost(newHostName): else: raise TypeError("Cannot call changeEDEXHost when using JepRouter.") + def setLazyLoadGridLatLon(lazyLoadGridLatLon): """ Provide a hint to the Data Access Framework indicating whether to load the diff --git a/awips/dataaccess/DataNotificationLayer.py b/awips/dataaccess/DataNotificationLayer.py index fc2ccc8..d1297fd 100644 --- a/awips/dataaccess/DataNotificationLayer.py +++ b/awips/dataaccess/DataNotificationLayer.py @@ -56,7 +56,7 @@ THRIFT_HOST = "edex" USING_NATIVE_THRIFT = False -JMS_HOST_PATTERN=re.compile('tcp://([^:]+):([0-9]+)') +JMS_HOST_PATTERN = re.compile('tcp://([^:]+):([0-9]+)') if 'jep' in sys.modules: # intentionally do not catch if this fails to import, we want it to @@ -124,7 +124,7 @@ def changeEDEXHost(newHostName): method will throw a TypeError. Args: - newHostHame: the EDEX host to connect to + newHostName: the EDEX host to connect to """ if USING_NATIVE_THRIFT: global THRIFT_HOST diff --git a/awips/dataaccess/DataQueue.py b/awips/dataaccess/DataQueue.py index e23c5f5..2ea2d71 100644 --- a/awips/dataaccess/DataQueue.py +++ b/awips/dataaccess/DataQueue.py @@ -22,18 +22,15 @@ import sys if sys.version_info.major == 2: from Queue import Queue, Empty -else: # Python 3 module renamed to 'queue' +else: # Python 3 module renamed to 'queue' from queue import Queue, Empty - # Used to indicate a DataQueue that will produce geometry data. GEOMETRY = object() - # Used to indicate a DataQueue that will produce grid data. GRID = object() - # Default maximum queue size. _DEFAULT_MAXSIZE = 100 diff --git a/awips/dataaccess/ModelSounding.py b/awips/dataaccess/ModelSounding.py index 0b8cb29..3c5904f 100644 --- a/awips/dataaccess/ModelSounding.py +++ b/awips/dataaccess/ModelSounding.py @@ -39,12 +39,8 @@ def getSounding(modelName, weatherElements, levels, samplePoint, timeRange=None) (locationNames, parameters, levels, envelope, timeRange) = \ __sanitizeInputs(modelName, weatherElements, levels, samplePoint, timeRange) - requestArgs = { 'datatype' : 'grid', - 'locationNames' : locationNames, - 'parameters' : parameters, - 'levels' : levels, - 'envelope' : envelope - } + requestArgs = {'datatype': 'grid', 'locationNames': locationNames, + 'parameters': parameters, 'levels': levels, 'envelope': envelope} req = DataAccessLayer.newDataRequest(**requestArgs) response = DataAccessLayer.getGeometryData(req, timeRange) diff --git a/awips/dataaccess/PyGridData.py b/awips/dataaccess/PyGridData.py index bc4bbbb..4dece5b 100644 --- a/awips/dataaccess/PyGridData.py +++ b/awips/dataaccess/PyGridData.py @@ -28,7 +28,7 @@ The ability to unit convert grid data is not currently available in this version class PyGridData(IGridData, PyData.PyData): - def __init__(self, gridDataRecord, nx, ny, latLonGrid = None, latLonDelegate = None): + def __init__(self, gridDataRecord, nx, ny, latLonGrid=None, latLonDelegate=None): PyData.PyData.__init__(self, gridDataRecord) nx = nx ny = ny @@ -38,7 +38,6 @@ class PyGridData(IGridData, PyData.PyData): self.__latLonGrid = latLonGrid self.__latLonDelegate = latLonDelegate - def getParameter(self): return self.__parameter diff --git a/awips/dataaccess/PyGridNotification.py b/awips/dataaccess/PyGridNotification.py index 27b013a..340fb65 100644 --- a/awips/dataaccess/PyGridNotification.py +++ b/awips/dataaccess/PyGridNotification.py @@ -33,7 +33,7 @@ class PyGridNotification(PyNotification): newReq.setParameters(self.request.getParameters()) data = self.getData(newReq, []) self.callback(data) - except Exception: + except ValueError: traceback.print_exc() def getData(self, request, dataTimes): diff --git a/awips/dataaccess/ThriftClientRouter.py b/awips/dataaccess/ThriftClientRouter.py index f74b348..7637bc8 100644 --- a/awips/dataaccess/ThriftClientRouter.py +++ b/awips/dataaccess/ThriftClientRouter.py @@ -224,7 +224,8 @@ class ThriftClientRouter(object): return [x.decode('utf-8') for x in response] return response - def newDataRequest(self, datatype, parameters=[], levels=[], locationNames=[], envelope=None, **kwargs): + def newDataRequest(self, datatype, parameters=[], levels=[], locationNames=[], + envelope=None, **kwargs): req = DefaultDataRequest() if datatype: req.setDatatype(datatype) diff --git a/awips/gfe/IFPClient.py b/awips/gfe/IFPClient.py index 766d223..6fbc1e6 100644 --- a/awips/gfe/IFPClient.py +++ b/awips/gfe/IFPClient.py @@ -91,7 +91,7 @@ class IFPClient(object): sr.setPayload(inventoryList) return sr elif self.__isHomogenousIterable(parmID, ParmID): - return self.__getGridInventory([id for id in parmID]) + return self.__getGridInventory([pid for pid in parmID]) raise TypeError("Invalid type: " + str(type(parmID)) + " specified to getGridInventory(). Accepts ParmID or lists of ParmID.") diff --git a/awips/qpidingest.py b/awips/qpidingest.py index 615ca10..bb5e07a 100644 --- a/awips/qpidingest.py +++ b/awips/qpidingest.py @@ -77,12 +77,13 @@ QPID_PASSWORD = 'guest' class IngestViaQPID: def __init__(self, host='localhost', port=5672, ssl=None): - ''' + """ Connect to QPID and make bindings to route message to external.dropbox queue @param host: string hostname of computer running EDEX and QPID (default localhost) @param port: integer port used to connect to QPID (default 5672) - @param ssl: boolean to determine whether ssl is used, default value of None will use ssl only if a client certificate is found. - ''' + @param ssl: boolean to determine whether ssl is used, default value of None will use + ssl only if a client certificate is found. + """ try: # @@ -100,31 +101,31 @@ class IngestViaQPID: keyfile = os.path.join(certdb, certname + ".key") trustfile = os.path.join(certdb, "root.crt") socket = qpid.util.ssl(socket, keyfile=keyfile, certfile=certfile, ca_certs=trustfile) - self.connection = Connection (sock=socket, username=QPID_USERNAME, password=QPID_PASSWORD) + self.connection = Connection(sock=socket, username=QPID_USERNAME, password=QPID_PASSWORD) self.connection.start() self.session = self.connection.session(str(uuid4())) self.session.exchange_bind(exchange='amq.direct', queue='external.dropbox', binding_key='external.dropbox') print('Connected to Qpid') - except: + except ValueError: print('Unable to connect to Qpid') def sendmessage(self, filepath, header): - ''' + """ This function sends a message to the external.dropbox queue providing the path to the file to be ingested and a header to determine the plugin to be used to decode the file. @param filepath: string full path to file to be ingested @param header: string header used to determine plugin decoder to use - ''' + """ props = self.session.delivery_properties(routing_key='external.dropbox') - head = self.session.message_properties(application_headers={'header':header}, - user_id=QPID_USERNAME) # For issue QPID-5569. Fixed in Qpid 0.27 + head = self.session.message_properties(application_headers={'header': header}, + user_id=QPID_USERNAME) self.session.message_transfer(destination='amq.direct', message=Message(props, head, filepath)) def close(self): - ''' + """ After all messages are sent call this function to close connection and make sure there are no threads left open - ''' + """ self.session.close(timeout=10) print('Connection to Qpid closed') diff --git a/awips/test/dafTests/baseDafTestCase.py b/awips/test/dafTests/baseDafTestCase.py index 0a78fff..ab0fb38 100644 --- a/awips/test/dafTests/baseDafTestCase.py +++ b/awips/test/dafTests/baseDafTestCase.py @@ -89,11 +89,11 @@ class DafTestCase(unittest.TestCase): print("Optional identifiers:", optional) def runGetIdValuesTest(self, identifiers): - for id in identifiers: - if id.lower() == 'datauri': + for identifier in identifiers: + if identifier.lower() == 'datauri': continue req = DAL.newDataRequest(self.datatype) - idValues = DAL.getIdentifierValues(req, id) + idValues = DAL.getIdentifierValues(req, identifier) self.assertTrue(hasattr(idValues, '__iter__')) def runInvalidIdValuesTest(self): @@ -145,20 +145,9 @@ class DafTestCase(unittest.TestCase): times = DafTestCase.getTimesIfSupported(req) geomData = DAL.getGeometryData(req, times[:self.numTimesToLimit]) self.assertIsNotNone(geomData) - #if times: - # self.assertNotEqual(len(geomData), 0) if not geomData: raise unittest.SkipTest("No data available") print("Number of geometry records: " + str(len(geomData))) - #print("Sample geometry data:") - #for record in geomData[:self.sampleDataLimit]: - # if (checkDataTimes and times and - # "PERIOD_USED" not in record.getDataTime().getUtilityFlags()): - # self.assertIn(record.getDataTime(), times[:self.numTimesToLimit]) - # #print("geometry=" + str(record.getGeometry()), end="") - # for p in req.getParameters(): - # print(" " + p + "=" + str(record.getString(p)), end="") - # print() return geomData def runGeometryDataTestWithTimeRange(self, req, timeRange): @@ -171,14 +160,6 @@ class DafTestCase(unittest.TestCase): if not geomData: raise unittest.SkipTest("No data available") print("Number of geometry records: " + str(len(geomData))) - #print("Sample geometry data:") - #for record in geomData[:self.sampleDataLimit]: - # self.assertGreaterEqual(record.getDataTime().getRefTime().getTime(), timeRange.getStartInMillis()) - # self.assertLessEqual(record.getDataTime().getRefTime().getTime(), timeRange.getEndInMillis()) - # print("geometry=" + str(record.getGeometry()), end="") - # for p in req.getParameters(): - # print(" " + p + "=" + record.getString(p), end="") - # print() return geomData def runGridDataTest(self, req, testSameShape=True): @@ -187,6 +168,7 @@ class DafTestCase(unittest.TestCase): request. Args: + req: the grid request testSameShape: whether or not to verify that all the retrieved data have the same shape (most data don't change shape) """ diff --git a/awips/test/dafTests/testCombinedTimeQuery.py b/awips/test/dafTests/testCombinedTimeQuery.py index 8526c9c..08222c8 100644 --- a/awips/test/dafTests/testCombinedTimeQuery.py +++ b/awips/test/dafTests/testCombinedTimeQuery.py @@ -32,8 +32,8 @@ class CombinedTimeQueryTestCase(unittest.TestCase): def testSuccessfulQuery(self): req = DAL.newDataRequest('grid') req.setLocationNames(self.modelName) - req.setParameters('T','GH') - req.setLevels('300MB', '500MB','700MB') + req.setParameters('T', 'GH') + req.setLevels('300MB', '500MB', '700MB') times = CTQ.getAvailableTimes(req) self.assertNotEqual(len(times), 0) @@ -43,7 +43,7 @@ class CombinedTimeQueryTestCase(unittest.TestCase): """ req = DAL.newDataRequest('grid') req.setLocationNames(self.modelName) - req.setParameters('T','GH', 'LgSP1hr') - req.setLevels('300MB', '500MB','700MB','0.0SFC') + req.setParameters('T', 'GH', 'LgSP1hr') + req.setLevels('300MB', '500MB', '700MB', '0.0SFC') times = CTQ.getAvailableTimes(req) self.assertEqual(len(times), 0) diff --git a/awips/test/dafTests/testGfe.py b/awips/test/dafTests/testGfe.py index e80ac48..6750db8 100644 --- a/awips/test/dafTests/testGfe.py +++ b/awips/test/dafTests/testGfe.py @@ -78,7 +78,7 @@ class GfeTestCase(baseDafTestCase.DafTestCase): # Ensure all points are within one degree of the original box # to allow slight margin of error for reprojection distortion. testEnv = box(params.ENVELOPE.bounds[0] - 1, params.ENVELOPE.bounds[1] - 1, - params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1 ) + params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1) for i in range(len(lons)): self.assertTrue(testEnv.contains(Point(lons[i], lats[i]))) @@ -89,17 +89,17 @@ class GfeTestCase(baseDafTestCase.DafTestCase): req.addIdentifier('parmId.dbId.siteId', params.SITE_ID) req.setParameters('Wind') times = DAL.getAvailableTimes(req) - if not(times): + if not times: raise unittest.SkipTest('No Wind Data available for testing') gridData = DAL.getGridData(req, [times[0]]) rawWind = None rawDir = None for grid in gridData: if grid.getParameter() == 'Wind': - self.assertEqual(grid.getUnit(),'kts') + self.assertEqual(grid.getUnit(), 'kts') rawWind = grid.getRawData() elif grid.getParameter() == 'WindDirection': - self.assertEqual(grid.getUnit(),'deg') + self.assertEqual(grid.getUnit(), 'deg') rawDir = grid.getRawData() self.assertIsNotNone(rawWind, 'Wind Magnitude grid is not present') self.assertIsNotNone(rawDir, 'Wind Direction grid is not present') @@ -192,4 +192,3 @@ class GfeTestCase(baseDafTestCase.DafTestCase): def testGetDataWithEmptyInConstraintThrowsException(self): with self.assertRaises(ValueError): self._runConstraintTest('parmId.dbId.modelName', 'in', []) - diff --git a/awips/test/dafTests/testGrid.py b/awips/test/dafTests/testGrid.py index 935d281..6b86a93 100644 --- a/awips/test/dafTests/testGrid.py +++ b/awips/test/dafTests/testGrid.py @@ -86,7 +86,6 @@ class GridTestCase(baseDafTestCase.DafTestCase): def testGetNonexistentIdentifierValuesThrowsException(self): self.runNonexistentIdValuesTest() - def testGetDataWithEnvelope(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('info.datasetId', self.model) @@ -103,12 +102,11 @@ class GridTestCase(baseDafTestCase.DafTestCase): # Ensure all points are within one degree of the original box # to allow slight margin of error for reprojection distortion. testEnv = box(params.ENVELOPE.bounds[0] - 1, params.ENVELOPE.bounds[1] - 1, - params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1 ) + params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1) for i in range(len(lons)): self.assertTrue(testEnv.contains(Point(lons[i], lats[i]))) - def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) diff --git a/awips/test/dafTests/testModelSounding.py b/awips/test/dafTests/testModelSounding.py index 15bb80e..16acfa1 100644 --- a/awips/test/dafTests/testModelSounding.py +++ b/awips/test/dafTests/testModelSounding.py @@ -124,7 +124,7 @@ class ModelSoundingTestCase(baseDafTestCase.DafTestCase): # No numeric tests since no numeric identifiers are available. def testGetDataWithEqualsNone(self): - geometryData = self._runConstraintTest('reportType', '=', None) + self._runConstraintTest('reportType', '=', None) def testGetDataWithNotEquals(self): geometryData = self._runConstraintTest('reportType', '!=', 'ETA') @@ -132,19 +132,19 @@ class ModelSoundingTestCase(baseDafTestCase.DafTestCase): self.assertNotIn('/ETA/', record.getString('dataURI')) def testGetDataWithNotEqualsNone(self): - geometryData = self._runConstraintTest('reportType', '!=', None) + self._runConstraintTest('reportType', '!=', None) def testGetDataWithGreaterThan(self): - geometryData = self._runConstraintTest('reportType', '>', 'ETA') + self._runConstraintTest('reportType', '>', 'ETA') def testGetDataWithLessThan(self): - geometryData = self._runConstraintTest('reportType', '<', 'ETA') + self._runConstraintTest('reportType', '<', 'ETA') def testGetDataWithGreaterThanEquals(self): - geometryData = self._runConstraintTest('reportType', '>=', 'ETA') + self._runConstraintTest('reportType', '>=', 'ETA') def testGetDataWithLessThanEquals(self): - geometryData = self._runConstraintTest('reportType', '<=', 'ETA') + self._runConstraintTest('reportType', '<=', 'ETA') def testGetDataWithInTuple(self): collection = ('ETA', 'GFS') diff --git a/awips/test/dafTests/testRadarSpatial.py b/awips/test/dafTests/testRadarSpatial.py index 2a6864c..64ce7f2 100644 --- a/awips/test/dafTests/testRadarSpatial.py +++ b/awips/test/dafTests/testRadarSpatial.py @@ -25,6 +25,7 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import R from awips.test.dafTests import baseDafTestCase from awips.test.dafTests import params + class RadarSpatialTestCase(baseDafTestCase.DafTestCase): """Test DAF support for radar_spatial data""" diff --git a/awips/test/dafTests/testTopo.py b/awips/test/dafTests/testTopo.py index 1c3a2ed..0ee4aa2 100644 --- a/awips/test/dafTests/testTopo.py +++ b/awips/test/dafTests/testTopo.py @@ -49,7 +49,6 @@ class TopoTestCase(baseDafTestCase.DafTestCase): print("Sample grid data shape:\n" + str(gridData[0].getRawData().shape) + "\n") print("Sample grid data:\n" + str(gridData[0].getRawData()) + "\n") - def testRequestingTooMuchDataThrowsResponseTooLargeException(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("group", "/") diff --git a/dynamicserialize/SelfDescribingBinaryProtocol.py b/dynamicserialize/SelfDescribingBinaryProtocol.py index 1326930..ad3fdd0 100644 --- a/dynamicserialize/SelfDescribingBinaryProtocol.py +++ b/dynamicserialize/SelfDescribingBinaryProtocol.py @@ -14,7 +14,8 @@ from thrift.protocol.TProtocol import * from thrift.protocol.TBinaryProtocol import * -import struct, numpy +import struct +import numpy FLOAT = 64 @@ -28,86 +29,86 @@ doubleList = numpy.dtype(numpy.float64).newbyteorder('>') class SelfDescribingBinaryProtocol(TBinaryProtocol): - def readFieldBegin(self): - ftype = self.readByte() - if ftype == TType.STOP: - return (None, ftype, 0) - name = self.readString() - fid = self.readI16() - return (name, ftype, fid) + def readFieldBegin(self): + ftype = self.readByte() + if ftype == TType.STOP: + return None, ftype, 0 + name = self.readString() + fid = self.readI16() + return name, ftype, fid - def readStructBegin(self): - return self.readString() + def readStructBegin(self): + return self.readString() - def writeStructBegin(self, name): - self.writeString(name) + def writeStructBegin(self, name): + self.writeString(name) - def writeFieldBegin(self, name, ftype, fid): - self.writeByte(ftype) - self.writeString(name) - self.writeI16(fid) + def writeFieldBegin(self, name, ftype, fid): + self.writeByte(ftype) + self.writeString(name) + self.writeI16(fid) - def readFloat(self): - d = self.readI32() - dAsBytes = struct.pack('i', d) - f = struct.unpack('f', dAsBytes) - return f[0] + def readFloat(self): + d = self.readI32() + dAsBytes = struct.pack('i', d) + f = struct.unpack('f', dAsBytes) + return f[0] - def writeFloat(self, f): - dAsBytes = struct.pack('f', f) - i = struct.unpack('i', dAsBytes) - self.writeI32(i[0]) + def writeFloat(self, f): + dAsBytes = struct.pack('f', f) + i = struct.unpack('i', dAsBytes) + self.writeI32(i[0]) - def readI32List(self, sz): - buff = self.trans.readAll(4*sz) - val = numpy.frombuffer(buff, dtype=intList, count=sz) - return val + def readI32List(self, sz): + buff = self.trans.readAll(4*sz) + val = numpy.frombuffer(buff, dtype=intList, count=sz) + return val - def readF32List(self, sz): - buff = self.trans.readAll(4*sz) - val = numpy.frombuffer(buff, dtype=floatList, count=sz) - return val + def readF32List(self, sz): + buff = self.trans.readAll(4*sz) + val = numpy.frombuffer(buff, dtype=floatList, count=sz) + return val - def readF64List(self, sz): - buff = self.trans.readAll(8*sz) - val = numpy.frombuffer(buff, dtype=doubleList, count=sz) - return val + def readF64List(self, sz): + buff = self.trans.readAll(8*sz) + val = numpy.frombuffer(buff, dtype=doubleList, count=sz) + return val - def readI64List(self, sz): - buff = self.trans.readAll(8*sz) - val = numpy.frombuffer(buff, dtype=longList, count=sz) - return val + def readI64List(self, sz): + buff = self.trans.readAll(8*sz) + val = numpy.frombuffer(buff, dtype=longList, count=sz) + return val - def readI16List(self, sz): - buff = self.trans.readAll(2*sz) - val = numpy.frombuffer(buff, dtype=shortList, count=sz) - return val + def readI16List(self, sz): + buff = self.trans.readAll(2*sz) + val = numpy.frombuffer(buff, dtype=shortList, count=sz) + return val - def readI8List(self, sz): - buff = self.trans.readAll(sz) - val = numpy.frombuffer(buff, dtype=byteList, count=sz) - return val + def readI8List(self, sz): + buff = self.trans.readAll(sz) + val = numpy.frombuffer(buff, dtype=byteList, count=sz) + return val - def writeI32List(self, buff): - b = numpy.asarray(buff, intList) - self.trans.write(numpy.getbuffer(b)) + def writeI32List(self, buff): + b = numpy.asarray(buff, intList) + self.trans.write(numpy.getbuffer(b)) - def writeF32List(self, buff): - b = numpy.asarray(buff, floatList) - self.trans.write(numpy.getbuffer(b)) + def writeF32List(self, buff): + b = numpy.asarray(buff, floatList) + self.trans.write(numpy.getbuffer(b)) - def writeF64List(self, buff): - b = numpy.asarray(buff, doubleList) - self.trans.write(numpy.getbuffer(b)) + def writeF64List(self, buff): + b = numpy.asarray(buff, doubleList) + self.trans.write(numpy.getbuffer(b)) - def writeI64List(self, buff): - b = numpy.asarray(buff, longList) - self.trans.write(numpy.getbuffer(b)) + def writeI64List(self, buff): + b = numpy.asarray(buff, longList) + self.trans.write(numpy.getbuffer(b)) - def writeI16List(self, buff): - b = numpy.asarray(buff, shortList) - self.trans.write(numpy.getbuffer(b)) + def writeI16List(self, buff): + b = numpy.asarray(buff, shortList) + self.trans.write(numpy.getbuffer(b)) - def writeI8List(self, buff): - b = numpy.asarray(buff, byteList) - self.trans.write(numpy.getbuffer(b)) + def writeI8List(self, buff): + b = numpy.asarray(buff, byteList) + self.trans.write(numpy.getbuffer(b)) diff --git a/dynamicserialize/ThriftSerializationContext.py b/dynamicserialize/ThriftSerializationContext.py index 63fa1d9..dc87f6c 100644 --- a/dynamicserialize/ThriftSerializationContext.py +++ b/dynamicserialize/ThriftSerializationContext.py @@ -49,6 +49,7 @@ def buildObjMap(module): tname = tname[DS_LEN:] dsObjTypes[tname] = clz + buildObjMap(dstypes) if six.PY2: @@ -211,7 +212,7 @@ class ThriftSerializationContext(object): try: setMethod = getattr(obj, lookingFor) setMethod(result) - except: + except ValueError: raise dynamicserialize.SerializationException( "Couldn't find setter method " + lookingFor) @@ -254,7 +255,7 @@ class ThriftSerializationContext(object): pyt = type(obj) if pyt in pythonToThriftMap: return pythonToThriftMap[pyt] - elif pyt.__module__[:DS_LEN - 1] == ('dynamicserialize.dstypes'): + elif pyt.__module__[:DS_LEN - 1] == 'dynamicserialize.dstypes': return pythonToThriftMap[object] raise dynamicserialize.SerializationException( "Don't know how to serialize object of type: " + str(pyt)) @@ -284,7 +285,6 @@ class ThriftSerializationContext(object): val = m[1]() ft = self._lookupType(val) if ft == TType.STRUCT: - fc = val.__module__[DS_LEN:] self._serializeField(fieldname, ft, fid, val) else: self._serializeField(fieldname, ft, fid, val) diff --git a/dynamicserialize/adapters/GeomDataRespAdapter.py b/dynamicserialize/adapters/GeomDataRespAdapter.py index 9480fb8..d1512f5 100644 --- a/dynamicserialize/adapters/GeomDataRespAdapter.py +++ b/dynamicserialize/adapters/GeomDataRespAdapter.py @@ -59,7 +59,7 @@ def deserialize(context): geoData = [] size = context.readI32() - for __ in range(size): + for _ in range(size): data = GeometryResponseData() # wkb index wkbIndex = context.readI32() diff --git a/dynamicserialize/adapters/TimeRangeTypeAdapter.py b/dynamicserialize/adapters/TimeRangeTypeAdapter.py index b5b3989..ab8053e 100644 --- a/dynamicserialize/adapters/TimeRangeTypeAdapter.py +++ b/dynamicserialize/adapters/TimeRangeTypeAdapter.py @@ -26,7 +26,7 @@ def serialize(context, timeRange): def deserialize(context): startTime = context.readI64() - endTime = context.readI64() + endTime = context.readI64() timeRange = TimeRange() # java uses milliseconds, python uses microseconds diff --git a/dynamicserialize/adapters/__init__.py b/dynamicserialize/adapters/__init__.py index cbca6b4..8da134c 100644 --- a/dynamicserialize/adapters/__init__.py +++ b/dynamicserialize/adapters/__init__.py @@ -92,7 +92,7 @@ def registerAdapters(package, modules): clzName = m.ClassAdapter classAdapterRegistry[clzName] = m else: - raise LookupError('Adapter class ' + x + ' has no ClassAdapter field ' + \ + raise LookupError('Adapter class ' + x + ' has no ClassAdapter field ' + 'and cannot be registered.') diff --git a/dynamicserialize/dstypes/com/__init__.py b/dynamicserialize/dstypes/com/__init__.py index 68b3785..c85988c 100644 --- a/dynamicserialize/dstypes/com/__init__.py +++ b/dynamicserialize/dstypes/com/__init__.py @@ -3,5 +3,3 @@ __all__ = [ 'raytheon', 'vividsolutions' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/__init__.py b/dynamicserialize/dstypes/com/raytheon/__init__.py index f684001..e984a6a 100644 --- a/dynamicserialize/dstypes/com/raytheon/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'uf' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/__init__.py index c569104..c03e3e7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'common' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py index 88e8617..498a169 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py @@ -15,5 +15,3 @@ __all__ = [ 'site', 'time' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py index 59814d7..b03a9f9 100755 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py @@ -53,8 +53,11 @@ class AlertVizRequest(object): def setFilters(self, filters): if filters is None: - self.filters = {} - elif not(None in filters or filters.values().count(None)>0 or '' in filters or filters.values().count('')>0): - self.filters = filters + self.filters = {} + elif not(None in filters + or filters.values().count(None) > 0 + or '' in filters + or filters.values().count('') > 0): + self.filters = filters else: - raise ValueError('Filters must not contain None or empty keys or values: %s' % filters) + raise ValueError('Filters must not contain None or empty keys or values: %s' % filters) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py index 1e0c66a..a53d346 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py @@ -3,5 +3,3 @@ __all__ = [ 'resp', 'user' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py index fcff79a..9bd4f11 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py @@ -12,4 +12,3 @@ class AbstractFailedResponse(with_metaclass(abc.ABCMeta, object)): def setRequest(self, request): self.request = request - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py index ed85757..f8dd0d4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py @@ -1,3 +1,5 @@ +# nothing to implement here that isn't already covered by ServerErrorResponse +# Just need the separate class for de-serialization. from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse @@ -6,7 +8,3 @@ class AuthServerErrorResponse(ServerErrorResponse): def __init__(self): super(AuthServerErrorResponse, self).__init__() - - ## nothing to implement here that isn't already covered by ServerErrorResponse ## - ## Just need the separate class for de-serialization. ## - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py index eb75e35..a529036 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py @@ -17,4 +17,3 @@ class SuccessfulExecution(object): def setUpdatedData(self, updatedData): self.updatedData = updatedData - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py index da24159..67fb814 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py @@ -10,4 +10,3 @@ from .AbstractFailedResponse import AbstractFailedResponse from .AuthServerErrorResponse import AuthServerErrorResponse from .SuccessfulExecution import SuccessfulExecution from .UserNotAuthorized import UserNotAuthorized - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py index 5ab3886..30515f6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py @@ -21,4 +21,3 @@ class User(object): def setAuthenticationData(self, authenticationData): self.authenticationData = authenticationData - 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 9f77e09..60668b0 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py @@ -8,7 +8,7 @@ except ImportError: class UserId(object): - def __init__(self, userid = None): + def __init__(self, userid=None): if userid is None: if not pwd_error: self.id = pwd.getpwuid(os.getuid()).pw_name diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py index 32300f8..9f04796 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py @@ -4,5 +4,3 @@ __all__ = [ 'request', 'response' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py index 94b43e6..b7c7cbc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py @@ -72,6 +72,6 @@ class DefaultDataRequest(IDataRequest): def __str__(self): fmt = ('DefaultDataRequest(datatype={}, identifiers={}, parameters={}, ' + - 'levels={}, locationNames={}, envelope={})') + 'levels={}, locationNames={}, envelope={})') return fmt.format(self.datatype, self.identifiers, self.parameters, self.levels, self.locationNames, self.envelope) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py index 7ddbe5a..5e48b55 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py @@ -14,4 +14,3 @@ class GetAvailableLocationNamesRequest(AbstractDataAccessRequest): def __init__(self): super(GetAvailableLocationNamesRequest, self).__init__() - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py index 86415cc..68a2ca7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py @@ -28,4 +28,3 @@ class GetGeometryDataRequest(AbstractDataAccessRequest): def setRequestedPeriod(self, requestedPeriod): self.requestedPeriod = requestedPeriod - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py index b4f6e5d..aae54f9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py @@ -35,4 +35,4 @@ class GetGridDataRequest(AbstractDataAccessRequest): return self.includeLatLonData def setIncludeLatLonData(self, includeLatLonData): - self.includeLatLonData = includeLatLonData + self.includeLatLonData = includeLatLonData diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py index 02e4ed8..b76a5fe 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py @@ -15,4 +15,3 @@ class GetOptionalIdentifiersRequest(AbstractIdentifierRequest): def __init__(self): super(GetOptionalIdentifiersRequest, self).__init__() - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py index 30d499d..7a65257 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py @@ -12,4 +12,3 @@ class GetSupportedDatatypesRequest(object): def __init__(self): pass - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py index 98a85e6..e76c656 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py @@ -17,4 +17,3 @@ class GetGeometryDataResponse(object): def setGeoData(self, geoData): self.geoData = geoData - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py index bef1497..c52ce5e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py @@ -52,4 +52,3 @@ class GetGridDataResponse(object): def setSiteCrsWkt(self, siteCrsWkt): self.siteCrsWkt = siteCrsWkt - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py index 3a2c9bd..9721f6a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py @@ -37,4 +37,3 @@ class GetGridLatLonResponse(object): def setNy(self, ny): self.ny = ny - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py index 69dddae..d14b058 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py @@ -8,5 +8,3 @@ __all__ = [ 'radar', 'text' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py index 04f24aa..da304bb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'hazards' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py index 9656965..ccf9030 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'requests' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py index 143db2c..ff0479b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py @@ -23,4 +23,3 @@ class RegionLookupRequest(object): def setSite(self, site): self.site = site - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py index 6188401..701b487 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .RegionLookupRequest import RegionLookupRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py index d3513c5..a7f7e17 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py @@ -73,4 +73,3 @@ class GridDataHistory(object): def setLastSentTime(self, lastSentTime): self.lastSentTime = lastSentTime - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py index 5b98ee0..f3684be 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py @@ -6,7 +6,6 @@ # 06/22/2015 4573 randerso Added svcbu package # 10/06/2015 mjames@ucar Removed svcbu package # -# __all__ = [ 'config', @@ -21,4 +20,3 @@ __all__ = [ ] from .GridDataHistory import GridDataHistory - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py index 69850ea..ddd87e9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py @@ -93,4 +93,3 @@ class ProjectionData(object): 'latLonOrigin', 'stdParallelOne', 'stdParallelTwo', 'gridPointLL', 'gridPointUR', 'latIntersect', 'lonCenter', 'lonOrigin'] - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py index b92ea09..0a311c4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .ProjectionData import ProjectionData - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py index fc3c593..d6332d8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'objects' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py index ab54f52..6ea638e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py @@ -113,11 +113,11 @@ class DatabaseID(object): self.modelName = strings[3] # date-time group - if (len(strings[4]) != 8 or len(strings[5]) != 4): + if len(strings[4]) != 8 or len(strings[5]) != 4: return False # make sure the digits are there - dtg = strings[4] + '_' + strings[5] # back together + dtg = strings[4] + '_' + strings[5] # back together if dtg != "00000000_0000": if not self.__decodeDtg(dtg): return False @@ -130,14 +130,14 @@ class DatabaseID(object): try: dateStruct = time.strptime(dtgString, "%Y%m%d_%H%M") except ValueError: - return (False, dateStruct) - return (True, dateStruct) + return False, dateStruct + return True, dateStruct def __decodeDtg(self, dtgString): try: time.strptime(dtgString, "%Y%m%d_%H%M") self.modelTime = dtgString - except: + except ValueError: return False return True @@ -188,7 +188,7 @@ class DatabaseID(object): def __eq__(self, other): if not isinstance(other, DatabaseID): return False - return (str(self) == str(other)) + return str(self) == str(other) def __ne__(self, other): - return (not self.__eq__(other)) + return not self.__eq__(other) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py index a3a6648..46105ca 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py @@ -90,4 +90,3 @@ class GFERecord(object): def setIdentifier(self, identifier): self.identifier = identifier - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py index a536a60..ca4fecf 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py @@ -18,11 +18,10 @@ class GridLocation(object): return self.__repr__() def __repr__(self): + # TODO: Handle geometry in dynamicserialize + # ,loc=" + this.geometry.getGeometryType() s = "[SiteID =" + self.siteId + ",ProjID=" + self.projection.getProjectionID() +\ - ",gridSize=(" + str(self.nx) + ',' + str(self.ny) + ")" - # TODO: Handle geometry in dynamicserialize - # ,loc=" + this.geometry.getGeometryType() - s += ']' + ",gridSize=(" + str(self.nx) + ',' + str(self.ny) + ")]" return s def __eq__(self, other): @@ -43,7 +42,7 @@ class GridLocation(object): return True def __ne__(self, other): - return (not self.__eq__(other)) + return not self.__eq__(other) def getSiteId(self): return self.siteId @@ -113,4 +112,3 @@ class GridLocation(object): if self.origin is None or self.extent is None: return False return True - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py index 3e7590d..35ce07d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py @@ -30,7 +30,6 @@ class GridParmInfo(object): return self.__repr__() def __repr__(self): - out = "" if self.isValid(): out = "ParmID: " + str(self.parmID) + \ " TimeConstraints: " + str(self.timeConstraints) + \ @@ -42,9 +41,9 @@ class GridParmInfo(object): " TimeIndependent: " + str(self.timeIndependentParm) + \ " RateParm: " + str(self.rateParm) + \ " GridType: " + self.gridType + return out else: - out = "" - return out + return "" def __eq__(self, other): if not isinstance(other, GridParmInfo): @@ -88,8 +87,8 @@ class GridParmInfo(object): status.append("GridParmInfo.GridLocation is not valid") if self.timeIndependentParm and self.timeConstraints.anyConstraints(): status.append("GridParmInfo is invalid. There are time constraints" + - " for a time independent parm. Constraints: " + - str(self.timeConstraints)) + " for a time independent parm. Constraints: " + + str(self.timeConstraints)) if not self.unitString: status.append("GridParmInfo.Units are not defined.") if self.precision < -2 or self.precision > 5: @@ -99,7 +98,7 @@ class GridParmInfo(object): retVal = True if status: retVal = False - return (retVal, status) + return retVal, status def isValid(self): (valid, errors) = self.__validCheck() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py index b028529..bfb25a5 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py @@ -56,7 +56,7 @@ class ParmID(object): parts = parmIdentifier.split(":") nameLevel = parts[0].split("_") self.dbId = DatabaseID(parts[1]) - if (len(nameLevel) == 2): + if len(nameLevel) == 2: self.parmName = nameLevel[0] self.parmLevel = nameLevel[1] else: @@ -89,9 +89,9 @@ class ParmID(object): def parmNameAndLevel(composite): pos = composite.find('_') if pos != -1: - return (composite[:pos], composite[pos+1:]) + return composite[:pos], composite[pos+1:] else: - return (composite, "SFC") + return composite, "SFC" def __str__(self): return self.__repr__() @@ -128,4 +128,4 @@ class ParmID(object): return True def __ne__(self, other): - return (not self.__eq__(other)) + return not self.__eq__(other) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py index be1fd51..1a242cb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py @@ -57,13 +57,13 @@ class TimeConstraints(object): return False if self.repeatInterval != other.repeatInterval: return False - return (self.startTime == other.startTime) + return self.startTime == other.startTime def __ne__(self, other): - return (not self.__eq__(other)) + return not self.__eq__(other) def anyConstraints(self): - return (self.duration != 0) + return self.duration != 0 def isValid(self): return self.valid diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py index 6d15447..63376e7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py @@ -14,4 +14,3 @@ from .GridLocation import GridLocation from .GridParmInfo import GridParmInfo from .ParmID import ParmID from .TimeConstraints import TimeConstraints - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py index 30cad67..c9ef91d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py @@ -1,4 +1,4 @@ -## NOTE: Because the pure python dynamicserialize code does not +# NOTE: Because the pure python dynamicserialize code does not # have a means of accessing the DiscreteDefinition, this class # is only really useful as a container for deserialized data # from EDEX. I would not recommend trying to use it for anything @@ -24,7 +24,7 @@ class DiscreteKey(object): def __getitem__(self, key): try: index = int(key) - except: + except TypeError: raise TypeError("list indices must be integers, not " + str(type(key))) if index < 0 or index > len(self.subKeys): raise IndexError("index out of range") @@ -48,7 +48,7 @@ class DiscreteKey(object): return self.subKeys == other.subKeys def __ne__(self, other): - return (not self.__eq__(other)) + return not self.__eq__(other) @staticmethod def auxData(subkey): @@ -83,4 +83,3 @@ class DiscreteKey(object): def setParmID(self, parmID): self.parmID = parmID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py index 37d9619..8de379b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .DiscreteKey import DiscreteKey - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py index 6b4fd38..3a15994 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py @@ -11,8 +11,8 @@ class Grid2DByte(object): def getBuffer(self): return self.buffer - def setBuffer(self, buffer): - self.buffer = buffer + def setBuffer(self, bytebuffer): + self.buffer = bytebuffer def getXdim(self): return self.xdim @@ -28,4 +28,3 @@ class Grid2DByte(object): def getNumPyGrid(self): return numpy.resize(self.buffer, (self.xdim, self.ydim)) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py index b1f345e..60ab294 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py @@ -11,8 +11,8 @@ class Grid2DFloat(object): def getBuffer(self): return self.buffer - def setBuffer(self, buffer): - self.buffer = buffer + def setBuffer(self, bytebuffer): + self.buffer = bytebuffer def getXdim(self): return self.xdim diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py index 6ffedb8..972b3d7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py @@ -6,4 +6,3 @@ __all__ = [ from .Grid2DByte import Grid2DByte from .Grid2DFloat import Grid2DFloat - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py index fc91815..52d3095 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py @@ -24,4 +24,3 @@ class CommitGridsRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py index 164dac3..989c63d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py @@ -31,4 +31,3 @@ class ConfigureTextProductsRequest(object): def setDestinationDir(self, destinationDir): self.destinationDir = destinationDir - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py index 247f180..794c235 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py @@ -37,7 +37,7 @@ class ExportGridsRequest(AbstractGfeRequest): if inputVal in validValues: self.mode = mode else: - raise ValueError(inputVal + " not a valid ExportGridsMode value. Must be one of " + str(validValues)) + raise ValueError(inputVal + " invalid ExportGridsMode. Must be " + str(validValues)) def __str__(self): retVal = "ExportGridsRequest[" diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py index 4720f39..f8d2610 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py @@ -45,4 +45,3 @@ class GetASCIIGridsRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py index 71c366b..c9de340 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py @@ -12,7 +12,7 @@ class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)): def addRequest(self, gridDataReq): if not isinstance(gridDataReq, GetGridRequest): - raise TypeError("Invalid request specified: " + str(type(gridDataReq)) + \ + raise TypeError("Invalid request specified: " + str(type(gridDataReq)) + ". Only GetGridRequests are supported.") else: self.requests.append(gridDataReq) @@ -36,4 +36,3 @@ class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py index 0a8ca31..53a8c90 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py @@ -24,4 +24,3 @@ class GetGridInventoryRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py index 9b32bd5..c65c562 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py @@ -24,4 +24,3 @@ class GetLockTablesRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py index 371372c..b4b77b7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py @@ -17,4 +17,3 @@ class GetOfficialDbNameRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py index 6612093..dc6c256 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py @@ -24,4 +24,3 @@ class GetParmListRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py index 9f080b1..06fa3fd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py @@ -24,4 +24,3 @@ class GetSelectTimeRangeRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py index 1b0399a..02676f9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py @@ -17,4 +17,3 @@ class GetSingletonDbIdsRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py index b12f214..da8fa63 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py @@ -21,4 +21,3 @@ class GetSiteTimeZoneInfoRequest(AbstractGfeRequest): def setRequestedSiteIDs(self, requestedSiteIDs): self.requestedSiteIDs = requestedSiteIDs - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py index e08a94e..d8f7b27 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py @@ -17,4 +17,3 @@ class GridLocRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py index 4682f91..b319021 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py @@ -24,4 +24,3 @@ class LockChangeRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py index 66e449c..014dfcb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py @@ -24,4 +24,3 @@ class SaveASCIIGridsRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py index 34d7552..e98bf41 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py @@ -38,4 +38,3 @@ class SmartInitRequest(object): def setSiteID(self, siteID): self.siteID = siteID - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py index 5b8d91d..dbba035 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py @@ -59,4 +59,3 @@ from .PurgeGfeGridsRequest import PurgeGfeGridsRequest from .SaveASCIIGridsRequest import SaveASCIIGridsRequest from .SmartInitRequest import SmartInitRequest from .RsyncGridsToCWFRequest import RsyncGridsToCWFRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py index 0002f39..40db808 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py @@ -5,5 +5,3 @@ __all__ = [ 'notify', 'request' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py index 3a6c022..0a8b7e0 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py @@ -50,4 +50,3 @@ class Lock(object): + ', ' + time.strftime(timeformat, t1) msg += " WsId: " + str(self.wsId) return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py index e8012ab..6570bbc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py @@ -40,4 +40,3 @@ class LockTable(object): for i in self.locks: msg += "\n Lock: " + str(i) return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py index a4e60ae..c03beee 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py @@ -6,4 +6,3 @@ __all__ = [ from .Lock import Lock from .LockTable import LockTable - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py index 440c553..900b724 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py @@ -10,4 +10,3 @@ class ServerMsg(object): def setMessage(self, message): self.message = message - 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 edc3b58..9be2b7e 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 @@ -26,10 +26,10 @@ class ServerResponse(object): self.notifications = notifications def isOkay(self): - return (self.messages is None or len(self.messages) == 0) + return self.messages is None or len(self.messages) == 0 def message(self): - if (self.isOkay()): + if self.isOkay(): return "" else: compMessage = "" diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py index dbdcc24..7536226 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py @@ -6,4 +6,3 @@ __all__ = [ from .ServerMsg import ServerMsg from .ServerResponse import ServerResponse - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py index 965e23e..6bb1f41 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py @@ -34,4 +34,3 @@ class DBInvChangeNotification(GfeNotification.GfeNotification): msg = 'Additions' + str(self.additions) + '\n' msg += 'Deletions' + str(self.deletions) return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py index 2dad4c2..dd18061 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py @@ -22,7 +22,6 @@ class GfeNotification(with_metaclass(abc.ABCMeta, object)): def setSiteID(self, siteID): self.siteID = siteID - def getSourceID(self): return self.sourceID diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py index a651fc5..8edec6f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py @@ -39,4 +39,3 @@ class GridHistoryUpdateNotification(GfeNotification): msg = "ParmID: " + str(self.parmId) msg += '\n' + "Histories: " + str(self.histories) return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py index 16691af..bd0e897 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py @@ -48,4 +48,3 @@ class GridUpdateNotification(GfeNotification): msg += '\n' + "Replacement TimeRange: " + str(self.replacementTimeRange) msg += '\n' + "Histories: " + str(self.histories) return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py index d77cb02..74288df 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py @@ -24,4 +24,3 @@ class LockNotification(GfeNotification): def __str__(self): return str(self.lockTable) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py index 600b574..33183d1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py @@ -40,4 +40,3 @@ class UserMessageNotification(GfeNotification): msg += 'Priority: ' + str(self.priority) + '\n' msg += 'Category: ' + str(self.category) + '\n' return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py index 4836f65..b0ca85e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py @@ -16,4 +16,3 @@ from .GridHistoryUpdateNotification import GridHistoryUpdateNotification from .GridUpdateNotification import GridUpdateNotification from .LockNotification import LockNotification from .UserMessageNotification import UserMessageNotification - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py index 0bf9f91..81f6b2c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py @@ -31,4 +31,3 @@ class CommitGridRequest(object): def setClientSendStatus(self, clientSendStatus): self.clientSendStatus = bool(clientSendStatus) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py index 4b5cedd..46bd13f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py @@ -28,4 +28,3 @@ class GetGridRequest(object): def setConvertUnit(self, convertUnit): self.convertUnit = convertUnit - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py index 01622b1..0811432 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py @@ -31,4 +31,3 @@ class LockRequest(object): def setMode(self, mode): self.mode = mode - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py index cd1d602..e48e3c4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py @@ -17,4 +17,3 @@ class LockTableRequest(object): def setDbId(self, dbId): self.dbId = dbId - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py index f5675f0..355b490 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py @@ -10,4 +10,3 @@ from .CommitGridRequest import CommitGridRequest from .GetGridRequest import GetGridRequest from .LockRequest import LockRequest from .LockTableRequest import LockTableRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py index 6769402..1a26e0a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py @@ -15,7 +15,7 @@ class DiscreteGridSlice(AbstractGridSlice): self.discreteGrid = discreteGrid def getNumPyGrid(self): - return (self.discreteGrid.getNumPyGrid(), self.key) + return self.discreteGrid.getNumPyGrid(), self.key def getKey(self): return self.key diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py index d77e3de..229d47b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py @@ -8,7 +8,7 @@ class VectorGridSlice(ScalarGridSlice): self.dirGrid = None def getNumPyGrid(self): - return (self.scalarGrid.getNumPyGrid(), self.dirGrid.getNumPyGrid()) + return self.scalarGrid.getNumPyGrid(), self.dirGrid.getNumPyGrid() def getDirGrid(self): return self.dirGrid diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py index 680eb1f..6109545 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py @@ -12,4 +12,3 @@ from .DiscreteGridSlice import DiscreteGridSlice from .ScalarGridSlice import ScalarGridSlice from .VectorGridSlice import VectorGridSlice from .WeatherGridSlice import WeatherGridSlice - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py index f3b7441..bbdbfc3 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py @@ -2,7 +2,7 @@ SUBKEY_SEPARATOR = '^' class WeatherKey(object): -## FIXME: Implement WeatherSubKey and use it in this class when needed. ## + # FIXME: Implement WeatherSubKey and use it in this class when needed. def __init__(self, siteId="", subKeys=[]): self.siteId = siteId @@ -23,7 +23,7 @@ class WeatherKey(object): return self.subKeys == self.subKeys def __ne__(self, other): - return (not self.__eq__(other)) + return not self.__eq__(other) def __hash__(self): prime = 31 diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py index 9048770..c122883 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py @@ -1,4 +1,4 @@ -## TODO: Implement WeatherSubKey when it is explicitly needed. For now +# TODO: Implement WeatherSubKey when it is explicitly needed. For now # WeatherSubKeys will be list of str within the WeatherKey class. diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py index 2d409ed..3d74183 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py @@ -6,4 +6,3 @@ __all__ = [ from .WeatherKey import WeatherKey from .WeatherSubKey import WeatherSubKey - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py index e791e27..ed91455 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'request' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py index 9a7cc0f..6f0f0c7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py @@ -10,4 +10,3 @@ class DeleteAllGridDataRequest(object): def setModelName(self, modelName): self.modelName = modelName - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py index d876b5d..ad09320 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .DeleteAllGridDataRequest import DeleteAllGridDataRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py index d0a0356..2879500 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py @@ -97,4 +97,3 @@ class MasterLevel(object): def setIdentifier(self, identifier): self.identifier = identifier - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py index dd382d7..61c8dd7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py @@ -6,4 +6,3 @@ __all__ = [ from .Level import Level from .MasterLevel import MasterLevel - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py index 0329fa7..872afec 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py @@ -17,4 +17,3 @@ class DataURINotificationMessage(object): def setIds(self, ids): self.ids = ids - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py index 98b1953..8982397 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .DataURINotificationMessage import DataURINotificationMessage - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py index 0452e73..87fb079 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py @@ -3,5 +3,3 @@ __all__ = [ 'request', 'response' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py index 7ee3c30..8349d5e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py @@ -39,4 +39,3 @@ class GetRadarDataRecordRequest(object): def setPrimaryElevationAngle(self, primaryElevationAngle): self.primaryElevationAngle = numpy.float64(primaryElevationAngle) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py index 48b44e5..2c5b7f9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .GetRadarDataRecordRequest import GetRadarDataRecordRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py index 65b8128..f6797eb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py @@ -16,4 +16,3 @@ class GetRadarDataRecordResponse(object): def setData(self, data): self.data = data - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py index 3493e5f..ab4e315 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py @@ -65,4 +65,3 @@ class RadarDataRecord(object): def setVolumeCoveragePattern(self, volumeCoveragePattern): self.volumeCoveragePattern = volumeCoveragePattern - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py index 8c258b9..b024490 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py @@ -6,4 +6,3 @@ __all__ = [ from .GetRadarDataRecordResponse import GetRadarDataRecordResponse from .RadarDataRecord import RadarDataRecord - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py index 4e77765..0163bda 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py @@ -3,5 +3,3 @@ __all__ = [ 'dbsrv', 'subscription' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py index ab09f7e..2b127cb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py @@ -10,4 +10,3 @@ class TextDBRequest(object): def setMessage(self, message): self.message = message - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py index 2e91bbd..f3d27aa 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .TextDBRequest import TextDBRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py index e791e27..ed91455 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'request' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py index e8c0f5d..1fe746f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py @@ -16,4 +16,3 @@ class SubscriptionRequest(object): def setMessage(self, message): self.message = message - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py index 2bd96fb..2812cb7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .SubscriptionRequest import SubscriptionRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py index 9656965..ccf9030 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'requests' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py index fda62f9..c6558f2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py @@ -113,14 +113,14 @@ class RequestConstraint(object): self._evalValue = self._adjustValueType(self.constraintValue) def _adjustValueType(self, value): - ''' + """ Try to take part of a constraint value, encoded as a string, and return it as its 'true type'. _adjustValueType('3.0') -> 3.0 _adjustValueType('3') -> 3.0 _adjustValueType('a string') -> 'a string' - ''' + """ try: return float(value) except ValueError: @@ -132,14 +132,14 @@ class RequestConstraint(object): return value def _matchType(self, value, otherValue): - ''' + """ Return value coerced to be the same type as otherValue. If this is not possible, just return value unmodified. - ''' + """ if not isinstance(value, otherValue.__class__): try: return otherValue.__class__(value) - except Exception: + except ValueError: pass return value @@ -167,7 +167,7 @@ class RequestConstraint(object): def _evalBetween(self, value): value = self._matchType(value, self._evalValue[0]) - return value >= self._evalValue[0] and value <= self._evalValue[1] + return self._evalValue[0] <= value <= self._evalValue[1] def _evalIn(self, value): anEvalValue = next(iter(self._evalValue)) @@ -176,7 +176,7 @@ class RequestConstraint(object): try: if abs(otherValue - float(value)) < self.TOLERANCE: return True - except Exception: + except ValueError: pass return False value = self._matchType(value, anEvalValue) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py index 4cbcac5..6c79752 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py @@ -4,4 +4,3 @@ __all__ = [ ] from .RequestConstraint import RequestConstraint - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py index 844c8e1..f975420 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py @@ -38,4 +38,3 @@ class Request(object): def setType(self, requesttype): self.type = requesttype - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py index 0811555..9cd9c0e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py @@ -17,4 +17,3 @@ class StorageProperties(object): def setChunked(self, chunked): self.chunked = chunked - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py index fb51654..4e97635 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py @@ -17,4 +17,3 @@ class StorageStatus(object): def setIndexOfAppend(self, indexOfAppend): self.indexOfAppend = indexOfAppend - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py index 22ab4bf..be939ee 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py @@ -8,7 +8,6 @@ # ------------ ---------- ----------- -------------------------- # 08/31/10 njensen Initial Creation. # -# __all__ = [ 'records', diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py index 413dd17..0621c22 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py @@ -18,4 +18,3 @@ class ByteDataRecord(AbstractDataRecord): def putDataObject(self, obj): self.setByteData(obj) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py index b1ae8c9..86d0a5e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py @@ -29,7 +29,7 @@ class StringDataRecord(AbstractDataRecord): dtype = h5t.py_create('S' + str(self.maxLength)) else: from pypies.impl.H5pyDataStore import vlen_str_type as dtype - #dtype.set_strpad(h5t.STR_NULLTERM) + # dtype.set_strpad(h5t.STR_NULLTERM) return numpy.asarray(self.getStringData(), dtype) return self.numpyData diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py index dadeb09..c0ce181 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py @@ -33,4 +33,3 @@ class LocalizationContext(object): if self.contextName is not None and self.contextName != "": delimitedString += "." + self.contextName return delimitedString - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py index e0d90c9..e791020 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py @@ -1,24 +1,11 @@ -knownLevels = {"BASE": {"text" : "BASE", - "order" : 0, - "systemLevel" : True, - }, - "CONFIGURED": {"text" : "CONFIGURED", - "order" : 250, - "systemLevel" : True, - }, - "SITE": {"text" : "SITE", - "order" : 500, - "systemLevel" : False, - }, - "USER": {"text" : "USER", - "order" : 1000, - "systemLevel" : False, - }, - "UNKNOWN": {"text" : "UNKNOWN", - "order" : -1, - } - } +knownLevels = { + "BASE": {"text": "BASE", "order": 0, "systemLevel": True}, + "CONFIGURED": {"text": "CONFIGURED", "order": 250, "systemLevel": True}, + "SITE": {"text": "SITE", "order": 500, "systemLevel": False}, + "USER": {"text": "USER", "order": 1000, "systemLevel": False}, + "UNKNOWN": {"text": "UNKNOWN", "order": -1} +} class LocalizationLevel(object): @@ -53,4 +40,3 @@ class LocalizationLevel(object): def __repr__(self): return str(self.text) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py index 73208cd..d24decd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py @@ -16,4 +16,3 @@ class LocalizationType(object): def setText(self, text): self.text = text - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py index a5b479b..d8e1699 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py @@ -10,4 +10,3 @@ __all__ = [ from .LocalizationContext import LocalizationContext from .LocalizationLevel import LocalizationLevel from .LocalizationType import LocalizationType - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py index 3632f44..807eee6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py @@ -24,4 +24,3 @@ class DeleteUtilityCommand(object): def setMyContextName(self, contextName): self.myContextName = str(contextName) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py index 48a1175..906be7d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py @@ -58,4 +58,3 @@ class ListResponseEntry(object): def __str__(self): return self.fileName - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py index bc05c77..1219cc2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py @@ -38,4 +38,3 @@ class ListUtilityCommand(object): def setContext(self, context): self.context = context - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py index 516984b..9fb8604 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py @@ -18,4 +18,3 @@ class PrivilegedUtilityRequestMessage(object): def setUser(self, user): self.user = user - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py index ec4f9a5..606dd10 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py @@ -10,4 +10,3 @@ class UtilityRequestMessage(object): def setCommands(self, commands): self.commands = commands - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py index f1fe909..65be40f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py @@ -10,4 +10,3 @@ class UtilityResponseMessage(object): def setResponses(self, responses): self.responses = responses - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py index 7f3f6b6..2d9f587 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py @@ -18,4 +18,3 @@ from .ListUtilityResponse import ListUtilityResponse from .PrivilegedUtilityRequestMessage import PrivilegedUtilityRequestMessage from .UtilityRequestMessage import UtilityRequestMessage from .UtilityResponseMessage import UtilityResponseMessage - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py index 7c67e26..8fff94e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py @@ -37,4 +37,3 @@ class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)): def setUser(self, user): self.user = user - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py index 29e227b..c1479f7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py @@ -19,4 +19,3 @@ class LocalizationStreamGetRequest(AbstractLocalizationStreamRequest): def setNumBytes(self, numBytes): self.numBytes = numBytes - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py index fd805aa..f46ec7d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py @@ -42,4 +42,3 @@ class LocalizationStreamPutRequest(AbstractLocalizationStreamRequest): def setLocalizedSite(self, localizedSite): self.localizedSite = localizedSite - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py index a9cf9c0..61fefc3 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py @@ -8,4 +8,3 @@ __all__ = [ from .AbstractLocalizationStreamRequest import AbstractLocalizationStreamRequest from .LocalizationStreamGetRequest import LocalizationStreamGetRequest from .LocalizationStreamPutRequest import LocalizationStreamPutRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py index 0452e73..87fb079 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py @@ -3,5 +3,3 @@ __all__ = [ 'request', 'response' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py index 210f5a2..675429d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py @@ -17,4 +17,3 @@ class ChangeContextRequest(object): def setContextName(self, contextName): self.contextName = contextName - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py index a9e8696..0913594 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py @@ -24,4 +24,3 @@ class PassThroughRequest(object): def setJvmName(self, jvmName): self.jvmName = jvmName - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py index 64713c3..8bf2c4d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py @@ -7,4 +7,3 @@ __all__ = [ from .ChangeContextRequest import ChangeContextRequest from .PassThroughRequest import PassThroughRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py index 516764d..be04a3a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py @@ -10,4 +10,3 @@ class GetContextsRequest(object): def setContextState(self, contextState): self.contextState = contextState - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py index eaf5698..dfa38a7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py @@ -8,4 +8,3 @@ __all__ = [ from .GetClusterMembersRequest import GetClusterMembersRequest from .GetContextsRequest import GetContextsRequest from .StatusRequest import StatusRequest - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py index 988b58f..5881904 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'diagnostic' ] - - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py index c5d82e2..4243ed4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py @@ -16,4 +16,3 @@ class ClusterMembersResponse(object): for x in self.status: msg += str(x) + '\n' return msg - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py index 4356a9b..2aed7fa 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py @@ -20,4 +20,3 @@ class ContextsResponse(object): def __repr__(self): return str(self.contexts) - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py index a4e3de4..5f9649b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py @@ -27,4 +27,3 @@ class StatusResponse(object): def __repr__(self): return self.hostname + ':' + self.jvmName - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py index 02db34f..1cc4ead 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py @@ -8,4 +8,3 @@ __all__ = [ from .ClusterMembersResponse import ClusterMembersResponse from .ContextsResponse import ContextsResponse from .StatusResponse import StatusResponse - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py index 4061455..b7dfffd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py @@ -10,4 +10,3 @@ class Body(object): def setResponses(self, responses): self.responses = responses - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py index 69e6bbb..8d09aa7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py @@ -19,4 +19,3 @@ class Header(object): def setProperties(self, properties): self.properties = properties - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py index 3c8df00..2b38d9b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py @@ -17,4 +17,3 @@ class Message(object): def setBody(self, body): self.body = body - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py index e13b7f6..5234a76 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py @@ -17,4 +17,3 @@ class Property(object): def setValue(self, value): self.value = value - diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py index 696ad90..f0bd3c0 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py @@ -27,14 +27,14 @@ class WsId(object): def __init__(self, networkId=None, userName=None, progName=None): self.networkId = networkId if networkId is None: - self.networkId = str(struct.unpack('= self.start and timeArg.end <= self.end) + return timeArg.start >= self.start and timeArg.end <= self.end else: convTime = self.__convertToDateTime(timeArg) if not isinstance(convTime, datetime.datetime): raise TypeError("Invalid type for argument time specified to TimeRange.contains().") if self.duration() != 0: - return (convTime >= self.start and convTime < self.end) + return self.start <= convTime < self.end return convTime == self.start def isValid(self): return bool(self.start != self.end) def overlaps(self, timeRange): - return (timeRange.contains(self.start) or self.contains(timeRange.start)) + return timeRange.contains(self.start) or self.contains(timeRange.start) def combineWith(self, timeRange): if self.isValid() and timeRange.isValid(): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py index fb46f44..14d6861 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py @@ -10,4 +10,3 @@ from .DataTime import DataTime from .TimeRange import TimeRange from .FormattedDate import FormattedDate from .CommutativeTimestamp import CommutativeTimestamp - diff --git a/dynamicserialize/dstypes/com/vividsolutions/__init__.py b/dynamicserialize/dstypes/com/vividsolutions/__init__.py index 5895b3e..074f0ea 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/__init__.py +++ b/dynamicserialize/dstypes/com/vividsolutions/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'jts' ] - - diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py b/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py index cee89c6..0699c05 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py +++ b/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py @@ -2,5 +2,3 @@ __all__ = [ 'geom' ] - - diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py index e961d40..f143f0f 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py +++ b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py @@ -23,4 +23,3 @@ class Coordinate(object): def __repr__(self): return self.__str__() - diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py index 480ff1d..7491741 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py +++ b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py @@ -45,4 +45,3 @@ class Envelope(object): def setMinY(self, value): self.miny = value - diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py index fffd3c8..2b134c7 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py +++ b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py @@ -15,4 +15,3 @@ class Geometry(object): def setBinaryData(self, data): self.binaryData = data - diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py index a982bd6..93748c2 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py +++ b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py @@ -8,4 +8,3 @@ __all__ = [ from .Coordinate import Coordinate from .Envelope import Envelope from .Geometry import Geometry - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py index 77912f4..5fccf34 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py @@ -65,4 +65,3 @@ class GetGridDataRequest(object): def setFcstsec(self, fcstsec): self.fcstsec = fcstsec - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py index 36631bd..7ecd148 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py @@ -37,4 +37,3 @@ class GetGridInfoRequest(object): def setFcstsec(self, fcstsec): self.fcstsec = fcstsec - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py index 9bab360..5284322 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py @@ -23,4 +23,3 @@ class GetGridNavRequest(object): def setPluginName(self, pluginName): self.pluginName = pluginName - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py index 5bd54cb..3670c42 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py @@ -16,4 +16,3 @@ class GetStationsRequest(object): def setPluginName(self, pluginName): self.pluginName = pluginName - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py index ddc7a5c..6387132 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py @@ -23,4 +23,3 @@ class GetTimesRequest(object): def setTimeField(self, timeField): self.timeField = timeField - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py index 83a1c8a..0f37030 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py @@ -16,4 +16,3 @@ class GetTimesResponse(object): def setTimes(self, times): self.times = times - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py index ddcc86f..9bae221 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py @@ -60,4 +60,3 @@ class Station(object): def setCountry(self, country): self.country = country - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py index cd90a36..b587766 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py @@ -44,4 +44,3 @@ class StationDataRequest(object): def setPartNumber(self, partNumber): self.partNumber = partNumber - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py index f1011e5..04ae692 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py @@ -44,4 +44,3 @@ class SurfaceDataRequest(object): def setPartNumber(self, partNumber): self.partNumber = partNumber - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py index 3d09bc6..ed692ed 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py @@ -44,4 +44,3 @@ class UpperAirDataRequest(object): def setPartNumber(self, partNumber): self.partNumber = partNumber - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py index 500e0f6..d72b906 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py @@ -73,4 +73,3 @@ class ActivityInfo(object): def setStatus(self, status): self.status = status - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py index ebafc0e..647ead2 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py @@ -24,4 +24,3 @@ class DerivedProduct(object): def setProduct(self, product): self.product = product - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py index 495c876..e6c2742 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py @@ -38,4 +38,3 @@ class ResponseMessageValidate(object): def setValidTime(self, validTime): self.validTime = validTime - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py index c0f60bd..73cd3a9 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py @@ -10,4 +10,3 @@ class RetrieveAllProductsRequest(object): def setDataURI(self, dataURI): self.dataURI = dataURI - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py index f89c658..1512011 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py @@ -17,4 +17,3 @@ class StoreActivityRequest(object): def setActivityXML(self, activityXML): self.activityXML = activityXML - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py index 06c9ae8..3b70af8 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py @@ -17,4 +17,3 @@ class StoreDerivedProductRequest(object): def setProductList(self, productList): self.productList = productList - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py index e9f2911..0596caa 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py @@ -51,4 +51,3 @@ class ActivityMapData(object): def setActivityName(self, activityName): self.activityName = activityName - diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py index 002cca4..2f6d1bd 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py @@ -16,4 +16,3 @@ class RetrieveActivityMapResponse(object): def setData(self, data): self.data = data - diff --git a/dynamicserialize/dstypes/java/awt/Point.py b/dynamicserialize/dstypes/java/awt/Point.py index 1ba9a65..45f4028 100644 --- a/dynamicserialize/dstypes/java/awt/Point.py +++ b/dynamicserialize/dstypes/java/awt/Point.py @@ -34,4 +34,3 @@ class Point(object): def setY(self, y): self.y = y - diff --git a/dynamicserialize/dstypes/java/lang/StackTraceElement.py b/dynamicserialize/dstypes/java/lang/StackTraceElement.py index 1fe2376..3262c40 100644 --- a/dynamicserialize/dstypes/java/lang/StackTraceElement.py +++ b/dynamicserialize/dstypes/java/lang/StackTraceElement.py @@ -33,7 +33,7 @@ class StackTraceElement(object): self.lineNumber = int(lineNumber) def isNativeMethod(self): - return (self.lineNumber == -2) + return self.lineNumber == -2 def __str__(self): return self.__repr__() @@ -49,5 +49,3 @@ class StackTraceElement(object): else: msg += "(Unknown Source)" return msg - - diff --git a/dynamicserialize/dstypes/java/sql/Timestamp.py b/dynamicserialize/dstypes/java/sql/Timestamp.py index 6f81bb5..fef3a19 100644 --- a/dynamicserialize/dstypes/java/sql/Timestamp.py +++ b/dynamicserialize/dstypes/java/sql/Timestamp.py @@ -18,4 +18,5 @@ class Timestamp(Date): super(Timestamp, self).__init__(time) def __repr__(self): - return strftime("%Y-%m-%d %H:%M:%S.", gmtime(self.time/1000.0)) + '{:03d}'.format(self.time%1000) + return strftime("%Y-%m-%d %H:%M:%S.", gmtime(self.time/1000.0)) + \ + '{:03d}'.format(self.time % 1000) diff --git a/dynamicserialize/dstypes/java/util/Calendar.py b/dynamicserialize/dstypes/java/util/Calendar.py index 6b1a825..85bcba0 100644 --- a/dynamicserialize/dstypes/java/util/Calendar.py +++ b/dynamicserialize/dstypes/java/util/Calendar.py @@ -10,6 +10,8 @@ # 09/29/10 wldougher Initial Creation. # +from . import GregorianCalendar + class Calendar(object): diff --git a/setup.py b/setup.py index ef0f771..3621cfd 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,11 @@ import sys from distutils.core import setup from setuptools import find_packages -dependencies = ['numpy','six'] +dependencies = ['numpy', 'six'] if sys.version_info < (3, 4): dependencies.append('enum34') -ver="18.1.6" +ver = "18.1.6" setup( name='python-awips', @@ -27,7 +27,7 @@ setup( 'cdm': ['pyproj>=1.9.4'], 'dev': ['ipython[all]>=3.1'], 'doc': ['sphinx>=1.4', 'sphinx-gallery', 'doc8'], - 'examples': ['cartopy>=0.13.1','metpy>=0.4.0'] + 'examples': ['cartopy>=0.13.1', 'metpy>=0.4.0'] } )