mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
Merge branch 'master' of https://github.com/freemansw1/python-awips into master-python3
Conflicts: .gitignore
This commit is contained in:
commit
20d7a5e883
129 changed files with 508 additions and 506 deletions
|
@ -35,7 +35,7 @@
|
|||
#
|
||||
|
||||
import logging
|
||||
import NotificationMessage
|
||||
from . import NotificationMessage
|
||||
|
||||
class AlertVizHandler(logging.Handler):
|
||||
|
||||
|
|
|
@ -63,10 +63,10 @@ def convertToDateTime(timeArg):
|
|||
return datetime.datetime(*timeArg[:6])
|
||||
elif isinstance(timeArg, float):
|
||||
# seconds as float, should be avoided due to floating point errors
|
||||
totalSecs = long(timeArg)
|
||||
totalSecs = int(timeArg)
|
||||
micros = int((timeArg - totalSecs) * MICROS_IN_SECOND)
|
||||
return _convertSecsAndMicros(totalSecs, micros)
|
||||
elif isinstance(timeArg, (int, long)):
|
||||
elif isinstance(timeArg, int):
|
||||
# seconds as integer
|
||||
totalSecs = timeArg
|
||||
return _convertSecsAndMicros(totalSecs, 0)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,14 +21,14 @@
|
|||
from string import Template
|
||||
|
||||
import ctypes
|
||||
import stomp
|
||||
from . import stomp
|
||||
import socket
|
||||
import sys
|
||||
import time
|
||||
import threading
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
import ThriftClient
|
||||
from . import ThriftClient
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.alertviz import AlertVizRequest
|
||||
from dynamicserialize import DynamicSerializationManager
|
||||
|
||||
|
@ -89,8 +89,8 @@ class NotificationMessage:
|
|||
priorityInt = int(5)
|
||||
|
||||
if (priorityInt < 0 or priorityInt > 5):
|
||||
print "Error occurred, supplied an invalid Priority value: " + str(priorityInt)
|
||||
print "Priority values are 0, 1, 2, 3, 4 and 5."
|
||||
print("Error occurred, supplied an invalid Priority value: " + str(priorityInt))
|
||||
print("Priority values are 0, 1, 2, 3, 4 and 5.")
|
||||
sys.exit(1)
|
||||
|
||||
if priorityInt is not None:
|
||||
|
@ -100,8 +100,8 @@ class NotificationMessage:
|
|||
|
||||
def connection_timeout(self, connection):
|
||||
if (connection is not None and not connection.is_connected()):
|
||||
print "Connection Retry Timeout"
|
||||
for tid, tobj in threading._active.items():
|
||||
print("Connection Retry Timeout")
|
||||
for tid, tobj in list(threading._active.items()):
|
||||
if tobj.name is "MainThread":
|
||||
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(SystemExit))
|
||||
if res != 0 and res != 1:
|
||||
|
@ -150,14 +150,14 @@ class NotificationMessage:
|
|||
serverResponse = None
|
||||
try:
|
||||
serverResponse = thriftClient.sendRequest(alertVizRequest)
|
||||
except Exception, ex:
|
||||
print "Caught exception submitting AlertVizRequest: ", str(ex)
|
||||
except Exception as ex:
|
||||
print("Caught exception submitting AlertVizRequest: ", str(ex))
|
||||
|
||||
if (serverResponse != "None"):
|
||||
print "Error occurred submitting Notification Message to AlertViz receiver: ", serverResponse
|
||||
print("Error occurred submitting Notification Message to AlertViz receiver: ", serverResponse)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "Response: " + str(serverResponse)
|
||||
print("Response: " + str(serverResponse))
|
||||
|
||||
def createRequest(message, priority, source, category, audioFile):
|
||||
obj = AlertVizRequest()
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
import qpid
|
||||
import zlib
|
||||
|
||||
from Queue import Empty
|
||||
from queue import Empty
|
||||
from qpid.exceptions import Closed
|
||||
|
||||
class QpidSubscriber:
|
||||
|
@ -56,7 +56,7 @@ class QpidSubscriber:
|
|||
if (topicName == 'edex.alerts'):
|
||||
self.decompress = True
|
||||
|
||||
print "Establishing connection to broker on", self.host
|
||||
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.exchange_bind(exchange='amq.topic', queue=queueName, binding_key=topicName)
|
||||
|
@ -67,7 +67,7 @@ class QpidSubscriber:
|
|||
queue = self.__session.incoming(local_queue_name)
|
||||
self.__session.message_subscribe(serverQueueName, destination=local_queue_name)
|
||||
queue.start()
|
||||
print "Connection complete to broker on", self.host
|
||||
print("Connection complete to broker on", self.host)
|
||||
|
||||
while self.subscribed:
|
||||
try:
|
||||
|
@ -75,7 +75,7 @@ class QpidSubscriber:
|
|||
content = message.body
|
||||
self.__session.message_accept(qpid.datatypes.RangedSet(message.id))
|
||||
if (self.decompress):
|
||||
print "Decompressing received content"
|
||||
print("Decompressing received content")
|
||||
try:
|
||||
# http://stackoverflow.com/questions/2423866/python-decompressing-gzip-chunk-by-chunk
|
||||
d = zlib.decompressobj(16+zlib.MAX_WBITS)
|
||||
|
|
|
@ -60,14 +60,14 @@ def get_hdf5_data(idra):
|
|||
threshVals = []
|
||||
if len(idra) > 0:
|
||||
for ii in range(len(idra)):
|
||||
if idra[ii].getName() == "Data":
|
||||
if idra[ii].getName() == b"Data":
|
||||
rdat = idra[ii]
|
||||
elif idra[ii].getName() == "Angles":
|
||||
elif idra[ii].getName() == b"Angles":
|
||||
azdat = idra[ii]
|
||||
dattyp = "radial"
|
||||
elif idra[ii].getName() == "DependentValues":
|
||||
elif idra[ii].getName() == b"DependentValues":
|
||||
depVals = idra[ii].getShortData()
|
||||
elif idra[ii].getName() == "Thresholds":
|
||||
elif idra[ii].getName() == b"Thresholds":
|
||||
threshVals = idra[ii].getShortData()
|
||||
|
||||
return rdat,azdat,depVals,threshVals
|
||||
|
|
|
@ -17,8 +17,10 @@
|
|||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
import httplib
|
||||
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
|
||||
|
@ -54,12 +56,12 @@ class ThriftClient:
|
|||
if (len(hostParts) > 1):
|
||||
hostString = hostParts[0]
|
||||
self.__uri = "/" + hostParts[1]
|
||||
self.__httpConn = httplib.HTTPConnection(hostString)
|
||||
self.__httpConn = httpcl.HTTPConnection(hostString)
|
||||
else:
|
||||
if (port is None):
|
||||
self.__httpConn = httplib.HTTPConnection(host)
|
||||
self.__httpConn = httpcl.HTTPConnection(host)
|
||||
else:
|
||||
self.__httpConn = httplib.HTTPConnection(host, port)
|
||||
self.__httpConn = httpcl.HTTPConnection(host, port)
|
||||
|
||||
self.__uri = uri
|
||||
|
||||
|
@ -67,17 +69,17 @@ class ThriftClient:
|
|||
|
||||
def sendRequest(self, request, uri="/thrift"):
|
||||
message = self.__dsm.serializeObject(request)
|
||||
|
||||
#message = message.decode('cp437')
|
||||
self.__httpConn.connect()
|
||||
self.__httpConn.request("POST", self.__uri + uri, message)
|
||||
|
||||
response = self.__httpConn.getresponse()
|
||||
if (response.status != 200):
|
||||
raise ThriftRequestException("Unable to post request to server")
|
||||
|
||||
rval = self.__dsm.deserializeBytes(response.read())
|
||||
self.__httpConn.close()
|
||||
|
||||
|
||||
# let's verify we have an instance of ServerErrorResponse
|
||||
# IF we do, through an exception up to the caller along
|
||||
# with the original Java stack trace
|
||||
|
|
|
@ -87,7 +87,7 @@ def determineDrtOffset(timeStr):
|
|||
#print "gmtime", gm
|
||||
if synch:
|
||||
cur_t = time.mktime((gm[0], gm[1], gm[2], gm[3], 0, 0, 0, 0, 0))
|
||||
curStr = '%4s%2s%2s_%2s00\n' % (`gm[0]`,`gm[1]`,`gm[2]`,`gm[3]`)
|
||||
curStr = '%4s%2s%2s_%2s00\n' % (repr(gm[0]),repr(gm[1]),repr(gm[2]),repr(gm[3]))
|
||||
curStr = curStr.replace(' ','0')
|
||||
launchStr = timeStr + "," + curStr
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ import subprocess
|
|||
THRIFT_HOST = "edex"
|
||||
USING_NATIVE_THRIFT = False
|
||||
|
||||
if sys.modules.has_key('jep'):
|
||||
if 'jep' in sys.modules:
|
||||
# intentionally do not catch if this fails to import, we want it to
|
||||
# be obvious that something is configured wrong when running from within
|
||||
# Java instead of allowing false confidence and fallback behavior
|
||||
|
|
|
@ -45,7 +45,7 @@ class PyData(IData):
|
|||
return self.__attributes[key]
|
||||
|
||||
def getAttributes(self):
|
||||
return self.__attributes.keys()
|
||||
return list(self.__attributes.keys())
|
||||
|
||||
def getDataTime(self):
|
||||
return self.__time
|
||||
|
|
|
@ -45,14 +45,14 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
|||
self.__geometry = geometry
|
||||
self.__dataMap = {}
|
||||
tempDataMap = geoDataRecord.getDataMap()
|
||||
for key, value in tempDataMap.items():
|
||||
for key, value in list(tempDataMap.items()):
|
||||
self.__dataMap[key] = (value[0], value[1], value[2])
|
||||
|
||||
def getGeometry(self):
|
||||
return self.__geometry
|
||||
|
||||
def getParameters(self):
|
||||
return self.__dataMap.keys()
|
||||
return list(self.__dataMap.keys())
|
||||
|
||||
def getString(self, param):
|
||||
value = self.__dataMap[param][0]
|
||||
|
@ -64,7 +64,7 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
|||
if t == 'INT':
|
||||
return int(value)
|
||||
elif t == 'LONG':
|
||||
return long(value)
|
||||
return int(value)
|
||||
elif t == 'FLOAT':
|
||||
return float(value)
|
||||
elif t == 'DOUBLE':
|
||||
|
|
|
@ -128,7 +128,7 @@ def __buildStringList(param):
|
|||
return [str(param)]
|
||||
|
||||
def __notStringIter(iterable):
|
||||
if not isinstance(iterable, basestring):
|
||||
if not isinstance(iterable, str):
|
||||
try:
|
||||
iter(iterable)
|
||||
return True
|
||||
|
@ -226,7 +226,7 @@ class _SoundingTimeLayer(object):
|
|||
A list containing the valid levels for this sounding in order of
|
||||
closest to surface to highest from surface.
|
||||
"""
|
||||
sortedLevels = [Level(level) for level in self._dataDict.keys()]
|
||||
sortedLevels = [Level(level) for level in list(self._dataDict.keys())]
|
||||
sortedLevels.sort()
|
||||
return [str(level) for level in sortedLevels]
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class ThriftClientRouter(object):
|
|||
response = self._client.sendRequest(gridDataRequest)
|
||||
|
||||
locSpecificData = {}
|
||||
locNames = response.getSiteNxValues().keys()
|
||||
locNames = list(response.getSiteNxValues().keys())
|
||||
for location in locNames:
|
||||
nx = response.getSiteNxValues()[location]
|
||||
ny = response.getSiteNyValues()[location]
|
||||
|
@ -114,7 +114,7 @@ class ThriftClientRouter(object):
|
|||
geometries = []
|
||||
for wkb in response.getGeometryWKBs():
|
||||
# convert the wkb to a bytearray with only positive values
|
||||
byteArrWKB = bytearray(map(lambda x: x % 256,wkb.tolist()))
|
||||
byteArrWKB = bytearray([x % 256 for x in wkb.tolist()])
|
||||
# convert the bytearray to a byte string and load it.
|
||||
geometries.append(shapely.wkb.loads(str(byteArrWKB)))
|
||||
|
||||
|
|
|
@ -41,12 +41,11 @@ __all__ = [
|
|||
]
|
||||
|
||||
import abc
|
||||
|
||||
class IDataRequest(object):
|
||||
from six import with_metaclass
|
||||
class IDataRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
"""
|
||||
An IDataRequest to be submitted to the DataAccessLayer to retrieve data.
|
||||
"""
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@abc.abstractmethod
|
||||
def setDatatype(self, datatype):
|
||||
|
@ -164,11 +163,10 @@ class IDataRequest(object):
|
|||
|
||||
|
||||
|
||||
class IData(object):
|
||||
class IData(with_metaclass(abc.ABCMeta, object)):
|
||||
"""
|
||||
An IData representing data returned from the DataAccessLayer.
|
||||
"""
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@abc.abstractmethod
|
||||
def getAttribute(self, key):
|
||||
|
|
|
@ -85,9 +85,9 @@ class IngestViaQPID:
|
|||
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'
|
||||
print('Connected to Qpid')
|
||||
except:
|
||||
print 'Unable to connect to Qpid'
|
||||
print('Unable to connect to Qpid')
|
||||
|
||||
def sendmessage(self, filepath, header):
|
||||
'''
|
||||
|
@ -108,4 +108,4 @@ class IngestViaQPID:
|
|||
there are no threads left open
|
||||
'''
|
||||
self.session.close(timeout=10)
|
||||
print 'Connection to Qpid closed'
|
||||
print('Connection to Qpid closed')
|
||||
|
|
|
@ -87,12 +87,13 @@ import random
|
|||
import re
|
||||
import socket
|
||||
import sys
|
||||
import thread
|
||||
import _thread
|
||||
import threading
|
||||
import time
|
||||
import types
|
||||
import xml.dom.minidom
|
||||
from cStringIO import StringIO
|
||||
from io import StringIO
|
||||
from functools import reduce
|
||||
|
||||
#
|
||||
# stomp.py version number
|
||||
|
@ -106,14 +107,14 @@ def _uuid( *args ):
|
|||
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/213761)
|
||||
"""
|
||||
|
||||
t = long( time.time() * 1000 )
|
||||
r = long( random.random() * 100000000000000000L )
|
||||
t = int( time.time() * 1000 )
|
||||
r = int( random.random() * 100000000000000000 )
|
||||
|
||||
try:
|
||||
a = socket.gethostbyname( socket.gethostname() )
|
||||
except:
|
||||
# if we can't get a network address, just imagine one
|
||||
a = random.random() * 100000000000000000L
|
||||
a = random.random() * 100000000000000000
|
||||
data = str(t) + ' ' + str(r) + ' ' + str(a) + ' ' + str(args)
|
||||
md5 = hashlib.md5()
|
||||
md5.update(data)
|
||||
|
@ -126,7 +127,7 @@ class DevNullLogger(object):
|
|||
dummy logging class for environments without the logging module
|
||||
"""
|
||||
def log(self, msg):
|
||||
print msg
|
||||
print(msg)
|
||||
|
||||
def devnull(self, msg):
|
||||
pass
|
||||
|
@ -371,7 +372,7 @@ class Connection(object):
|
|||
"""
|
||||
self.__running = True
|
||||
self.__attempt_connection()
|
||||
thread.start_new_thread(self.__receiver_loop, ())
|
||||
_thread.start_new_thread(self.__receiver_loop, ())
|
||||
|
||||
def stop(self):
|
||||
"""
|
||||
|
@ -434,7 +435,7 @@ class Connection(object):
|
|||
|
||||
def begin(self, headers={}, **keyword_headers):
|
||||
use_headers = self.__merge_headers([headers, keyword_headers])
|
||||
if not 'transaction' in use_headers.keys():
|
||||
if not 'transaction' in list(use_headers.keys()):
|
||||
use_headers['transaction'] = _uuid()
|
||||
self.__send_frame_helper('BEGIN', '', use_headers, [ 'transaction' ])
|
||||
return use_headers['transaction']
|
||||
|
@ -446,7 +447,7 @@ class Connection(object):
|
|||
self.__send_frame_helper('COMMIT', '', self.__merge_headers([headers, keyword_headers]), [ 'transaction' ])
|
||||
|
||||
def connect(self, headers={}, **keyword_headers):
|
||||
if keyword_headers.has_key('wait') and keyword_headers['wait']:
|
||||
if 'wait' in keyword_headers and keyword_headers['wait']:
|
||||
while not self.is_connected(): time.sleep(0.1)
|
||||
del keyword_headers['wait']
|
||||
self.__send_frame_helper('CONNECT', '', self.__merge_headers([self.__connect_headers, headers, keyword_headers]), [ ])
|
||||
|
@ -490,7 +491,7 @@ class Connection(object):
|
|||
"""
|
||||
headers = {}
|
||||
for header_map in header_map_list:
|
||||
for header_key in header_map.keys():
|
||||
for header_key in list(header_map.keys()):
|
||||
headers[header_key] = header_map[header_key]
|
||||
return headers
|
||||
|
||||
|
@ -532,11 +533,11 @@ class Connection(object):
|
|||
if type(required_header_key) == tuple:
|
||||
found_alternative = False
|
||||
for alternative in required_header_key:
|
||||
if alternative in headers.keys():
|
||||
if alternative in list(headers.keys()):
|
||||
found_alternative = True
|
||||
if not found_alternative:
|
||||
raise KeyError("Command %s requires one of the following headers: %s" % (command, str(required_header_key)))
|
||||
elif not required_header_key in headers.keys():
|
||||
elif not required_header_key in list(headers.keys()):
|
||||
raise KeyError("Command %s requires header %r" % (command, required_header_key))
|
||||
self.__send_frame(command, headers, payload)
|
||||
|
||||
|
@ -550,7 +551,7 @@ class Connection(object):
|
|||
|
||||
if self.__socket is not None:
|
||||
frame = '%s\n%s\n%s\x00' % (command,
|
||||
reduce(lambda accu, key: accu + ('%s:%s\n' % (key, headers[key])), headers.keys(), ''),
|
||||
reduce(lambda accu, key: accu + ('%s:%s\n' % (key, headers[key])), list(headers.keys()), ''),
|
||||
payload)
|
||||
self.__socket.sendall(frame)
|
||||
log.debug("Sent frame: type=%s, headers=%r, body=%r" % (command, headers, payload))
|
||||
|
@ -707,7 +708,7 @@ class Connection(object):
|
|||
assert len(pair) == 2
|
||||
entries[pair[0]] = pair[1]
|
||||
return entries
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
# unable to parse message. return original
|
||||
return body
|
||||
|
||||
|
@ -762,7 +763,7 @@ class Connection(object):
|
|||
break
|
||||
except socket.error:
|
||||
self.__socket = None
|
||||
if type(sys.exc_info()[1]) == types.TupleType:
|
||||
if type(sys.exc_info()[1]) == tuple:
|
||||
exc = sys.exc_info()[1][1]
|
||||
else:
|
||||
exc = sys.exc_info()[1]
|
||||
|
@ -813,20 +814,20 @@ if __name__ == '__main__':
|
|||
self.c.start()
|
||||
|
||||
def __print_async(self, frame_type, headers, body):
|
||||
print "\r \r",
|
||||
print frame_type
|
||||
for header_key in headers.keys():
|
||||
print '%s: %s' % (header_key, headers[header_key])
|
||||
print
|
||||
print body
|
||||
print '> ',
|
||||
print("\r \r", end=' ')
|
||||
print(frame_type)
|
||||
for header_key in list(headers.keys()):
|
||||
print('%s: %s' % (header_key, headers[header_key]))
|
||||
print()
|
||||
print(body)
|
||||
print('> ', end=' ')
|
||||
sys.stdout.flush()
|
||||
|
||||
def on_connecting(self, host_and_port):
|
||||
self.c.connect(wait=True)
|
||||
|
||||
def on_disconnected(self):
|
||||
print "lost connection"
|
||||
print("lost connection")
|
||||
|
||||
def on_message(self, headers, body):
|
||||
self.__print_async("MESSAGE", headers, body)
|
||||
|
@ -850,13 +851,13 @@ if __name__ == '__main__':
|
|||
self.c.abort(transaction=args[1])
|
||||
|
||||
def begin(self, args):
|
||||
print 'transaction id: %s' % self.c.begin()
|
||||
print('transaction id: %s' % self.c.begin())
|
||||
|
||||
def commit(self, args):
|
||||
if len(args) < 2:
|
||||
print 'expecting: commit <transid>'
|
||||
print('expecting: commit <transid>')
|
||||
else:
|
||||
print 'committing %s' % args[1]
|
||||
print('committing %s' % args[1])
|
||||
self.c.commit(transaction=args[1])
|
||||
|
||||
def disconnect(self, args):
|
||||
|
@ -867,35 +868,35 @@ if __name__ == '__main__':
|
|||
|
||||
def send(self, args):
|
||||
if len(args) < 3:
|
||||
print 'expecting: send <destination> <message>'
|
||||
print('expecting: send <destination> <message>')
|
||||
else:
|
||||
self.c.send(destination=args[1], message=' '.join(args[2:]))
|
||||
|
||||
def sendtrans(self, args):
|
||||
if len(args) < 3:
|
||||
print 'expecting: sendtrans <destination> <transid> <message>'
|
||||
print('expecting: sendtrans <destination> <transid> <message>')
|
||||
else:
|
||||
self.c.send(destination=args[1], message="%s\n" % ' '.join(args[3:]), transaction=args[2])
|
||||
|
||||
def subscribe(self, args):
|
||||
if len(args) < 2:
|
||||
print 'expecting: subscribe <destination> [ack]'
|
||||
print('expecting: subscribe <destination> [ack]')
|
||||
elif len(args) > 2:
|
||||
print 'subscribing to "%s" with acknowledge set to "%s"' % (args[1], args[2])
|
||||
print('subscribing to "%s" with acknowledge set to "%s"' % (args[1], args[2]))
|
||||
self.c.subscribe(destination=args[1], ack=args[2])
|
||||
else:
|
||||
print 'subscribing to "%s" with auto acknowledge' % args[1]
|
||||
print('subscribing to "%s" with auto acknowledge' % args[1])
|
||||
self.c.subscribe(destination=args[1], ack='auto')
|
||||
|
||||
def unsubscribe(self, args):
|
||||
if len(args) < 2:
|
||||
print 'expecting: unsubscribe <destination>'
|
||||
print('expecting: unsubscribe <destination>')
|
||||
else:
|
||||
print 'unsubscribing from "%s"' % args[1]
|
||||
print('unsubscribing from "%s"' % args[1])
|
||||
self.c.unsubscribe(destination=args[1])
|
||||
|
||||
if len(sys.argv) > 5:
|
||||
print 'USAGE: stomp.py [host] [port] [user] [passcode]'
|
||||
print('USAGE: stomp.py [host] [port] [user] [passcode]')
|
||||
sys.exit(1)
|
||||
|
||||
if len(sys.argv) >= 2:
|
||||
|
@ -917,7 +918,7 @@ if __name__ == '__main__':
|
|||
st = StompTester(host, port, user, passcode)
|
||||
try:
|
||||
while True:
|
||||
line = raw_input("\r> ")
|
||||
line = input("\r> ")
|
||||
if not line or line.lstrip().rstrip() == '':
|
||||
continue
|
||||
elif 'quit' in line or 'disconnect' in line:
|
||||
|
@ -927,7 +928,7 @@ if __name__ == '__main__':
|
|||
if not command.startswith("on_") and hasattr(st, command):
|
||||
getattr(st, command)(split)
|
||||
else:
|
||||
print 'unrecognized command'
|
||||
print('unrecognized command')
|
||||
finally:
|
||||
st.disconnect(None)
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class ListenThread(threading.Thread):
|
|||
self.qs.topicSubscribe(self.topicName, self.receivedMessage)
|
||||
|
||||
def receivedMessage(self, msg):
|
||||
print "Received message"
|
||||
print("Received message")
|
||||
self.nMessagesReceived += 1
|
||||
if self.waitSecond == 0:
|
||||
fmsg = open('/tmp/rawMessage', 'w')
|
||||
|
@ -66,20 +66,20 @@ class ListenThread(threading.Thread):
|
|||
|
||||
while self.waitSecond < TIME_TO_SLEEP and not self.stopped:
|
||||
if self.waitSecond % 60 == 0:
|
||||
print time.strftime('%H:%M:%S'), "Sleeping and stuck in not so infinite while loop"
|
||||
print(time.strftime('%H:%M:%S'), "Sleeping and stuck in not so infinite while loop")
|
||||
self.waitSecond += 1
|
||||
time.sleep(1)
|
||||
|
||||
print time.strftime('%H:%M:%S'), "Received", self.nMessagesReceived, "messages"
|
||||
print(time.strftime('%H:%M:%S'), "Received", self.nMessagesReceived, "messages")
|
||||
|
||||
def stop(self):
|
||||
print "Stopping"
|
||||
print("Stopping")
|
||||
self.stopped = True
|
||||
self.qs.close()
|
||||
|
||||
|
||||
def main():
|
||||
print "Starting up at", time.strftime('%H:%M:%S')
|
||||
print("Starting up at", time.strftime('%H:%M:%S'))
|
||||
|
||||
topic = 'edex.alerts'
|
||||
host = 'localhost'
|
||||
|
|
|
@ -56,16 +56,16 @@ source_suffix = '.rst'
|
|||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'python-awips'
|
||||
copyright = u'2016, Unidata'
|
||||
author = u'Unidata'
|
||||
project = 'python-awips'
|
||||
copyright = '2016, Unidata'
|
||||
author = 'Unidata'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'0.9.3'
|
||||
version = '0.9.3'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
|
@ -231,8 +231,8 @@ latex_elements = {
|
|||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'python-awips.tex', u'python-awips Documentation',
|
||||
u'Unidata', 'manual'),
|
||||
(master_doc, 'python-awips.tex', 'python-awips Documentation',
|
||||
'Unidata', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
@ -261,7 +261,7 @@ latex_documents = [
|
|||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'python-awips', u'python-awips Documentation',
|
||||
(master_doc, 'python-awips', 'python-awips Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
|
@ -275,7 +275,7 @@ man_pages = [
|
|||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'python-awips', u'python-awips Documentation',
|
||||
(master_doc, 'python-awips', 'python-awips Documentation',
|
||||
author, 'python-awips', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#
|
||||
|
||||
from thrift.transport import TTransport
|
||||
import SelfDescribingBinaryProtocol, ThriftSerializationContext
|
||||
from . import SelfDescribingBinaryProtocol, ThriftSerializationContext
|
||||
|
||||
class DynamicSerializationManager:
|
||||
|
||||
|
|
|
@ -44,13 +44,13 @@ from thrift.Thrift import TType
|
|||
import inspect, sys, types
|
||||
import dynamicserialize
|
||||
from dynamicserialize import dstypes, adapters
|
||||
import SelfDescribingBinaryProtocol
|
||||
from dynamicserialize import SelfDescribingBinaryProtocol
|
||||
import numpy
|
||||
import collections
|
||||
|
||||
dsObjTypes = {}
|
||||
|
||||
def buildObjMap(module):
|
||||
if module.__dict__.has_key('__all__'):
|
||||
if '__all__' in module.__dict__:
|
||||
for i in module.__all__:
|
||||
name = module.__name__ + '.' + i
|
||||
__import__(name)
|
||||
|
@ -65,17 +65,18 @@ def buildObjMap(module):
|
|||
buildObjMap(dstypes)
|
||||
|
||||
pythonToThriftMap = {
|
||||
types.StringType: TType.STRING,
|
||||
types.IntType: TType.I32,
|
||||
types.LongType: TType.I64,
|
||||
types.ListType: TType.LIST,
|
||||
types.DictionaryType: TType.MAP,
|
||||
bytes: TType.STRING,
|
||||
int: TType.I32,
|
||||
int: TType.I64,
|
||||
list: TType.LIST,
|
||||
dict: TType.MAP,
|
||||
type(set([])): TType.SET,
|
||||
types.FloatType: SelfDescribingBinaryProtocol.FLOAT,
|
||||
float: SelfDescribingBinaryProtocol.FLOAT,
|
||||
#types.FloatType: TType.DOUBLE,
|
||||
types.BooleanType: TType.BOOL,
|
||||
types.InstanceType: TType.STRUCT,
|
||||
types.NoneType: TType.VOID,
|
||||
bool: TType.BOOL,
|
||||
object: TType.STRUCT,
|
||||
str: TType.STRING,
|
||||
type(None): TType.VOID,
|
||||
numpy.float32: SelfDescribingBinaryProtocol.FLOAT,
|
||||
numpy.int32: TType.I32,
|
||||
numpy.ndarray: TType.LIST,
|
||||
|
@ -151,17 +152,18 @@ class ThriftSerializationContext(object):
|
|||
|
||||
def deserializeMessage(self):
|
||||
name = self.protocol.readStructBegin()
|
||||
name = name.decode('cp437')
|
||||
name = name.replace('_', '.')
|
||||
if name.isdigit():
|
||||
obj = self._deserializeType(int(name))
|
||||
return obj
|
||||
elif adapters.classAdapterRegistry.has_key(name):
|
||||
elif name in adapters.classAdapterRegistry:
|
||||
return adapters.classAdapterRegistry[name].deserialize(self)
|
||||
elif name.find('$') > -1:
|
||||
# it's an inner class, we're going to hope it's an enum, treat it special
|
||||
fieldName, fieldType, fieldId = self.protocol.readFieldBegin()
|
||||
if fieldName != '__enumValue__':
|
||||
raise dynamiceserialize.SerializationException("Expected to find enum payload. Found: " + fieldName)
|
||||
raise dynamiceserialize.SerializationException(b"Expected to find enum payload. Found: " + fieldName)
|
||||
obj = self.protocol.readString()
|
||||
self.protocol.readFieldEnd()
|
||||
return obj
|
||||
|
@ -176,10 +178,10 @@ class ThriftSerializationContext(object):
|
|||
return obj
|
||||
|
||||
def _deserializeType(self, b):
|
||||
if self.typeDeserializationMethod.has_key(b):
|
||||
if b in self.typeDeserializationMethod:
|
||||
return self.typeDeserializationMethod[b]()
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Unsupported type value " + str(b))
|
||||
raise dynamiceserialize.SerializationException("Unsupported type value " + str(b))
|
||||
|
||||
|
||||
def _deserializeField(self, structname, obj):
|
||||
|
@ -191,17 +193,18 @@ class ThriftSerializationContext(object):
|
|||
# result = adapters.fieldAdapterRegistry[structname][fieldName].deserialize(self)
|
||||
# else:
|
||||
result = self._deserializeType(fieldType)
|
||||
lookingFor = "set" + fieldName[0].upper() + fieldName[1:]
|
||||
fn_str = bytes.decode(fieldName)
|
||||
lookingFor = "set" + fn_str[0].upper() + fn_str[1:]
|
||||
|
||||
try:
|
||||
setMethod = getattr(obj, lookingFor)
|
||||
|
||||
if callable(setMethod):
|
||||
if isinstance(setMethod, collections.Callable):
|
||||
setMethod(result)
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor)
|
||||
raise SerializationException("Couldn't find setter method " + lookingFor)
|
||||
except:
|
||||
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor)
|
||||
raise SerializationException("Couldn't find setter method " + lookingFor)
|
||||
|
||||
self.protocol.readFieldEnd()
|
||||
return True
|
||||
|
@ -213,7 +216,7 @@ class ThriftSerializationContext(object):
|
|||
if size:
|
||||
if listType not in primitiveSupport:
|
||||
m = self.typeDeserializationMethod[listType]
|
||||
result = [m() for n in xrange(size)]
|
||||
result = [m() for n in range(size)]
|
||||
else:
|
||||
result = self.listDeserializationMethod[listType](size)
|
||||
self.protocol.readListEnd()
|
||||
|
@ -222,7 +225,7 @@ class ThriftSerializationContext(object):
|
|||
def _deserializeMap(self):
|
||||
keyType, valueType, size = self.protocol.readMapBegin()
|
||||
result = {}
|
||||
for n in xrange(size):
|
||||
for n in range(size):
|
||||
# can't go off the type, due to java generics limitations dynamic serialize is
|
||||
# serializing keys and values as void
|
||||
key = self.typeDeserializationMethod[TType.STRUCT]()
|
||||
|
@ -234,26 +237,26 @@ class ThriftSerializationContext(object):
|
|||
def _deserializeSet(self):
|
||||
setType, setSize = self.protocol.readSetBegin()
|
||||
result = set([])
|
||||
for n in xrange(setSize):
|
||||
for n in range(setSize):
|
||||
result.add(self.typeDeserializationMethod[TType.STRUCT]())
|
||||
self.protocol.readSetEnd()
|
||||
return result
|
||||
|
||||
def _lookupType(self, obj):
|
||||
pyt = type(obj)
|
||||
if pythonToThriftMap.has_key(pyt):
|
||||
if pyt in pythonToThriftMap:
|
||||
return pythonToThriftMap[pyt]
|
||||
elif pyt.__module__.startswith('dynamicserialize.dstypes'):
|
||||
return pythonToThriftMap[types.InstanceType]
|
||||
return pythonToThriftMap[object]
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Don't know how to serialize object of type: " + str(pyt))
|
||||
|
||||
def serializeMessage(self, obj):
|
||||
|
||||
tt = self._lookupType(obj)
|
||||
|
||||
if tt == TType.STRUCT:
|
||||
fqn = obj.__module__.replace('dynamicserialize.dstypes.', '')
|
||||
if adapters.classAdapterRegistry.has_key(fqn):
|
||||
if fqn in adapters.classAdapterRegistry:
|
||||
# get proper class name when writing class name to serialization stream
|
||||
# in case we have a special inner-class case
|
||||
m = sys.modules[adapters.classAdapterRegistry[fqn].__name__]
|
||||
|
@ -288,12 +291,14 @@ class ThriftSerializationContext(object):
|
|||
self.protocol.writeStructEnd()
|
||||
|
||||
def _serializeField(self, fieldName, fieldType, fieldId, fieldValue):
|
||||
#print("SERFIELD", fieldName, fieldType, fieldId, fieldValue)
|
||||
self.protocol.writeFieldBegin(fieldName, fieldType, fieldId)
|
||||
self._serializeType(fieldValue, fieldType)
|
||||
self.protocol.writeFieldEnd()
|
||||
#print(self.protocol)
|
||||
|
||||
def _serializeType(self, fieldValue, fieldType):
|
||||
if self.typeSerializationMethod.has_key(fieldType):
|
||||
if fieldType in self.typeSerializationMethod:
|
||||
return self.typeSerializationMethod[fieldType](fieldValue)
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Unsupported type value " + str(fieldType))
|
||||
|
@ -335,7 +340,7 @@ class ThriftSerializationContext(object):
|
|||
def _serializeMap(self, obj):
|
||||
size = len(obj)
|
||||
self.protocol.writeMapBegin(TType.VOID, TType.VOID, size)
|
||||
for k in obj.keys():
|
||||
for k in list(obj.keys()):
|
||||
self.typeSerializationMethod[TType.STRUCT](k)
|
||||
self.typeSerializationMethod[TType.STRUCT](obj[k])
|
||||
self.protocol.writeMapEnd()
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
__all__ = [
|
||||
]
|
||||
|
||||
import dstypes, adapters
|
||||
import DynamicSerializationManager
|
||||
from . import dstypes, adapters
|
||||
from . import DynamicSerializationManager
|
||||
|
||||
class SerializationException(Exception):
|
||||
|
||||
|
|
|
@ -52,6 +52,6 @@ def deserialize(context):
|
|||
setSize = context.readI32()
|
||||
enumClassName = context.readString()
|
||||
valList = []
|
||||
for i in xrange(setSize):
|
||||
for i in range(setSize):
|
||||
valList.append(context.readString())
|
||||
return EnumSet(enumClassName, valList)
|
||||
|
|
|
@ -45,7 +45,7 @@ def serialize(context, lockTable):
|
|||
for lock in locks:
|
||||
wsIdString = lock.getWsId().toString()
|
||||
|
||||
if wsIds.has_key(wsIdString):
|
||||
if wsIdString in wsIds:
|
||||
lockWsIdIndex.append(wsIds[wsIdString])
|
||||
else:
|
||||
lockWsIdIndex.append(index)
|
||||
|
@ -68,12 +68,12 @@ def deserialize(context):
|
|||
parmId = context.readObject()
|
||||
numWsIds = context.readI32()
|
||||
wsIds = []
|
||||
for x in xrange(numWsIds):
|
||||
for x in range(numWsIds):
|
||||
wsIds.append(context.readObject())
|
||||
|
||||
numLocks = context.readI32()
|
||||
locks = []
|
||||
for x in xrange(numLocks):
|
||||
for x in range(numLocks):
|
||||
startTime = context.readI64()
|
||||
endTime = context.readI64()
|
||||
wsId = wsIds[context.readI32()]
|
||||
|
|
|
@ -52,7 +52,7 @@ def deserialize(context):
|
|||
wsId.setUserName(wsIdParts[1])
|
||||
wsId.setProgName(wsIdParts[2])
|
||||
wsId.setPid(wsIdParts[3])
|
||||
wsId.setThreadId(long(wsIdParts[4]))
|
||||
wsId.setThreadId(int(wsIdParts[4]))
|
||||
|
||||
return wsId
|
||||
|
||||
|
|
|
@ -66,10 +66,10 @@ classAdapterRegistry = {}
|
|||
def getAdapterRegistry():
|
||||
import sys
|
||||
for x in __all__:
|
||||
exec 'import ' + x
|
||||
exec('import dynamicserialize.adapters.' + x )
|
||||
m = sys.modules['dynamicserialize.adapters.' + x]
|
||||
d = m.__dict__
|
||||
if d.has_key('ClassAdapter'):
|
||||
if 'ClassAdapter' in d:
|
||||
if isinstance(m.ClassAdapter, list):
|
||||
for clz in m.ClassAdapter:
|
||||
classAdapterRegistry[clz] = m
|
||||
|
|
|
@ -26,4 +26,3 @@ __all__ = [
|
|||
'java'
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -26,12 +26,10 @@
|
|||
#
|
||||
##
|
||||
|
||||
import ActiveTableKey
|
||||
from . import ActiveTableKey
|
||||
import abc
|
||||
|
||||
class ActiveTableRecord(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
from six import with_metaclass
|
||||
class ActiveTableRecord(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.key = ActiveTableKey.ActiveTableKey()
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#
|
||||
##
|
||||
|
||||
import ActiveTableRecord
|
||||
from . import ActiveTableRecord
|
||||
|
||||
class OperationalActiveTableRecord(ActiveTableRecord.ActiveTableRecord):
|
||||
class OperationalActiveTableRecord(ActiveTableRecord):
|
||||
|
||||
def __init__(self):
|
||||
super(OperationalActiveTableRecord, self).__init__()
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#
|
||||
##
|
||||
|
||||
import ActiveTableRecord
|
||||
from . import ActiveTableRecord
|
||||
|
||||
class PracticeActiveTableRecord(ActiveTableRecord.ActiveTableRecord):
|
||||
class PracticeActiveTableRecord(ActiveTableRecord):
|
||||
|
||||
def __init__(self):
|
||||
super(PracticeActiveTableRecord, self).__init__()
|
||||
|
|
|
@ -41,20 +41,20 @@ __all__ = [
|
|||
'response'
|
||||
]
|
||||
|
||||
from ActiveTableKey import ActiveTableKey
|
||||
from ActiveTableRecord import ActiveTableRecord
|
||||
from ActiveTableMode import ActiveTableMode
|
||||
from DumpActiveTableRequest import DumpActiveTableRequest
|
||||
from DumpActiveTableResponse import DumpActiveTableResponse
|
||||
from GetActiveTableDictRequest import GetActiveTableDictRequest
|
||||
from GetActiveTableDictResponse import GetActiveTableDictResponse
|
||||
from GetFourCharSitesRequest import GetFourCharSitesRequest
|
||||
from GetFourCharSitesResponse import GetFourCharSitesResponse
|
||||
from GetVtecAttributeRequest import GetVtecAttributeRequest
|
||||
from GetVtecAttributeResponse import GetVtecAttributeResponse
|
||||
from OperationalActiveTableRecord import OperationalActiveTableRecord
|
||||
from PracticeActiveTableRecord import PracticeActiveTableRecord
|
||||
from SendPracticeProductRequest import SendPracticeProductRequest
|
||||
from VTECChange import VTECChange
|
||||
from VTECTableChangeNotification import VTECTableChangeNotification
|
||||
from .ActiveTableKey import ActiveTableKey
|
||||
from .ActiveTableRecord import ActiveTableRecord
|
||||
from .ActiveTableMode import ActiveTableMode
|
||||
from .DumpActiveTableRequest import DumpActiveTableRequest
|
||||
from .DumpActiveTableResponse import DumpActiveTableResponse
|
||||
from .GetActiveTableDictRequest import GetActiveTableDictRequest
|
||||
from .GetActiveTableDictResponse import GetActiveTableDictResponse
|
||||
from .GetFourCharSitesRequest import GetFourCharSitesRequest
|
||||
from .GetFourCharSitesResponse import GetFourCharSitesResponse
|
||||
from .GetVtecAttributeRequest import GetVtecAttributeRequest
|
||||
from .GetVtecAttributeResponse import GetVtecAttributeResponse
|
||||
from .OperationalActiveTableRecord import OperationalActiveTableRecord
|
||||
from .PracticeActiveTableRecord import PracticeActiveTableRecord
|
||||
from .SendPracticeProductRequest import SendPracticeProductRequest
|
||||
from .VTECChange import VTECChange
|
||||
from .VTECTableChangeNotification import VTECTableChangeNotification
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ __all__ = [
|
|||
'SendActiveTableRequest'
|
||||
]
|
||||
|
||||
from ClearPracticeVTECTableRequest import ClearPracticeVTECTableRequest
|
||||
from MergeActiveTableRequest import MergeActiveTableRequest
|
||||
from RetrieveRemoteActiveTableRequest import RetrieveRemoteActiveTableRequest
|
||||
from SendActiveTableRequest import SendActiveTableRequest
|
||||
from .ClearPracticeVTECTableRequest import ClearPracticeVTECTableRequest
|
||||
from .MergeActiveTableRequest import MergeActiveTableRequest
|
||||
from .RetrieveRemoteActiveTableRequest import RetrieveRemoteActiveTableRequest
|
||||
from .SendActiveTableRequest import SendActiveTableRequest
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'ActiveTableSharingResponse'
|
||||
]
|
||||
|
||||
from ActiveTableSharingResponse import ActiveTableSharingResponse
|
||||
from .ActiveTableSharingResponse import ActiveTableSharingResponse
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'AlertVizRequest'
|
||||
]
|
||||
|
||||
from AlertVizRequest import AlertVizRequest
|
||||
from .AlertVizRequest import AlertVizRequest
|
||||
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
|
||||
import abc
|
||||
|
||||
from six import with_metaclass
|
||||
|
||||
class AbstractFailedResponse(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class AbstractFailedResponse(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.request = None
|
||||
|
|
|
@ -27,8 +27,8 @@ __all__ = [
|
|||
'UserNotAuthorized'
|
||||
]
|
||||
|
||||
from AbstractFailedResponse import AbstractFailedResponse
|
||||
from AuthServerErrorResponse import AuthServerErrorResponse
|
||||
from SuccessfulExecution import SuccessfulExecution
|
||||
from UserNotAuthorized import UserNotAuthorized
|
||||
from .AbstractFailedResponse import AbstractFailedResponse
|
||||
from .AuthServerErrorResponse import AuthServerErrorResponse
|
||||
from .SuccessfulExecution import SuccessfulExecution
|
||||
from .UserNotAuthorized import UserNotAuthorized
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@ __all__ = [
|
|||
'AuthenticationData'
|
||||
]
|
||||
|
||||
from AuthenticationData import AuthenticationData
|
||||
from .AuthenticationData import AuthenticationData
|
||||
|
|
|
@ -56,10 +56,10 @@ class DefaultDataRequest(IDataRequest):
|
|||
del self.identifiers[key]
|
||||
|
||||
def setParameters(self, *params):
|
||||
self.parameters = map(str, params)
|
||||
self.parameters = list(map(str, params))
|
||||
|
||||
def setLevels(self, *levels):
|
||||
self.levels = map(self.__makeLevel, levels)
|
||||
self.levels = list(map(self.__makeLevel, levels))
|
||||
|
||||
def __makeLevel(self, level):
|
||||
if type(level) is Level:
|
||||
|
@ -73,7 +73,7 @@ class DefaultDataRequest(IDataRequest):
|
|||
self.envelope = Envelope(env.envelope)
|
||||
|
||||
def setLocationNames(self, *locationNames):
|
||||
self.locationNames = map(str, locationNames)
|
||||
self.locationNames = list(map(str, locationNames))
|
||||
|
||||
def getDatatype(self):
|
||||
return self.datatype
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'DefaultDataRequest'
|
||||
]
|
||||
|
||||
from DefaultDataRequest import DefaultDataRequest
|
||||
from .DefaultDataRequest import DefaultDataRequest
|
||||
|
||||
|
|
|
@ -31,10 +31,8 @@
|
|||
|
||||
import abc
|
||||
|
||||
|
||||
class AbstractDataAccessRequest(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
from six import with_metaclass
|
||||
class AbstractDataAccessRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
def __init__(self):
|
||||
self.requestParameters = None
|
||||
|
||||
|
|
|
@ -30,10 +30,9 @@
|
|||
#
|
||||
|
||||
import abc
|
||||
from six import with_metaclass
|
||||
|
||||
class AbstractIdentifierRequest(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class AbstractIdentifierRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
def __init__(self):
|
||||
self.datatype = None
|
||||
|
||||
|
|
|
@ -34,15 +34,15 @@ __all__ = [
|
|||
'GetOptionalIdentifiersRequest'
|
||||
]
|
||||
|
||||
from AbstractDataAccessRequest import AbstractDataAccessRequest
|
||||
from AbstractIdentifierRequest import AbstractIdentifierRequest
|
||||
from GetAvailableLevelsRequest import GetAvailableLevelsRequest
|
||||
from GetAvailableLocationNamesRequest import GetAvailableLocationNamesRequest
|
||||
from GetAvailableParametersRequest import GetAvailableParametersRequest
|
||||
from GetAvailableTimesRequest import GetAvailableTimesRequest
|
||||
from GetGeometryDataRequest import GetGeometryDataRequest
|
||||
from GetGridDataRequest import GetGridDataRequest
|
||||
from GetRequiredIdentifiersRequest import GetRequiredIdentifiersRequest
|
||||
from GetSupportedDatatypesRequest import GetSupportedDatatypesRequest
|
||||
from GetOptionalIdentifiersRequest import GetOptionalIdentifiersRequest
|
||||
from .AbstractDataAccessRequest import AbstractDataAccessRequest
|
||||
from .AbstractIdentifierRequest import AbstractIdentifierRequest
|
||||
from .GetAvailableLevelsRequest import GetAvailableLevelsRequest
|
||||
from .GetAvailableLocationNamesRequest import GetAvailableLocationNamesRequest
|
||||
from .GetAvailableParametersRequest import GetAvailableParametersRequest
|
||||
from .GetAvailableTimesRequest import GetAvailableTimesRequest
|
||||
from .GetGeometryDataRequest import GetGeometryDataRequest
|
||||
from .GetGridDataRequest import GetGridDataRequest
|
||||
from .GetRequiredIdentifiersRequest import GetRequiredIdentifiersRequest
|
||||
from .GetSupportedDatatypesRequest import GetSupportedDatatypesRequest
|
||||
from .GetOptionalIdentifiersRequest import GetOptionalIdentifiersRequest
|
||||
|
||||
|
|
|
@ -21,11 +21,10 @@
|
|||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
|
||||
import abc
|
||||
from six import with_metaclass
|
||||
|
||||
|
||||
class AbstractResponseData(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class AbstractResponseData(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.time = None
|
||||
|
|
|
@ -28,9 +28,9 @@ __all__ = [
|
|||
'GridResponseData'
|
||||
]
|
||||
|
||||
from AbstractResponseData import AbstractResponseData
|
||||
from GeometryResponseData import GeometryResponseData
|
||||
from GetGeometryDataResponse import GetGeometryDataResponse
|
||||
from GetGridDataResponse import GetGridDataResponse
|
||||
from GridResponseData import GridResponseData
|
||||
from .AbstractResponseData import AbstractResponseData
|
||||
from .GeometryResponseData import GeometryResponseData
|
||||
from .GetGeometryDataResponse import GetGeometryDataResponse
|
||||
from .GetGridDataResponse import GetGridDataResponse
|
||||
from .GridResponseData import GridResponseData
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'RegionLookupRequest'
|
||||
]
|
||||
|
||||
from RegionLookupRequest import RegionLookupRequest
|
||||
from .RegionLookupRequest import RegionLookupRequest
|
||||
|
||||
|
|
|
@ -39,5 +39,5 @@ __all__ = [
|
|||
'weather'
|
||||
]
|
||||
|
||||
from GridDataHistory import GridDataHistory
|
||||
from .GridDataHistory import GridDataHistory
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'ProjectionData'
|
||||
]
|
||||
|
||||
from ProjectionData import ProjectionData
|
||||
from .ProjectionData import ProjectionData
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@ __all__ = [
|
|||
'TimeConstraints'
|
||||
]
|
||||
|
||||
from DatabaseID import DatabaseID
|
||||
from GFERecord import GFERecord
|
||||
from GridLocation import GridLocation
|
||||
from GridParmInfo import GridParmInfo
|
||||
from ParmID import ParmID
|
||||
from TimeConstraints import TimeConstraints
|
||||
from .DatabaseID import DatabaseID
|
||||
from .GFERecord import GFERecord
|
||||
from .GridLocation import GridLocation
|
||||
from .GridParmInfo import GridParmInfo
|
||||
from .ParmID import ParmID
|
||||
from .TimeConstraints import TimeConstraints
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'DiscreteKey'
|
||||
]
|
||||
|
||||
from DiscreteKey import DiscreteKey
|
||||
from .DiscreteKey import DiscreteKey
|
||||
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'Grid2DFloat'
|
||||
]
|
||||
|
||||
from Grid2DByte import Grid2DByte
|
||||
from Grid2DFloat import Grid2DFloat
|
||||
from .Grid2DByte import Grid2DByte
|
||||
from .Grid2DFloat import Grid2DFloat
|
||||
|
||||
|
|
|
@ -21,11 +21,10 @@
|
|||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
|
||||
import abc
|
||||
from six import with_metaclass
|
||||
|
||||
|
||||
class AbstractGfeRequest(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class AbstractGfeRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.siteID = None
|
||||
|
|
|
@ -23,11 +23,10 @@
|
|||
import abc
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.request import GetGridRequest
|
||||
from six import with_metaclass
|
||||
|
||||
|
||||
class GetGridDataRequest(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.requests = []
|
||||
|
|
|
@ -54,30 +54,30 @@ __all__ = [
|
|||
'RsyncGridsToCWFRequest',
|
||||
]
|
||||
|
||||
from AbstractGfeRequest import AbstractGfeRequest
|
||||
from CommitGridsRequest import CommitGridsRequest
|
||||
from ConfigureTextProductsRequest import ConfigureTextProductsRequest
|
||||
from ExecuteIfpNetCDFGridRequest import ExecuteIfpNetCDFGridRequest
|
||||
from ExecuteIscMosaicRequest import ExecuteIscMosaicRequest
|
||||
from ExportGridsRequest import ExportGridsRequest
|
||||
from GetASCIIGridsRequest import GetASCIIGridsRequest
|
||||
from GetGridDataRequest import GetGridDataRequest
|
||||
from GetGridInventoryRequest import GetGridInventoryRequest
|
||||
from GetLatestDbTimeRequest import GetLatestDbTimeRequest
|
||||
from GetLatestModelDbIdRequest import GetLatestModelDbIdRequest
|
||||
from GetLockTablesRequest import GetLockTablesRequest
|
||||
from GetOfficialDbNameRequest import GetOfficialDbNameRequest
|
||||
from GetParmListRequest import GetParmListRequest
|
||||
from GetSelectTimeRangeRequest import GetSelectTimeRangeRequest
|
||||
from GetSingletonDbIdsRequest import GetSingletonDbIdsRequest
|
||||
from GetSiteTimeZoneInfoRequest import GetSiteTimeZoneInfoRequest
|
||||
from GridLocRequest import GridLocRequest
|
||||
from IscDataRecRequest import IscDataRecRequest
|
||||
from LockChangeRequest import LockChangeRequest
|
||||
from ProcessReceivedConfRequest import ProcessReceivedConfRequest
|
||||
from ProcessReceivedDigitalDataRequest import ProcessReceivedDigitalDataRequest
|
||||
from PurgeGfeGridsRequest import PurgeGfeGridsRequest
|
||||
from SaveASCIIGridsRequest import SaveASCIIGridsRequest
|
||||
from SmartInitRequest import SmartInitRequest
|
||||
from RsyncGridsToCWFRequest import RsyncGridsToCWFRequest
|
||||
from .AbstractGfeRequest import AbstractGfeRequest
|
||||
from .CommitGridsRequest import CommitGridsRequest
|
||||
from .ConfigureTextProductsRequest import ConfigureTextProductsRequest
|
||||
from .ExecuteIfpNetCDFGridRequest import ExecuteIfpNetCDFGridRequest
|
||||
from .ExecuteIscMosaicRequest import ExecuteIscMosaicRequest
|
||||
from .ExportGridsRequest import ExportGridsRequest
|
||||
from .GetASCIIGridsRequest import GetASCIIGridsRequest
|
||||
from .GetGridDataRequest import GetGridDataRequest
|
||||
from .GetGridInventoryRequest import GetGridInventoryRequest
|
||||
from .GetLatestDbTimeRequest import GetLatestDbTimeRequest
|
||||
from .GetLatestModelDbIdRequest import GetLatestModelDbIdRequest
|
||||
from .GetLockTablesRequest import GetLockTablesRequest
|
||||
from .GetOfficialDbNameRequest import GetOfficialDbNameRequest
|
||||
from .GetParmListRequest import GetParmListRequest
|
||||
from .GetSelectTimeRangeRequest import GetSelectTimeRangeRequest
|
||||
from .GetSingletonDbIdsRequest import GetSingletonDbIdsRequest
|
||||
from .GetSiteTimeZoneInfoRequest import GetSiteTimeZoneInfoRequest
|
||||
from .GridLocRequest import GridLocRequest
|
||||
from .IscDataRecRequest import IscDataRecRequest
|
||||
from .LockChangeRequest import LockChangeRequest
|
||||
from .ProcessReceivedConfRequest import ProcessReceivedConfRequest
|
||||
from .ProcessReceivedDigitalDataRequest import ProcessReceivedDigitalDataRequest
|
||||
from .PurgeGfeGridsRequest import PurgeGfeGridsRequest
|
||||
from .SaveASCIIGridsRequest import SaveASCIIGridsRequest
|
||||
from .SmartInitRequest import SmartInitRequest
|
||||
from .RsyncGridsToCWFRequest import RsyncGridsToCWFRequest
|
||||
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'LockTable'
|
||||
]
|
||||
|
||||
from Lock import Lock
|
||||
from LockTable import LockTable
|
||||
from .Lock import Lock
|
||||
from .LockTable import LockTable
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ class ServerResponse(object):
|
|||
def __str__(self):
|
||||
return self.message()
|
||||
|
||||
def __nonzero__(self):
|
||||
def __bool__(self):
|
||||
return self.isOkay()
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'ServerResponse'
|
||||
]
|
||||
|
||||
from ServerMsg import ServerMsg
|
||||
from ServerResponse import ServerResponse
|
||||
from .ServerMsg import ServerMsg
|
||||
from .ServerResponse import ServerResponse
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
from . import GfeNotification
|
||||
|
||||
class CombinationsFileChangedNotification(GfeNotification.GfeNotification):
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
from . import GfeNotification
|
||||
|
||||
class DBInvChangeNotification(GfeNotification.GfeNotification):
|
||||
|
||||
|
|
|
@ -25,10 +25,9 @@
|
|||
#
|
||||
##
|
||||
import abc
|
||||
from six import with_metaclass
|
||||
|
||||
class GfeNotification(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class GfeNotification(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.siteID = None
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
from . import GfeNotification
|
||||
|
||||
class GridHistoryUpdateNotification(GfeNotification.GfeNotification):
|
||||
class GridHistoryUpdateNotification(GfeNotification):
|
||||
|
||||
def __init__(self):
|
||||
super(GridHistoryUpdateNotification, self).__init__()
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
from . import GfeNotification
|
||||
|
||||
class GridUpdateNotification(GfeNotification.GfeNotification):
|
||||
class GridUpdateNotification(GfeNotification):
|
||||
|
||||
def __init__(self):
|
||||
super(GridUpdateNotification, self).__init__()
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
from . import GfeNotification
|
||||
|
||||
class LockNotification(GfeNotification.GfeNotification):
|
||||
class LockNotification(GfeNotification):
|
||||
|
||||
def __init__(self):
|
||||
super(LockNotification, self).__init__()
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
from . import GfeNotification
|
||||
|
||||
class ServiceBackupJobStatusNotification(GfeNotification.GfeNotification):
|
||||
class ServiceBackupJobStatusNotification(GfeNotification):
|
||||
|
||||
def __init__(self):
|
||||
super(ServiceBackupJobStatusNotification, self).__init__()
|
||||
|
|
|
@ -26,9 +26,8 @@
|
|||
#
|
||||
##
|
||||
|
||||
import GfeNotification
|
||||
|
||||
class UserMessageNotification(GfeNotification.GfeNotification):
|
||||
from . import GfeNotification
|
||||
class UserMessageNotification(GfeNotification):
|
||||
|
||||
def __init__(self):
|
||||
super(UserMessageNotification, self).__init__()
|
||||
|
|
|
@ -31,12 +31,12 @@ __all__ = [
|
|||
'UserMessageNotification'
|
||||
]
|
||||
|
||||
from CombinationsFileChangedNotification import CombinationsFileChangedNotification
|
||||
from DBInvChangeNotification import DBInvChangeNotification
|
||||
from GfeNotification import GfeNotification
|
||||
from GridHistoryUpdateNotification import GridHistoryUpdateNotification
|
||||
from GridUpdateNotification import GridUpdateNotification
|
||||
from LockNotification import LockNotification
|
||||
from ServiceBackupJobStatusNotification import ServiceBackupJobStatusNotification
|
||||
from UserMessageNotification import UserMessageNotification
|
||||
from .CombinationsFileChangedNotification import CombinationsFileChangedNotification
|
||||
from .DBInvChangeNotification import DBInvChangeNotification
|
||||
from .GfeNotification import GfeNotification
|
||||
from .GridHistoryUpdateNotification import GridHistoryUpdateNotification
|
||||
from .GridUpdateNotification import GridUpdateNotification
|
||||
from .LockNotification import LockNotification
|
||||
from .ServiceBackupJobStatusNotification import ServiceBackupJobStatusNotification
|
||||
from .UserMessageNotification import UserMessageNotification
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ __all__ = [
|
|||
'LockTableRequest'
|
||||
]
|
||||
|
||||
from CommitGridRequest import CommitGridRequest
|
||||
from GetGridRequest import GetGridRequest
|
||||
from LockRequest import LockRequest
|
||||
from LockTableRequest import LockTableRequest
|
||||
from .CommitGridRequest import CommitGridRequest
|
||||
from .GetGridRequest import GetGridRequest
|
||||
from .LockRequest import LockRequest
|
||||
from .LockTableRequest import LockTableRequest
|
||||
|
||||
|
|
|
@ -19,11 +19,9 @@
|
|||
##
|
||||
|
||||
import abc
|
||||
from six import with_metaclass
|
||||
|
||||
|
||||
class AbstractGridSlice(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class AbstractGridSlice(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.validTime = None
|
||||
|
|
|
@ -28,9 +28,9 @@ __all__ = [
|
|||
'WeatherGridSlice'
|
||||
]
|
||||
|
||||
from AbstractGridSlice import AbstractGridSlice
|
||||
from DiscreteGridSlice import DiscreteGridSlice
|
||||
from ScalarGridSlice import ScalarGridSlice
|
||||
from VectorGridSlice import VectorGridSlice
|
||||
from WeatherGridSlice import WeatherGridSlice
|
||||
from .AbstractGridSlice import AbstractGridSlice
|
||||
from .DiscreteGridSlice import DiscreteGridSlice
|
||||
from .ScalarGridSlice import ScalarGridSlice
|
||||
from .VectorGridSlice import VectorGridSlice
|
||||
from .WeatherGridSlice import WeatherGridSlice
|
||||
|
||||
|
|
|
@ -30,4 +30,4 @@ __all__ = [
|
|||
'JobProgress',
|
||||
]
|
||||
|
||||
from JobProgress import JobProgress
|
||||
from .JobProgress import JobProgress
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'WeatherSubKey'
|
||||
]
|
||||
|
||||
from WeatherKey import WeatherKey
|
||||
from WeatherSubKey import WeatherSubKey
|
||||
from .WeatherKey import WeatherKey
|
||||
from .WeatherSubKey import WeatherSubKey
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'DeleteAllGridDataRequest'
|
||||
]
|
||||
|
||||
from DeleteAllGridDataRequest import DeleteAllGridDataRequest
|
||||
from .DeleteAllGridDataRequest import DeleteAllGridDataRequest
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
import numpy
|
||||
import re
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.level import MasterLevel
|
||||
from .MasterLevel import MasterLevel
|
||||
|
||||
|
||||
LEVEL_NAMING_REGEX = re.compile("^(\d*(?:\.\d*)?)(?:_(\d*(?:\.\d*)?))?([a-zA-Z]+)$")
|
||||
|
@ -45,7 +45,7 @@ INVALID_VALUE = numpy.float64(-999999)
|
|||
class Level(object):
|
||||
|
||||
def __init__(self, levelString=None):
|
||||
self.id = 0L
|
||||
self.id = 0
|
||||
self.identifier = None
|
||||
self.masterLevel = None
|
||||
self.levelonevalue = INVALID_VALUE
|
||||
|
@ -55,7 +55,7 @@ class Level(object):
|
|||
matcher = LEVEL_NAMING_REGEX.match(str(levelString))
|
||||
if matcher is not None:
|
||||
self.levelonevalue = numpy.float64(matcher.group(1))
|
||||
self.masterLevel = MasterLevel.MasterLevel(matcher.group(3))
|
||||
self.masterLevel = MasterLevel(matcher.group(3))
|
||||
levelTwo = matcher.group(2)
|
||||
if levelTwo:
|
||||
self.leveltwovalue = numpy.float64(levelTwo)
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'MasterLevel'
|
||||
]
|
||||
|
||||
from Level import Level
|
||||
from MasterLevel import MasterLevel
|
||||
from .Level import Level
|
||||
from .MasterLevel import MasterLevel
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'DataURINotificationMessage'
|
||||
]
|
||||
|
||||
from DataURINotificationMessage import DataURINotificationMessage
|
||||
from .DataURINotificationMessage import DataURINotificationMessage
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'GetRadarDataRecordRequest'
|
||||
]
|
||||
|
||||
from GetRadarDataRecordRequest import GetRadarDataRecordRequest
|
||||
from .GetRadarDataRecordRequest import GetRadarDataRecordRequest
|
||||
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'RadarDataRecord'
|
||||
]
|
||||
|
||||
from GetRadarDataRecordResponse import GetRadarDataRecordResponse
|
||||
from RadarDataRecord import RadarDataRecord
|
||||
from .GetRadarDataRecordResponse import GetRadarDataRecordResponse
|
||||
from .RadarDataRecord import RadarDataRecord
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'TextDBRequest'
|
||||
]
|
||||
|
||||
from TextDBRequest import TextDBRequest
|
||||
from .TextDBRequest import TextDBRequest
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'SubscriptionRequest'
|
||||
]
|
||||
|
||||
from SubscriptionRequest import SubscriptionRequest
|
||||
from .SubscriptionRequest import SubscriptionRequest
|
||||
|
||||
|
|
|
@ -40,6 +40,6 @@ __all__ = [
|
|||
'StorageStatus',
|
||||
]
|
||||
|
||||
from Request import Request
|
||||
from StorageProperties import StorageProperties
|
||||
from StorageStatus import StorageStatus
|
||||
from .Request import Request
|
||||
from .StorageProperties import StorageProperties
|
||||
from .StorageStatus import StorageStatus
|
||||
|
|
|
@ -43,11 +43,11 @@ __all__ = [
|
|||
'StringDataRecord'
|
||||
]
|
||||
|
||||
from ByteDataRecord import ByteDataRecord
|
||||
from DoubleDataRecord import DoubleDataRecord
|
||||
from FloatDataRecord import FloatDataRecord
|
||||
from IntegerDataRecord import IntegerDataRecord
|
||||
from LongDataRecord import LongDataRecord
|
||||
from ShortDataRecord import ShortDataRecord
|
||||
from StringDataRecord import StringDataRecord
|
||||
from .ByteDataRecord import ByteDataRecord
|
||||
from .DoubleDataRecord import DoubleDataRecord
|
||||
from .FloatDataRecord import FloatDataRecord
|
||||
from .IntegerDataRecord import IntegerDataRecord
|
||||
from .LongDataRecord import LongDataRecord
|
||||
from .ShortDataRecord import ShortDataRecord
|
||||
from .StringDataRecord import StringDataRecord
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ knownLevels = {"BASE": {"text" : "BASE",
|
|||
class LocalizationLevel(object):
|
||||
|
||||
def __init__(self, level, order=750, systemLevel=False):
|
||||
if knownLevels.has_key(level.upper()):
|
||||
if level.upper() in knownLevels:
|
||||
self.text = level.upper()
|
||||
self.order = knownLevels[self.text]["order"]
|
||||
self.systemLevel = knownLevels[self.text]["systemLevel"]
|
||||
|
|
|
@ -28,7 +28,7 @@ __all__ = [
|
|||
'stream'
|
||||
]
|
||||
|
||||
from LocalizationContext import LocalizationContext
|
||||
from LocalizationLevel import LocalizationLevel
|
||||
from LocalizationType import LocalizationType
|
||||
from .LocalizationContext import LocalizationContext
|
||||
from .LocalizationLevel import LocalizationLevel
|
||||
from .LocalizationType import LocalizationType
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@ __all__ = [
|
|||
'UtilityResponseMessage'
|
||||
]
|
||||
|
||||
from DeleteUtilityCommand import DeleteUtilityCommand
|
||||
from DeleteUtilityResponse import DeleteUtilityResponse
|
||||
from ListResponseEntry import ListResponseEntry
|
||||
from ListUtilityCommand import ListUtilityCommand
|
||||
from ListUtilityResponse import ListUtilityResponse
|
||||
from PrivilegedUtilityRequestMessage import PrivilegedUtilityRequestMessage
|
||||
from UtilityRequestMessage import UtilityRequestMessage
|
||||
from UtilityResponseMessage import UtilityResponseMessage
|
||||
from .DeleteUtilityCommand import DeleteUtilityCommand
|
||||
from .DeleteUtilityResponse import DeleteUtilityResponse
|
||||
from .ListResponseEntry import ListResponseEntry
|
||||
from .ListUtilityCommand import ListUtilityCommand
|
||||
from .ListUtilityResponse import ListUtilityResponse
|
||||
from .PrivilegedUtilityRequestMessage import PrivilegedUtilityRequestMessage
|
||||
from .UtilityRequestMessage import UtilityRequestMessage
|
||||
from .UtilityResponseMessage import UtilityResponseMessage
|
||||
|
||||
|
|
|
@ -23,10 +23,9 @@
|
|||
import abc
|
||||
import os
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.plugin.nwsauth.user import User
|
||||
from six import with_metaclass
|
||||
|
||||
class AbstractLocalizationStreamRequest(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
@abc.abstractmethod
|
||||
def __init__(self):
|
||||
self.context = None
|
||||
|
|
|
@ -26,7 +26,7 @@ __all__ = [
|
|||
'LocalizationStreamPutRequest'
|
||||
]
|
||||
|
||||
from AbstractLocalizationStreamRequest import AbstractLocalizationStreamRequest
|
||||
from LocalizationStreamGetRequest import LocalizationStreamGetRequest
|
||||
from LocalizationStreamPutRequest import LocalizationStreamPutRequest
|
||||
from .AbstractLocalizationStreamRequest import AbstractLocalizationStreamRequest
|
||||
from .LocalizationStreamGetRequest import LocalizationStreamGetRequest
|
||||
from .LocalizationStreamPutRequest import LocalizationStreamPutRequest
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@ __all__ = [
|
|||
'diagnostic'
|
||||
]
|
||||
|
||||
from ChangeContextRequest import ChangeContextRequest
|
||||
from PassThroughRequest import PassThroughRequest
|
||||
from .ChangeContextRequest import ChangeContextRequest
|
||||
from .PassThroughRequest import PassThroughRequest
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ __all__ = [
|
|||
'StatusRequest'
|
||||
]
|
||||
|
||||
from GetClusterMembersRequest import GetClusterMembersRequest
|
||||
from GetContextsRequest import GetContextsRequest
|
||||
from StatusRequest import StatusRequest
|
||||
from .GetClusterMembersRequest import GetClusterMembersRequest
|
||||
from .GetContextsRequest import GetContextsRequest
|
||||
from .StatusRequest import StatusRequest
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ __all__ = [
|
|||
'StatusResponse'
|
||||
]
|
||||
|
||||
from ClusterMembersResponse import ClusterMembersResponse
|
||||
from ContextsResponse import ContextsResponse
|
||||
from StatusResponse import StatusResponse
|
||||
from .ClusterMembersResponse import ClusterMembersResponse
|
||||
from .ContextsResponse import ContextsResponse
|
||||
from .StatusResponse import StatusResponse
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
|
||||
from Property import Property
|
||||
from .Property import Property
|
||||
|
||||
class Header(object):
|
||||
|
||||
|
@ -31,7 +31,7 @@ class Header(object):
|
|||
self.properties = properties
|
||||
|
||||
if multimap is not None:
|
||||
for k, l in multimap.iteritems():
|
||||
for k, l in multimap.items():
|
||||
for v in l:
|
||||
self.properties.append(Property(k, v))
|
||||
|
||||
|
|
|
@ -31,7 +31,10 @@ import struct
|
|||
import socket
|
||||
import os
|
||||
import pwd
|
||||
import thread
|
||||
try:
|
||||
import _thread
|
||||
except ImportError:
|
||||
import thread as _thread
|
||||
|
||||
class WsId(object):
|
||||
|
||||
|
@ -50,7 +53,7 @@ class WsId(object):
|
|||
|
||||
self.pid = os.getpid()
|
||||
|
||||
self.threadId = long(thread.get_ident())
|
||||
self.threadId = int(_thread.get_ident())
|
||||
|
||||
def getNetworkId(self):
|
||||
return self.networkId
|
||||
|
|
|
@ -40,8 +40,8 @@ __all__ = [
|
|||
#
|
||||
|
||||
|
||||
from Body import Body
|
||||
from Header import Header
|
||||
from Message import Message
|
||||
from Property import Property
|
||||
from WsId import WsId
|
||||
from .Body import Body
|
||||
from .Header import Header
|
||||
from .Message import Message
|
||||
from .Property import Property
|
||||
from .WsId import WsId
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'UserId'
|
||||
]
|
||||
|
||||
from User import User
|
||||
from UserId import UserId
|
||||
from .User import User
|
||||
from .UserId import UserId
|
||||
|
||||
|
|
|
@ -24,5 +24,5 @@ __all__ = [
|
|||
'NewAdaptivePlotRequest'
|
||||
]
|
||||
|
||||
from NewAdaptivePlotRequest import NewAdaptivePlotRequest
|
||||
from .NewAdaptivePlotRequest import NewAdaptivePlotRequest
|
||||
|
||||
|
|
|
@ -26,5 +26,5 @@ __all__ = [
|
|||
'response'
|
||||
]
|
||||
|
||||
from PointTest import PointTest
|
||||
from .PointTest import PointTest
|
||||
|
||||
|
|
|
@ -33,13 +33,13 @@ __all__ = [
|
|||
'StoreRequest'
|
||||
]
|
||||
|
||||
from CopyRequest import CopyRequest
|
||||
from CreateDatasetRequest import CreateDatasetRequest
|
||||
from DatasetDataRequest import DatasetDataRequest
|
||||
from DatasetNamesRequest import DatasetNamesRequest
|
||||
from DeleteFilesRequest import DeleteFilesRequest
|
||||
from DeleteRequest import DeleteRequest
|
||||
from GroupsRequest import GroupsRequest
|
||||
from RepackRequest import RepackRequest
|
||||
from RetrieveRequest import RetrieveRequest
|
||||
from StoreRequest import StoreRequest
|
||||
from .CopyRequest import CopyRequest
|
||||
from .CreateDatasetRequest import CreateDatasetRequest
|
||||
from .DatasetDataRequest import DatasetDataRequest
|
||||
from .DatasetNamesRequest import DatasetNamesRequest
|
||||
from .DeleteFilesRequest import DeleteFilesRequest
|
||||
from .DeleteRequest import DeleteRequest
|
||||
from .GroupsRequest import GroupsRequest
|
||||
from .RepackRequest import RepackRequest
|
||||
from .RetrieveRequest import RetrieveRequest
|
||||
from .StoreRequest import StoreRequest
|
||||
|
|
|
@ -28,8 +28,8 @@ __all__ = [
|
|||
'StoreResponse'
|
||||
]
|
||||
|
||||
from DeleteResponse import DeleteResponse
|
||||
from ErrorResponse import ErrorResponse
|
||||
from FileActionResponse import FileActionResponse
|
||||
from RetrieveResponse import RetrieveResponse
|
||||
from StoreResponse import StoreResponse
|
||||
from .DeleteResponse import DeleteResponse
|
||||
from .ErrorResponse import ErrorResponse
|
||||
from .FileActionResponse import FileActionResponse
|
||||
from .RetrieveResponse import RetrieveResponse
|
||||
from .StoreResponse import StoreResponse
|
||||
|
|
|
@ -39,8 +39,8 @@ class SerializableExceptionWrapper(object):
|
|||
|
||||
def __repr__(self):
|
||||
if not self.message:
|
||||
self.message = ''
|
||||
retVal = "" + self.exceptionClass + " exception thrown: " + self.message + "\n"
|
||||
self.message = b''
|
||||
retVal = b"" + self.exceptionClass + b" exception thrown: " + self.message + b"\n"
|
||||
for element in self.stackTrace:
|
||||
retVal += "\tat " + str(element) + "\n"
|
||||
|
||||
|
|
|
@ -38,4 +38,4 @@ __all__ = [
|
|||
'SerializableExceptionWrapper',
|
||||
]
|
||||
|
||||
from SerializableExceptionWrapper import SerializableExceptionWrapper
|
||||
from .SerializableExceptionWrapper import SerializableExceptionWrapper
|
||||
|
|
|
@ -37,4 +37,4 @@ __all__ = [
|
|||
'ServerErrorResponse',
|
||||
]
|
||||
|
||||
from ServerErrorResponse import ServerErrorResponse
|
||||
from .ServerErrorResponse import ServerErrorResponse
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
##
|
||||
|
||||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
from SiteActivationNotification import SiteActivationNotification
|
||||
from .SiteActivationNotification import SiteActivationNotification
|
||||
class ClusterActivationNotification(SiteActivationNotification):
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -25,6 +25,6 @@ __all__ = [
|
|||
'SiteActivationNotification',
|
||||
]
|
||||
|
||||
from ClusterActivationNotification import ClusterActivationNotification
|
||||
from SiteActivationNotification import SiteActivationNotification
|
||||
from .ClusterActivationNotification import ClusterActivationNotification
|
||||
from .SiteActivationNotification import SiteActivationNotification
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ __all__ = [
|
|||
'GetActiveSitesRequest',
|
||||
]
|
||||
|
||||
from ActivateSiteRequest import ActivateSiteRequest
|
||||
from DeactivateSiteRequest import DeactivateSiteRequest
|
||||
from GetActiveSitesRequest import GetActiveSitesRequest
|
||||
from .ActivateSiteRequest import ActivateSiteRequest
|
||||
from .DeactivateSiteRequest import DeactivateSiteRequest
|
||||
from .GetActiveSitesRequest import GetActiveSitesRequest
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue