diff --git a/awips/NotificationMessage.py b/awips/NotificationMessage.py index 197f7c9..5b6a975 100755 --- a/awips/NotificationMessage.py +++ b/awips/NotificationMessage.py @@ -1,8 +1,3 @@ -## -## - -from string import Template - import ctypes from . import stomp import socket @@ -13,7 +8,6 @@ import xml.etree.ElementTree as ET from . import ThriftClient from dynamicserialize.dstypes.com.raytheon.uf.common.alertviz import AlertVizRequest -from dynamicserialize import DynamicSerializationManager # # Provides a capability of constructing notification messages and sending @@ -122,7 +116,7 @@ class NotificationMessage: sm.set("filters", self.filters) msg = ET.SubElement(sm, "message") msg.text = self.message - details = ET.SubElement(sm, "details") + # details = ET.SubElement(sm, "details") msg = ET.tostring(sm, "UTF-8") try : diff --git a/awips/ThriftClient.py b/awips/ThriftClient.py index fc4c181..7da9d82 100644 --- a/awips/ThriftClient.py +++ b/awips/ThriftClient.py @@ -1,13 +1,8 @@ -## -## - try: import http.client as httpcl except ImportError: import httplib as httpcl from dynamicserialize import DynamicSerializationManager -from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse -from dynamicserialize.dstypes.com.raytheon.uf.common.serialization import SerializableExceptionWrapper # # Provides a Python-based interface for executing Thrift requests. diff --git a/awips/dataaccess/DataNotificationLayer.py b/awips/dataaccess/DataNotificationLayer.py index ac8abec..69caba7 100644 --- a/awips/dataaccess/DataNotificationLayer.py +++ b/awips/dataaccess/DataNotificationLayer.py @@ -74,7 +74,7 @@ def _getJmsConnectionInfo(notifFilterResponse): serverString = notifFilterResponse.getJmsConnectionInfo() try: host, port = JMS_HOST_PATTERN.match(serverString).groups() - except AttributeError as e: + except AttributeError: raise RuntimeError('Got bad JMS connection info from server: ' + serverString) return {'host': host, 'port': port} diff --git a/awips/dataaccess/DataQueue.py b/awips/dataaccess/DataQueue.py index 48bd113..afbaae2 100644 --- a/awips/dataaccess/DataQueue.py +++ b/awips/dataaccess/DataQueue.py @@ -29,15 +29,15 @@ else: # Python 3 module renamed to 'queue' from queue import Queue, Empty -"""Used to indicate a DataQueue that will produce geometry data.""" +# Used to indicate a DataQueue that will produce geometry data. GEOMETRY = object() -"""Used to indicate a DataQueue that will produce grid data.""" +# Used to indicate a DataQueue that will produce grid data. GRID = object() -"""Default maximum queue size.""" +# Default maximum queue size. _DEFAULT_MAXSIZE = 100 diff --git a/awips/dataaccess/PyGeometryNotification.py b/awips/dataaccess/PyGeometryNotification.py index 7e66d06..7aa7e9a 100644 --- a/awips/dataaccess/PyGeometryNotification.py +++ b/awips/dataaccess/PyGeometryNotification.py @@ -1,6 +1,3 @@ -# # -# # - # # Notification object that produces geometry data # @@ -15,7 +12,7 @@ import dynamicserialize from awips.dataaccess.PyNotification import PyNotification -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + class PyGeometryNotification(PyNotification): @@ -30,7 +27,7 @@ class PyGeometryNotification(PyNotification): try: data = self.getData(self.request, list(dataTimes)) self.callback(data) - except Exception as e: + except Exception: traceback.print_exc() def getData(self, request, dataTimes): diff --git a/awips/dataaccess/PyGridNotification.py b/awips/dataaccess/PyGridNotification.py index cee3ca0..27b013a 100644 --- a/awips/dataaccess/PyGridNotification.py +++ b/awips/dataaccess/PyGridNotification.py @@ -1,6 +1,3 @@ -# # -# # - # # Notification object that produces grid data # @@ -14,8 +11,9 @@ # import dynamicserialize +import traceback from awips.dataaccess.PyNotification import PyNotification -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + class PyGridNotification(PyNotification): @@ -35,7 +33,7 @@ class PyGridNotification(PyNotification): newReq.setParameters(self.request.getParameters()) data = self.getData(newReq, []) self.callback(data) - except Exception as e: + except Exception: traceback.print_exc() def getData(self, request, dataTimes): diff --git a/awips/dataaccess/PyNotification.py b/awips/dataaccess/PyNotification.py index a2f70eb..f24851c 100644 --- a/awips/dataaccess/PyNotification.py +++ b/awips/dataaccess/PyNotification.py @@ -1,6 +1,3 @@ -## -## - # # Implements IData for use by native Python clients to the Data Access # Framework. @@ -17,14 +14,10 @@ from six import with_metaclass import abc -import time -import traceback -import dynamicserialize from awips.dataaccess import DataAccessLayer from awips.dataaccess import INotificationSubscriber from awips.QpidSubscriber import QpidSubscriber -from awips.ThriftClient import ThriftRequestException from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime diff --git a/awips/stomp.py b/awips/stomp.py index 6ae7d54..2327e42 100644 --- a/awips/stomp.py +++ b/awips/stomp.py @@ -1,6 +1,23 @@ -#!/usr/bin/env python -## -## +from __future__ import print_function +import hashlib +import math +import random +import re +import socket +import sys +import threading +import time +import xml.dom.minidom +try: + from StringIO import StringIO +except ImportError: + from io import StringIO +from functools import reduce +try: + import _thread +except ImportError: + import thread as _thread + """Stomp Protocol Connectivity This provides basic connectivity to a message broker supporting the 'stomp' protocol. @@ -64,27 +81,6 @@ """ -from __future__ import print_function -import hashlib -import math -import random -import re -import socket -import sys -import threading -import time -import types -import xml.dom.minidom -try: - from StringIO import StringIO -except ImportError: - from io import StringIO -from functools import reduce -try: - import _thread -except ImportError: - import thread - # # stomp.py version number # diff --git a/awips/test/Record.py b/awips/test/Record.py index e7b19c1..b45d3fe 100644 --- a/awips/test/Record.py +++ b/awips/test/Record.py @@ -13,15 +13,15 @@ # # -import os import sys + class Record(): def __init__(self, level=0, msg='Test Message'): - self.levelno=level - self.message=msg - self.exc_info=sys.exc_info() - self.exc_text="TEST" + self.levelno = level + self.message = msg + self.exc_info = sys.exc_info() + self.exc_text = "TEST" def getMessage(self): return self.message diff --git a/dynamicserialize/ThriftSerializationContext.py b/dynamicserialize/ThriftSerializationContext.py index bbfb153..303c0d9 100644 --- a/dynamicserialize/ThriftSerializationContext.py +++ b/dynamicserialize/ThriftSerializationContext.py @@ -1,7 +1,3 @@ -## -## - - # # A port of the Java ThriftSerializationContext, used for reading/writing # DynamicSerialize objects to/from thrift. @@ -28,10 +24,7 @@ from thrift.Thrift import TType import inspect import sys -import types -import time import numpy -import collections import dynamicserialize from dynamicserialize import dstypes, adapters from dynamicserialize import SelfDescribingBinaryProtocol diff --git a/dynamicserialize/adapters/GeomDataRespAdapter.py b/dynamicserialize/adapters/GeomDataRespAdapter.py index 004460e..fa9f887 100644 --- a/dynamicserialize/adapters/GeomDataRespAdapter.py +++ b/dynamicserialize/adapters/GeomDataRespAdapter.py @@ -1,7 +1,3 @@ -## -## - - # # Efficient adapter for GetGeometryDataResponse # @@ -15,8 +11,6 @@ # # -from thrift.Thrift import TType -from dynamicserialize import SelfDescribingBinaryProtocol from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import GeometryResponseData from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import GetGeometryDataResponse 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 ec2298f..2dc4fe7 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 @@ -1,10 +1,5 @@ -## -## - # File auto-generated against equivalent DynamicSerialize Java class -import warnings - from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import GridLocation from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import TimeConstraints @@ -101,7 +96,7 @@ class GridParmInfo(object): status.append("GridParmInfo.Units are not defined.") if self.precision < -2 or self.precision > 5: status.append("GridParmInfo is invalid. Precision out of limits." + - " Precision is: " + str(precision) + ". Must be between -2 and 5.") + " Precision is: " + str(self.precision) + ". Must be between -2 and 5.") retVal = True if len(status) > 0: 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 77b9e9a..c37c562 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 @@ -1,10 +1,6 @@ -## -## - # File auto-generated against equivalent DynamicSerialize Java class from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import GFERecord -from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId class GetGridRequest(object): 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 afe39d9..9ad44b3 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py @@ -1,11 +1,7 @@ -## -## - # File auto-generated against equivalent DynamicSerialize Java class -import os from dynamicserialize.dstypes.com.raytheon.uf.common.localization.stream import AbstractLocalizationStreamRequest -from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import User + class LocalizationStreamGetRequest(AbstractLocalizationStreamRequest):