Merge branch 'master' of https://github.com/freemansw1/python-awips into master-python3

Conflicts:
	.gitignore
This commit is contained in:
mjames-upc 2016-05-24 15:44:37 -05:00
commit 20d7a5e883
129 changed files with 508 additions and 506 deletions

View file

@ -35,7 +35,7 @@
# #
import logging import logging
import NotificationMessage from . import NotificationMessage
class AlertVizHandler(logging.Handler): class AlertVizHandler(logging.Handler):

View file

@ -63,10 +63,10 @@ def convertToDateTime(timeArg):
return datetime.datetime(*timeArg[:6]) return datetime.datetime(*timeArg[:6])
elif isinstance(timeArg, float): elif isinstance(timeArg, float):
# seconds as float, should be avoided due to floating point errors # seconds as float, should be avoided due to floating point errors
totalSecs = long(timeArg) totalSecs = int(timeArg)
micros = int((timeArg - totalSecs) * MICROS_IN_SECOND) micros = int((timeArg - totalSecs) * MICROS_IN_SECOND)
return _convertSecsAndMicros(totalSecs, micros) return _convertSecsAndMicros(totalSecs, micros)
elif isinstance(timeArg, (int, long)): elif isinstance(timeArg, int):
# seconds as integer # seconds as integer
totalSecs = timeArg totalSecs = timeArg
return _convertSecsAndMicros(totalSecs, 0) return _convertSecsAndMicros(totalSecs, 0)

View file

@ -1,19 +1,19 @@
## ##
# This software was developed and / or modified by Raytheon Company, # This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government. # pursuant to Contract DG133W-05-CQ-1067 with the US Government.
# #
# U.S. EXPORT CONTROLLED TECHNICAL DATA # U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose # This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination # export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires # to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization. # an export license or other authorization.
# #
# Contractor Name: Raytheon Company # Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340 # Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8 # Mail Stop B8
# Omaha, NE 68106 # Omaha, NE 68106
# 402.291.0100 # 402.291.0100
# #
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for # See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information. # further licensing information.
## ##
@ -21,14 +21,14 @@
from string import Template from string import Template
import ctypes import ctypes
import stomp from . import stomp
import socket import socket
import sys import sys
import time import time
import threading import threading
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import ThriftClient from . import ThriftClient
from dynamicserialize.dstypes.com.raytheon.uf.common.alertviz import AlertVizRequest from dynamicserialize.dstypes.com.raytheon.uf.common.alertviz import AlertVizRequest
from dynamicserialize import DynamicSerializationManager from dynamicserialize import DynamicSerializationManager
@ -89,8 +89,8 @@ class NotificationMessage:
priorityInt = int(5) priorityInt = int(5)
if (priorityInt < 0 or priorityInt > 5): if (priorityInt < 0 or priorityInt > 5):
print "Error occurred, supplied an invalid Priority value: " + str(priorityInt) print("Error occurred, supplied an invalid Priority value: " + str(priorityInt))
print "Priority values are 0, 1, 2, 3, 4 and 5." print("Priority values are 0, 1, 2, 3, 4 and 5.")
sys.exit(1) sys.exit(1)
if priorityInt is not None: if priorityInt is not None:
@ -100,8 +100,8 @@ class NotificationMessage:
def connection_timeout(self, connection): def connection_timeout(self, connection):
if (connection is not None and not connection.is_connected()): if (connection is not None and not connection.is_connected()):
print "Connection Retry Timeout" print("Connection Retry Timeout")
for tid, tobj in threading._active.items(): for tid, tobj in list(threading._active.items()):
if tobj.name is "MainThread": if tobj.name is "MainThread":
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(SystemExit)) res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(SystemExit))
if res != 0 and res != 1: if res != 0 and res != 1:
@ -150,14 +150,14 @@ class NotificationMessage:
serverResponse = None serverResponse = None
try: try:
serverResponse = thriftClient.sendRequest(alertVizRequest) serverResponse = thriftClient.sendRequest(alertVizRequest)
except Exception, ex: except Exception as ex:
print "Caught exception submitting AlertVizRequest: ", str(ex) print("Caught exception submitting AlertVizRequest: ", str(ex))
if (serverResponse != "None"): 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) sys.exit(1)
else: else:
print "Response: " + str(serverResponse) print("Response: " + str(serverResponse))
def createRequest(message, priority, source, category, audioFile): def createRequest(message, priority, source, category, audioFile):
obj = AlertVizRequest() obj = AlertVizRequest()

View file

@ -35,7 +35,7 @@
import qpid import qpid
import zlib import zlib
from Queue import Empty from queue import Empty
from qpid.exceptions import Closed from qpid.exceptions import Closed
class QpidSubscriber: class QpidSubscriber:
@ -56,7 +56,7 @@ class QpidSubscriber:
if (topicName == 'edex.alerts'): if (topicName == 'edex.alerts'):
self.decompress = True self.decompress = True
print "Establishing connection to broker on", self.host print("Establishing connection to broker on", self.host)
queueName = topicName + self.__session.name 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.__session.exchange_bind(exchange='amq.topic', queue=queueName, binding_key=topicName)
@ -67,7 +67,7 @@ class QpidSubscriber:
queue = self.__session.incoming(local_queue_name) queue = self.__session.incoming(local_queue_name)
self.__session.message_subscribe(serverQueueName, destination=local_queue_name) self.__session.message_subscribe(serverQueueName, destination=local_queue_name)
queue.start() queue.start()
print "Connection complete to broker on", self.host print("Connection complete to broker on", self.host)
while self.subscribed: while self.subscribed:
try: try:
@ -75,7 +75,7 @@ class QpidSubscriber:
content = message.body content = message.body
self.__session.message_accept(qpid.datatypes.RangedSet(message.id)) self.__session.message_accept(qpid.datatypes.RangedSet(message.id))
if (self.decompress): if (self.decompress):
print "Decompressing received content" print("Decompressing received content")
try: try:
# http://stackoverflow.com/questions/2423866/python-decompressing-gzip-chunk-by-chunk # http://stackoverflow.com/questions/2423866/python-decompressing-gzip-chunk-by-chunk
d = zlib.decompressobj(16+zlib.MAX_WBITS) d = zlib.decompressobj(16+zlib.MAX_WBITS)

View file

@ -60,14 +60,14 @@ def get_hdf5_data(idra):
threshVals = [] threshVals = []
if len(idra) > 0: if len(idra) > 0:
for ii in range(len(idra)): for ii in range(len(idra)):
if idra[ii].getName() == "Data": if idra[ii].getName() == b"Data":
rdat = idra[ii] rdat = idra[ii]
elif idra[ii].getName() == "Angles": elif idra[ii].getName() == b"Angles":
azdat = idra[ii] azdat = idra[ii]
dattyp = "radial" dattyp = "radial"
elif idra[ii].getName() == "DependentValues": elif idra[ii].getName() == b"DependentValues":
depVals = idra[ii].getShortData() depVals = idra[ii].getShortData()
elif idra[ii].getName() == "Thresholds": elif idra[ii].getName() == b"Thresholds":
threshVals = idra[ii].getShortData() threshVals = idra[ii].getShortData()
return rdat,azdat,depVals,threshVals return rdat,azdat,depVals,threshVals

View file

@ -17,8 +17,10 @@
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for # See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information. # further licensing information.
## ##
try:
import httplib import http.client as httpcl
except ImportError:
import httplib as httpcl
from dynamicserialize import DynamicSerializationManager from dynamicserialize import DynamicSerializationManager
from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse
from dynamicserialize.dstypes.com.raytheon.uf.common.serialization import SerializableExceptionWrapper from dynamicserialize.dstypes.com.raytheon.uf.common.serialization import SerializableExceptionWrapper
@ -54,12 +56,12 @@ class ThriftClient:
if (len(hostParts) > 1): if (len(hostParts) > 1):
hostString = hostParts[0] hostString = hostParts[0]
self.__uri = "/" + hostParts[1] self.__uri = "/" + hostParts[1]
self.__httpConn = httplib.HTTPConnection(hostString) self.__httpConn = httpcl.HTTPConnection(hostString)
else: else:
if (port is None): if (port is None):
self.__httpConn = httplib.HTTPConnection(host) self.__httpConn = httpcl.HTTPConnection(host)
else: else:
self.__httpConn = httplib.HTTPConnection(host, port) self.__httpConn = httpcl.HTTPConnection(host, port)
self.__uri = uri self.__uri = uri
@ -67,17 +69,17 @@ class ThriftClient:
def sendRequest(self, request, uri="/thrift"): def sendRequest(self, request, uri="/thrift"):
message = self.__dsm.serializeObject(request) message = self.__dsm.serializeObject(request)
#message = message.decode('cp437')
self.__httpConn.connect() self.__httpConn.connect()
self.__httpConn.request("POST", self.__uri + uri, message) self.__httpConn.request("POST", self.__uri + uri, message)
response = self.__httpConn.getresponse() response = self.__httpConn.getresponse()
if (response.status != 200): if (response.status != 200):
raise ThriftRequestException("Unable to post request to server") raise ThriftRequestException("Unable to post request to server")
rval = self.__dsm.deserializeBytes(response.read()) rval = self.__dsm.deserializeBytes(response.read())
self.__httpConn.close() self.__httpConn.close()
# let's verify we have an instance of ServerErrorResponse # let's verify we have an instance of ServerErrorResponse
# IF we do, through an exception up to the caller along # IF we do, through an exception up to the caller along
# with the original Java stack trace # with the original Java stack trace

View file

@ -87,7 +87,7 @@ def determineDrtOffset(timeStr):
#print "gmtime", gm #print "gmtime", gm
if synch: if synch:
cur_t = time.mktime((gm[0], gm[1], gm[2], gm[3], 0, 0, 0, 0, 0)) 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') curStr = curStr.replace(' ','0')
launchStr = timeStr + "," + curStr launchStr = timeStr + "," + curStr

View file

@ -47,7 +47,7 @@ import subprocess
THRIFT_HOST = "edex" THRIFT_HOST = "edex"
USING_NATIVE_THRIFT = False 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 # intentionally do not catch if this fails to import, we want it to
# be obvious that something is configured wrong when running from within # be obvious that something is configured wrong when running from within
# Java instead of allowing false confidence and fallback behavior # Java instead of allowing false confidence and fallback behavior

View file

@ -45,7 +45,7 @@ class PyData(IData):
return self.__attributes[key] return self.__attributes[key]
def getAttributes(self): def getAttributes(self):
return self.__attributes.keys() return list(self.__attributes.keys())
def getDataTime(self): def getDataTime(self):
return self.__time return self.__time

View file

@ -45,14 +45,14 @@ class PyGeometryData(IGeometryData, PyData.PyData):
self.__geometry = geometry self.__geometry = geometry
self.__dataMap = {} self.__dataMap = {}
tempDataMap = geoDataRecord.getDataMap() 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]) self.__dataMap[key] = (value[0], value[1], value[2])
def getGeometry(self): def getGeometry(self):
return self.__geometry return self.__geometry
def getParameters(self): def getParameters(self):
return self.__dataMap.keys() return list(self.__dataMap.keys())
def getString(self, param): def getString(self, param):
value = self.__dataMap[param][0] value = self.__dataMap[param][0]
@ -64,7 +64,7 @@ class PyGeometryData(IGeometryData, PyData.PyData):
if t == 'INT': if t == 'INT':
return int(value) return int(value)
elif t == 'LONG': elif t == 'LONG':
return long(value) return int(value)
elif t == 'FLOAT': elif t == 'FLOAT':
return float(value) return float(value)
elif t == 'DOUBLE': elif t == 'DOUBLE':

View file

@ -128,7 +128,7 @@ def __buildStringList(param):
return [str(param)] return [str(param)]
def __notStringIter(iterable): def __notStringIter(iterable):
if not isinstance(iterable, basestring): if not isinstance(iterable, str):
try: try:
iter(iterable) iter(iterable)
return True return True
@ -226,7 +226,7 @@ class _SoundingTimeLayer(object):
A list containing the valid levels for this sounding in order of A list containing the valid levels for this sounding in order of
closest to surface to highest from surface. 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() sortedLevels.sort()
return [str(level) for level in sortedLevels] return [str(level) for level in sortedLevels]

View file

@ -83,7 +83,7 @@ class ThriftClientRouter(object):
response = self._client.sendRequest(gridDataRequest) response = self._client.sendRequest(gridDataRequest)
locSpecificData = {} locSpecificData = {}
locNames = response.getSiteNxValues().keys() locNames = list(response.getSiteNxValues().keys())
for location in locNames: for location in locNames:
nx = response.getSiteNxValues()[location] nx = response.getSiteNxValues()[location]
ny = response.getSiteNyValues()[location] ny = response.getSiteNyValues()[location]
@ -114,7 +114,7 @@ class ThriftClientRouter(object):
geometries = [] geometries = []
for wkb in response.getGeometryWKBs(): for wkb in response.getGeometryWKBs():
# convert the wkb to a bytearray with only positive values # 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. # convert the bytearray to a byte string and load it.
geometries.append(shapely.wkb.loads(str(byteArrWKB))) geometries.append(shapely.wkb.loads(str(byteArrWKB)))

View file

@ -41,12 +41,11 @@ __all__ = [
] ]
import abc import abc
from six import with_metaclass
class IDataRequest(object): class IDataRequest(with_metaclass(abc.ABCMeta, object)):
""" """
An IDataRequest to be submitted to the DataAccessLayer to retrieve data. An IDataRequest to be submitted to the DataAccessLayer to retrieve data.
""" """
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def setDatatype(self, datatype): 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. An IData representing data returned from the DataAccessLayer.
""" """
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def getAttribute(self, key): def getAttribute(self, key):

View file

@ -85,9 +85,9 @@ class IngestViaQPID:
self.connection.start() self.connection.start()
self.session = self.connection.session(str(uuid4())) self.session = self.connection.session(str(uuid4()))
self.session.exchange_bind(exchange='amq.direct', queue='external.dropbox', binding_key='external.dropbox') self.session.exchange_bind(exchange='amq.direct', queue='external.dropbox', binding_key='external.dropbox')
print 'Connected to Qpid' print('Connected to Qpid')
except: except:
print 'Unable to connect to Qpid' print('Unable to connect to Qpid')
def sendmessage(self, filepath, header): def sendmessage(self, filepath, header):
''' '''
@ -108,4 +108,4 @@ class IngestViaQPID:
there are no threads left open there are no threads left open
''' '''
self.session.close(timeout=10) self.session.close(timeout=10)
print 'Connection to Qpid closed' print('Connection to Qpid closed')

View file

@ -87,12 +87,13 @@ import random
import re import re
import socket import socket
import sys import sys
import thread import _thread
import threading import threading
import time import time
import types import types
import xml.dom.minidom import xml.dom.minidom
from cStringIO import StringIO from io import StringIO
from functools import reduce
# #
# stomp.py version number # stomp.py version number
@ -106,14 +107,14 @@ def _uuid( *args ):
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/213761) (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/213761)
""" """
t = long( time.time() * 1000 ) t = int( time.time() * 1000 )
r = long( random.random() * 100000000000000000L ) r = int( random.random() * 100000000000000000 )
try: try:
a = socket.gethostbyname( socket.gethostname() ) a = socket.gethostbyname( socket.gethostname() )
except: except:
# if we can't get a network address, just imagine one # 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) data = str(t) + ' ' + str(r) + ' ' + str(a) + ' ' + str(args)
md5 = hashlib.md5() md5 = hashlib.md5()
md5.update(data) md5.update(data)
@ -126,7 +127,7 @@ class DevNullLogger(object):
dummy logging class for environments without the logging module dummy logging class for environments without the logging module
""" """
def log(self, msg): def log(self, msg):
print msg print(msg)
def devnull(self, msg): def devnull(self, msg):
pass pass
@ -371,7 +372,7 @@ class Connection(object):
""" """
self.__running = True self.__running = True
self.__attempt_connection() self.__attempt_connection()
thread.start_new_thread(self.__receiver_loop, ()) _thread.start_new_thread(self.__receiver_loop, ())
def stop(self): def stop(self):
""" """
@ -434,7 +435,7 @@ class Connection(object):
def begin(self, headers={}, **keyword_headers): def begin(self, headers={}, **keyword_headers):
use_headers = self.__merge_headers([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() use_headers['transaction'] = _uuid()
self.__send_frame_helper('BEGIN', '', use_headers, [ 'transaction' ]) self.__send_frame_helper('BEGIN', '', use_headers, [ 'transaction' ])
return 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' ]) self.__send_frame_helper('COMMIT', '', self.__merge_headers([headers, keyword_headers]), [ 'transaction' ])
def connect(self, headers={}, **keyword_headers): 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) while not self.is_connected(): time.sleep(0.1)
del keyword_headers['wait'] del keyword_headers['wait']
self.__send_frame_helper('CONNECT', '', self.__merge_headers([self.__connect_headers, headers, keyword_headers]), [ ]) self.__send_frame_helper('CONNECT', '', self.__merge_headers([self.__connect_headers, headers, keyword_headers]), [ ])
@ -490,7 +491,7 @@ class Connection(object):
""" """
headers = {} headers = {}
for header_map in header_map_list: 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] headers[header_key] = header_map[header_key]
return headers return headers
@ -532,11 +533,11 @@ class Connection(object):
if type(required_header_key) == tuple: if type(required_header_key) == tuple:
found_alternative = False found_alternative = False
for alternative in required_header_key: for alternative in required_header_key:
if alternative in headers.keys(): if alternative in list(headers.keys()):
found_alternative = True found_alternative = True
if not found_alternative: if not found_alternative:
raise KeyError("Command %s requires one of the following headers: %s" % (command, str(required_header_key))) 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)) raise KeyError("Command %s requires header %r" % (command, required_header_key))
self.__send_frame(command, headers, payload) self.__send_frame(command, headers, payload)
@ -550,7 +551,7 @@ class Connection(object):
if self.__socket is not None: if self.__socket is not None:
frame = '%s\n%s\n%s\x00' % (command, 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) payload)
self.__socket.sendall(frame) self.__socket.sendall(frame)
log.debug("Sent frame: type=%s, headers=%r, body=%r" % (command, headers, payload)) log.debug("Sent frame: type=%s, headers=%r, body=%r" % (command, headers, payload))
@ -707,7 +708,7 @@ class Connection(object):
assert len(pair) == 2 assert len(pair) == 2
entries[pair[0]] = pair[1] entries[pair[0]] = pair[1]
return entries return entries
except Exception, ex: except Exception as ex:
# unable to parse message. return original # unable to parse message. return original
return body return body
@ -762,7 +763,7 @@ class Connection(object):
break break
except socket.error: except socket.error:
self.__socket = None self.__socket = None
if type(sys.exc_info()[1]) == types.TupleType: if type(sys.exc_info()[1]) == tuple:
exc = sys.exc_info()[1][1] exc = sys.exc_info()[1][1]
else: else:
exc = sys.exc_info()[1] exc = sys.exc_info()[1]
@ -813,20 +814,20 @@ if __name__ == '__main__':
self.c.start() self.c.start()
def __print_async(self, frame_type, headers, body): def __print_async(self, frame_type, headers, body):
print "\r \r", print("\r \r", end=' ')
print frame_type print(frame_type)
for header_key in headers.keys(): for header_key in list(headers.keys()):
print '%s: %s' % (header_key, headers[header_key]) print('%s: %s' % (header_key, headers[header_key]))
print print()
print body print(body)
print '> ', print('> ', end=' ')
sys.stdout.flush() sys.stdout.flush()
def on_connecting(self, host_and_port): def on_connecting(self, host_and_port):
self.c.connect(wait=True) self.c.connect(wait=True)
def on_disconnected(self): def on_disconnected(self):
print "lost connection" print("lost connection")
def on_message(self, headers, body): def on_message(self, headers, body):
self.__print_async("MESSAGE", headers, body) self.__print_async("MESSAGE", headers, body)
@ -850,13 +851,13 @@ if __name__ == '__main__':
self.c.abort(transaction=args[1]) self.c.abort(transaction=args[1])
def begin(self, args): def begin(self, args):
print 'transaction id: %s' % self.c.begin() print('transaction id: %s' % self.c.begin())
def commit(self, args): def commit(self, args):
if len(args) < 2: if len(args) < 2:
print 'expecting: commit <transid>' print('expecting: commit <transid>')
else: else:
print 'committing %s' % args[1] print('committing %s' % args[1])
self.c.commit(transaction=args[1]) self.c.commit(transaction=args[1])
def disconnect(self, args): def disconnect(self, args):
@ -867,35 +868,35 @@ if __name__ == '__main__':
def send(self, args): def send(self, args):
if len(args) < 3: if len(args) < 3:
print 'expecting: send <destination> <message>' print('expecting: send <destination> <message>')
else: else:
self.c.send(destination=args[1], message=' '.join(args[2:])) self.c.send(destination=args[1], message=' '.join(args[2:]))
def sendtrans(self, args): def sendtrans(self, args):
if len(args) < 3: if len(args) < 3:
print 'expecting: sendtrans <destination> <transid> <message>' print('expecting: sendtrans <destination> <transid> <message>')
else: else:
self.c.send(destination=args[1], message="%s\n" % ' '.join(args[3:]), transaction=args[2]) self.c.send(destination=args[1], message="%s\n" % ' '.join(args[3:]), transaction=args[2])
def subscribe(self, args): def subscribe(self, args):
if len(args) < 2: if len(args) < 2:
print 'expecting: subscribe <destination> [ack]' print('expecting: subscribe <destination> [ack]')
elif len(args) > 2: 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]) self.c.subscribe(destination=args[1], ack=args[2])
else: 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') self.c.subscribe(destination=args[1], ack='auto')
def unsubscribe(self, args): def unsubscribe(self, args):
if len(args) < 2: if len(args) < 2:
print 'expecting: unsubscribe <destination>' print('expecting: unsubscribe <destination>')
else: else:
print 'unsubscribing from "%s"' % args[1] print('unsubscribing from "%s"' % args[1])
self.c.unsubscribe(destination=args[1]) self.c.unsubscribe(destination=args[1])
if len(sys.argv) > 5: if len(sys.argv) > 5:
print 'USAGE: stomp.py [host] [port] [user] [passcode]' print('USAGE: stomp.py [host] [port] [user] [passcode]')
sys.exit(1) sys.exit(1)
if len(sys.argv) >= 2: if len(sys.argv) >= 2:
@ -917,7 +918,7 @@ if __name__ == '__main__':
st = StompTester(host, port, user, passcode) st = StompTester(host, port, user, passcode)
try: try:
while True: while True:
line = raw_input("\r> ") line = input("\r> ")
if not line or line.lstrip().rstrip() == '': if not line or line.lstrip().rstrip() == '':
continue continue
elif 'quit' in line or 'disconnect' in line: elif 'quit' in line or 'disconnect' in line:
@ -927,7 +928,7 @@ if __name__ == '__main__':
if not command.startswith("on_") and hasattr(st, command): if not command.startswith("on_") and hasattr(st, command):
getattr(st, command)(split) getattr(st, command)(split)
else: else:
print 'unrecognized command' print('unrecognized command')
finally: finally:
st.disconnect(None) st.disconnect(None)

View file

@ -57,7 +57,7 @@ class ListenThread(threading.Thread):
self.qs.topicSubscribe(self.topicName, self.receivedMessage) self.qs.topicSubscribe(self.topicName, self.receivedMessage)
def receivedMessage(self, msg): def receivedMessage(self, msg):
print "Received message" print("Received message")
self.nMessagesReceived += 1 self.nMessagesReceived += 1
if self.waitSecond == 0: if self.waitSecond == 0:
fmsg = open('/tmp/rawMessage', 'w') fmsg = open('/tmp/rawMessage', 'w')
@ -66,20 +66,20 @@ class ListenThread(threading.Thread):
while self.waitSecond < TIME_TO_SLEEP and not self.stopped: while self.waitSecond < TIME_TO_SLEEP and not self.stopped:
if self.waitSecond % 60 == 0: 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 self.waitSecond += 1
time.sleep(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): def stop(self):
print "Stopping" print("Stopping")
self.stopped = True self.stopped = True
self.qs.close() self.qs.close()
def main(): def main():
print "Starting up at", time.strftime('%H:%M:%S') print("Starting up at", time.strftime('%H:%M:%S'))
topic = 'edex.alerts' topic = 'edex.alerts'
host = 'localhost' host = 'localhost'

View file

@ -56,16 +56,16 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'python-awips' project = 'python-awips'
copyright = u'2016, Unidata' copyright = '2016, Unidata'
author = u'Unidata' author = 'Unidata'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = u'0.9.3' version = '0.9.3'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
@ -231,8 +231,8 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, 'python-awips.tex', u'python-awips Documentation', (master_doc, 'python-awips.tex', 'python-awips Documentation',
u'Unidata', 'manual'), 'Unidata', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # 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 # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
(master_doc, 'python-awips', u'python-awips Documentation', (master_doc, 'python-awips', 'python-awips Documentation',
[author], 1) [author], 1)
] ]
@ -275,7 +275,7 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ 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.', author, 'python-awips', 'One line description of project.',
'Miscellaneous'), 'Miscellaneous'),
] ]

View file

@ -36,7 +36,7 @@
# #
from thrift.transport import TTransport from thrift.transport import TTransport
import SelfDescribingBinaryProtocol, ThriftSerializationContext from . import SelfDescribingBinaryProtocol, ThriftSerializationContext
class DynamicSerializationManager: class DynamicSerializationManager:

View file

@ -44,13 +44,13 @@ from thrift.Thrift import TType
import inspect, sys, types import inspect, sys, types
import dynamicserialize import dynamicserialize
from dynamicserialize import dstypes, adapters from dynamicserialize import dstypes, adapters
import SelfDescribingBinaryProtocol from dynamicserialize import SelfDescribingBinaryProtocol
import numpy import numpy
import collections
dsObjTypes = {} dsObjTypes = {}
def buildObjMap(module): def buildObjMap(module):
if module.__dict__.has_key('__all__'): if '__all__' in module.__dict__:
for i in module.__all__: for i in module.__all__:
name = module.__name__ + '.' + i name = module.__name__ + '.' + i
__import__(name) __import__(name)
@ -65,17 +65,18 @@ def buildObjMap(module):
buildObjMap(dstypes) buildObjMap(dstypes)
pythonToThriftMap = { pythonToThriftMap = {
types.StringType: TType.STRING, bytes: TType.STRING,
types.IntType: TType.I32, int: TType.I32,
types.LongType: TType.I64, int: TType.I64,
types.ListType: TType.LIST, list: TType.LIST,
types.DictionaryType: TType.MAP, dict: TType.MAP,
type(set([])): TType.SET, type(set([])): TType.SET,
types.FloatType: SelfDescribingBinaryProtocol.FLOAT, float: SelfDescribingBinaryProtocol.FLOAT,
#types.FloatType: TType.DOUBLE, #types.FloatType: TType.DOUBLE,
types.BooleanType: TType.BOOL, bool: TType.BOOL,
types.InstanceType: TType.STRUCT, object: TType.STRUCT,
types.NoneType: TType.VOID, str: TType.STRING,
type(None): TType.VOID,
numpy.float32: SelfDescribingBinaryProtocol.FLOAT, numpy.float32: SelfDescribingBinaryProtocol.FLOAT,
numpy.int32: TType.I32, numpy.int32: TType.I32,
numpy.ndarray: TType.LIST, numpy.ndarray: TType.LIST,
@ -151,17 +152,18 @@ class ThriftSerializationContext(object):
def deserializeMessage(self): def deserializeMessage(self):
name = self.protocol.readStructBegin() name = self.protocol.readStructBegin()
name = name.decode('cp437')
name = name.replace('_', '.') name = name.replace('_', '.')
if name.isdigit(): if name.isdigit():
obj = self._deserializeType(int(name)) obj = self._deserializeType(int(name))
return obj return obj
elif adapters.classAdapterRegistry.has_key(name): elif name in adapters.classAdapterRegistry:
return adapters.classAdapterRegistry[name].deserialize(self) return adapters.classAdapterRegistry[name].deserialize(self)
elif name.find('$') > -1: elif name.find('$') > -1:
# it's an inner class, we're going to hope it's an enum, treat it special # it's an inner class, we're going to hope it's an enum, treat it special
fieldName, fieldType, fieldId = self.protocol.readFieldBegin() fieldName, fieldType, fieldId = self.protocol.readFieldBegin()
if fieldName != '__enumValue__': 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() obj = self.protocol.readString()
self.protocol.readFieldEnd() self.protocol.readFieldEnd()
return obj return obj
@ -176,10 +178,10 @@ class ThriftSerializationContext(object):
return obj return obj
def _deserializeType(self, b): def _deserializeType(self, b):
if self.typeDeserializationMethod.has_key(b): if b in self.typeDeserializationMethod:
return self.typeDeserializationMethod[b]() return self.typeDeserializationMethod[b]()
else: else:
raise dynamicserialize.SerializationException("Unsupported type value " + str(b)) raise dynamiceserialize.SerializationException("Unsupported type value " + str(b))
def _deserializeField(self, structname, obj): def _deserializeField(self, structname, obj):
@ -191,17 +193,18 @@ class ThriftSerializationContext(object):
# result = adapters.fieldAdapterRegistry[structname][fieldName].deserialize(self) # result = adapters.fieldAdapterRegistry[structname][fieldName].deserialize(self)
# else: # else:
result = self._deserializeType(fieldType) 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: try:
setMethod = getattr(obj, lookingFor) setMethod = getattr(obj, lookingFor)
if callable(setMethod): if isinstance(setMethod, collections.Callable):
setMethod(result) setMethod(result)
else: else:
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor) raise SerializationException("Couldn't find setter method " + lookingFor)
except: except:
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor) raise SerializationException("Couldn't find setter method " + lookingFor)
self.protocol.readFieldEnd() self.protocol.readFieldEnd()
return True return True
@ -213,7 +216,7 @@ class ThriftSerializationContext(object):
if size: if size:
if listType not in primitiveSupport: if listType not in primitiveSupport:
m = self.typeDeserializationMethod[listType] m = self.typeDeserializationMethod[listType]
result = [m() for n in xrange(size)] result = [m() for n in range(size)]
else: else:
result = self.listDeserializationMethod[listType](size) result = self.listDeserializationMethod[listType](size)
self.protocol.readListEnd() self.protocol.readListEnd()
@ -222,7 +225,7 @@ class ThriftSerializationContext(object):
def _deserializeMap(self): def _deserializeMap(self):
keyType, valueType, size = self.protocol.readMapBegin() keyType, valueType, size = self.protocol.readMapBegin()
result = {} 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 # can't go off the type, due to java generics limitations dynamic serialize is
# serializing keys and values as void # serializing keys and values as void
key = self.typeDeserializationMethod[TType.STRUCT]() key = self.typeDeserializationMethod[TType.STRUCT]()
@ -234,26 +237,26 @@ class ThriftSerializationContext(object):
def _deserializeSet(self): def _deserializeSet(self):
setType, setSize = self.protocol.readSetBegin() setType, setSize = self.protocol.readSetBegin()
result = set([]) result = set([])
for n in xrange(setSize): for n in range(setSize):
result.add(self.typeDeserializationMethod[TType.STRUCT]()) result.add(self.typeDeserializationMethod[TType.STRUCT]())
self.protocol.readSetEnd() self.protocol.readSetEnd()
return result return result
def _lookupType(self, obj): def _lookupType(self, obj):
pyt = type(obj) pyt = type(obj)
if pythonToThriftMap.has_key(pyt): if pyt in pythonToThriftMap:
return pythonToThriftMap[pyt] return pythonToThriftMap[pyt]
elif pyt.__module__.startswith('dynamicserialize.dstypes'): elif pyt.__module__.startswith('dynamicserialize.dstypes'):
return pythonToThriftMap[types.InstanceType] return pythonToThriftMap[object]
else: else:
raise dynamicserialize.SerializationException("Don't know how to serialize object of type: " + str(pyt)) raise dynamicserialize.SerializationException("Don't know how to serialize object of type: " + str(pyt))
def serializeMessage(self, obj): def serializeMessage(self, obj):
tt = self._lookupType(obj) tt = self._lookupType(obj)
if tt == TType.STRUCT: if tt == TType.STRUCT:
fqn = obj.__module__.replace('dynamicserialize.dstypes.', '') 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 # get proper class name when writing class name to serialization stream
# in case we have a special inner-class case # in case we have a special inner-class case
m = sys.modules[adapters.classAdapterRegistry[fqn].__name__] m = sys.modules[adapters.classAdapterRegistry[fqn].__name__]
@ -288,12 +291,14 @@ class ThriftSerializationContext(object):
self.protocol.writeStructEnd() self.protocol.writeStructEnd()
def _serializeField(self, fieldName, fieldType, fieldId, fieldValue): def _serializeField(self, fieldName, fieldType, fieldId, fieldValue):
#print("SERFIELD", fieldName, fieldType, fieldId, fieldValue)
self.protocol.writeFieldBegin(fieldName, fieldType, fieldId) self.protocol.writeFieldBegin(fieldName, fieldType, fieldId)
self._serializeType(fieldValue, fieldType) self._serializeType(fieldValue, fieldType)
self.protocol.writeFieldEnd() self.protocol.writeFieldEnd()
#print(self.protocol)
def _serializeType(self, fieldValue, fieldType): def _serializeType(self, fieldValue, fieldType):
if self.typeSerializationMethod.has_key(fieldType): if fieldType in self.typeSerializationMethod:
return self.typeSerializationMethod[fieldType](fieldValue) return self.typeSerializationMethod[fieldType](fieldValue)
else: else:
raise dynamicserialize.SerializationException("Unsupported type value " + str(fieldType)) raise dynamicserialize.SerializationException("Unsupported type value " + str(fieldType))
@ -335,7 +340,7 @@ class ThriftSerializationContext(object):
def _serializeMap(self, obj): def _serializeMap(self, obj):
size = len(obj) size = len(obj)
self.protocol.writeMapBegin(TType.VOID, TType.VOID, size) 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](k)
self.typeSerializationMethod[TType.STRUCT](obj[k]) self.typeSerializationMethod[TType.STRUCT](obj[k])
self.protocol.writeMapEnd() self.protocol.writeMapEnd()

View file

@ -35,8 +35,8 @@
__all__ = [ __all__ = [
] ]
import dstypes, adapters from . import dstypes, adapters
import DynamicSerializationManager from . import DynamicSerializationManager
class SerializationException(Exception): class SerializationException(Exception):

View file

@ -52,6 +52,6 @@ def deserialize(context):
setSize = context.readI32() setSize = context.readI32()
enumClassName = context.readString() enumClassName = context.readString()
valList = [] valList = []
for i in xrange(setSize): for i in range(setSize):
valList.append(context.readString()) valList.append(context.readString())
return EnumSet(enumClassName, valList) return EnumSet(enumClassName, valList)

View file

@ -45,7 +45,7 @@ def serialize(context, lockTable):
for lock in locks: for lock in locks:
wsIdString = lock.getWsId().toString() wsIdString = lock.getWsId().toString()
if wsIds.has_key(wsIdString): if wsIdString in wsIds:
lockWsIdIndex.append(wsIds[wsIdString]) lockWsIdIndex.append(wsIds[wsIdString])
else: else:
lockWsIdIndex.append(index) lockWsIdIndex.append(index)
@ -68,12 +68,12 @@ def deserialize(context):
parmId = context.readObject() parmId = context.readObject()
numWsIds = context.readI32() numWsIds = context.readI32()
wsIds = [] wsIds = []
for x in xrange(numWsIds): for x in range(numWsIds):
wsIds.append(context.readObject()) wsIds.append(context.readObject())
numLocks = context.readI32() numLocks = context.readI32()
locks = [] locks = []
for x in xrange(numLocks): for x in range(numLocks):
startTime = context.readI64() startTime = context.readI64()
endTime = context.readI64() endTime = context.readI64()
wsId = wsIds[context.readI32()] wsId = wsIds[context.readI32()]

View file

@ -52,7 +52,7 @@ def deserialize(context):
wsId.setUserName(wsIdParts[1]) wsId.setUserName(wsIdParts[1])
wsId.setProgName(wsIdParts[2]) wsId.setProgName(wsIdParts[2])
wsId.setPid(wsIdParts[3]) wsId.setPid(wsIdParts[3])
wsId.setThreadId(long(wsIdParts[4])) wsId.setThreadId(int(wsIdParts[4]))
return wsId return wsId

View file

@ -66,10 +66,10 @@ classAdapterRegistry = {}
def getAdapterRegistry(): def getAdapterRegistry():
import sys import sys
for x in __all__: for x in __all__:
exec 'import ' + x exec('import dynamicserialize.adapters.' + x )
m = sys.modules['dynamicserialize.adapters.' + x] m = sys.modules['dynamicserialize.adapters.' + x]
d = m.__dict__ d = m.__dict__
if d.has_key('ClassAdapter'): if 'ClassAdapter' in d:
if isinstance(m.ClassAdapter, list): if isinstance(m.ClassAdapter, list):
for clz in m.ClassAdapter: for clz in m.ClassAdapter:
classAdapterRegistry[clz] = m classAdapterRegistry[clz] = m

View file

@ -26,4 +26,3 @@ __all__ = [
'java' 'java'
] ]

View file

@ -26,12 +26,10 @@
# #
## ##
import ActiveTableKey from . import ActiveTableKey
import abc import abc
from six import with_metaclass
class ActiveTableRecord(object): class ActiveTableRecord(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.key = ActiveTableKey.ActiveTableKey() self.key = ActiveTableKey.ActiveTableKey()

View file

@ -26,9 +26,9 @@
# #
## ##
import ActiveTableRecord from . import ActiveTableRecord
class OperationalActiveTableRecord(ActiveTableRecord.ActiveTableRecord): class OperationalActiveTableRecord(ActiveTableRecord):
def __init__(self): def __init__(self):
super(OperationalActiveTableRecord, self).__init__() super(OperationalActiveTableRecord, self).__init__()

View file

@ -26,9 +26,9 @@
# #
## ##
import ActiveTableRecord from . import ActiveTableRecord
class PracticeActiveTableRecord(ActiveTableRecord.ActiveTableRecord): class PracticeActiveTableRecord(ActiveTableRecord):
def __init__(self): def __init__(self):
super(PracticeActiveTableRecord, self).__init__() super(PracticeActiveTableRecord, self).__init__()

View file

@ -41,20 +41,20 @@ __all__ = [
'response' 'response'
] ]
from ActiveTableKey import ActiveTableKey from .ActiveTableKey import ActiveTableKey
from ActiveTableRecord import ActiveTableRecord from .ActiveTableRecord import ActiveTableRecord
from ActiveTableMode import ActiveTableMode from .ActiveTableMode import ActiveTableMode
from DumpActiveTableRequest import DumpActiveTableRequest from .DumpActiveTableRequest import DumpActiveTableRequest
from DumpActiveTableResponse import DumpActiveTableResponse from .DumpActiveTableResponse import DumpActiveTableResponse
from GetActiveTableDictRequest import GetActiveTableDictRequest from .GetActiveTableDictRequest import GetActiveTableDictRequest
from GetActiveTableDictResponse import GetActiveTableDictResponse from .GetActiveTableDictResponse import GetActiveTableDictResponse
from GetFourCharSitesRequest import GetFourCharSitesRequest from .GetFourCharSitesRequest import GetFourCharSitesRequest
from GetFourCharSitesResponse import GetFourCharSitesResponse from .GetFourCharSitesResponse import GetFourCharSitesResponse
from GetVtecAttributeRequest import GetVtecAttributeRequest from .GetVtecAttributeRequest import GetVtecAttributeRequest
from GetVtecAttributeResponse import GetVtecAttributeResponse from .GetVtecAttributeResponse import GetVtecAttributeResponse
from OperationalActiveTableRecord import OperationalActiveTableRecord from .OperationalActiveTableRecord import OperationalActiveTableRecord
from PracticeActiveTableRecord import PracticeActiveTableRecord from .PracticeActiveTableRecord import PracticeActiveTableRecord
from SendPracticeProductRequest import SendPracticeProductRequest from .SendPracticeProductRequest import SendPracticeProductRequest
from VTECChange import VTECChange from .VTECChange import VTECChange
from VTECTableChangeNotification import VTECTableChangeNotification from .VTECTableChangeNotification import VTECTableChangeNotification

View file

@ -27,8 +27,8 @@ __all__ = [
'SendActiveTableRequest' 'SendActiveTableRequest'
] ]
from ClearPracticeVTECTableRequest import ClearPracticeVTECTableRequest from .ClearPracticeVTECTableRequest import ClearPracticeVTECTableRequest
from MergeActiveTableRequest import MergeActiveTableRequest from .MergeActiveTableRequest import MergeActiveTableRequest
from RetrieveRemoteActiveTableRequest import RetrieveRemoteActiveTableRequest from .RetrieveRemoteActiveTableRequest import RetrieveRemoteActiveTableRequest
from SendActiveTableRequest import SendActiveTableRequest from .SendActiveTableRequest import SendActiveTableRequest

View file

@ -24,5 +24,5 @@ __all__ = [
'ActiveTableSharingResponse' 'ActiveTableSharingResponse'
] ]
from ActiveTableSharingResponse import ActiveTableSharingResponse from .ActiveTableSharingResponse import ActiveTableSharingResponse

View file

@ -24,5 +24,5 @@ __all__ = [
'AlertVizRequest' 'AlertVizRequest'
] ]
from AlertVizRequest import AlertVizRequest from .AlertVizRequest import AlertVizRequest

View file

@ -22,10 +22,9 @@
import abc import abc
from six import with_metaclass
class AbstractFailedResponse(object): class AbstractFailedResponse(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.request = None self.request = None

View file

@ -27,8 +27,8 @@ __all__ = [
'UserNotAuthorized' 'UserNotAuthorized'
] ]
from AbstractFailedResponse import AbstractFailedResponse from .AbstractFailedResponse import AbstractFailedResponse
from AuthServerErrorResponse import AuthServerErrorResponse from .AuthServerErrorResponse import AuthServerErrorResponse
from SuccessfulExecution import SuccessfulExecution from .SuccessfulExecution import SuccessfulExecution
from UserNotAuthorized import UserNotAuthorized from .UserNotAuthorized import UserNotAuthorized

View file

@ -24,4 +24,4 @@ __all__ = [
'AuthenticationData' 'AuthenticationData'
] ]
from AuthenticationData import AuthenticationData from .AuthenticationData import AuthenticationData

View file

@ -56,10 +56,10 @@ class DefaultDataRequest(IDataRequest):
del self.identifiers[key] del self.identifiers[key]
def setParameters(self, *params): def setParameters(self, *params):
self.parameters = map(str, params) self.parameters = list(map(str, params))
def setLevels(self, *levels): def setLevels(self, *levels):
self.levels = map(self.__makeLevel, levels) self.levels = list(map(self.__makeLevel, levels))
def __makeLevel(self, level): def __makeLevel(self, level):
if type(level) is Level: if type(level) is Level:
@ -73,7 +73,7 @@ class DefaultDataRequest(IDataRequest):
self.envelope = Envelope(env.envelope) self.envelope = Envelope(env.envelope)
def setLocationNames(self, *locationNames): def setLocationNames(self, *locationNames):
self.locationNames = map(str, locationNames) self.locationNames = list(map(str, locationNames))
def getDatatype(self): def getDatatype(self):
return self.datatype return self.datatype

View file

@ -24,5 +24,5 @@ __all__ = [
'DefaultDataRequest' 'DefaultDataRequest'
] ]
from DefaultDataRequest import DefaultDataRequest from .DefaultDataRequest import DefaultDataRequest

View file

@ -31,10 +31,8 @@
import abc import abc
from six import with_metaclass
class AbstractDataAccessRequest(object): class AbstractDataAccessRequest(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
def __init__(self): def __init__(self):
self.requestParameters = None self.requestParameters = None

View file

@ -30,10 +30,9 @@
# #
import abc import abc
from six import with_metaclass
class AbstractIdentifierRequest(object): class AbstractIdentifierRequest(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
def __init__(self): def __init__(self):
self.datatype = None self.datatype = None

View file

@ -34,15 +34,15 @@ __all__ = [
'GetOptionalIdentifiersRequest' 'GetOptionalIdentifiersRequest'
] ]
from AbstractDataAccessRequest import AbstractDataAccessRequest from .AbstractDataAccessRequest import AbstractDataAccessRequest
from AbstractIdentifierRequest import AbstractIdentifierRequest from .AbstractIdentifierRequest import AbstractIdentifierRequest
from GetAvailableLevelsRequest import GetAvailableLevelsRequest from .GetAvailableLevelsRequest import GetAvailableLevelsRequest
from GetAvailableLocationNamesRequest import GetAvailableLocationNamesRequest from .GetAvailableLocationNamesRequest import GetAvailableLocationNamesRequest
from GetAvailableParametersRequest import GetAvailableParametersRequest from .GetAvailableParametersRequest import GetAvailableParametersRequest
from GetAvailableTimesRequest import GetAvailableTimesRequest from .GetAvailableTimesRequest import GetAvailableTimesRequest
from GetGeometryDataRequest import GetGeometryDataRequest from .GetGeometryDataRequest import GetGeometryDataRequest
from GetGridDataRequest import GetGridDataRequest from .GetGridDataRequest import GetGridDataRequest
from GetRequiredIdentifiersRequest import GetRequiredIdentifiersRequest from .GetRequiredIdentifiersRequest import GetRequiredIdentifiersRequest
from GetSupportedDatatypesRequest import GetSupportedDatatypesRequest from .GetSupportedDatatypesRequest import GetSupportedDatatypesRequest
from GetOptionalIdentifiersRequest import GetOptionalIdentifiersRequest from .GetOptionalIdentifiersRequest import GetOptionalIdentifiersRequest

View file

@ -21,11 +21,10 @@
# File auto-generated against equivalent DynamicSerialize Java class # File auto-generated against equivalent DynamicSerialize Java class
import abc import abc
from six import with_metaclass
class AbstractResponseData(object): class AbstractResponseData(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.time = None self.time = None

View file

@ -28,9 +28,9 @@ __all__ = [
'GridResponseData' 'GridResponseData'
] ]
from AbstractResponseData import AbstractResponseData from .AbstractResponseData import AbstractResponseData
from GeometryResponseData import GeometryResponseData from .GeometryResponseData import GeometryResponseData
from GetGeometryDataResponse import GetGeometryDataResponse from .GetGeometryDataResponse import GetGeometryDataResponse
from GetGridDataResponse import GetGridDataResponse from .GetGridDataResponse import GetGridDataResponse
from GridResponseData import GridResponseData from .GridResponseData import GridResponseData

View file

@ -24,5 +24,5 @@ __all__ = [
'RegionLookupRequest' 'RegionLookupRequest'
] ]
from RegionLookupRequest import RegionLookupRequest from .RegionLookupRequest import RegionLookupRequest

View file

@ -39,5 +39,5 @@ __all__ = [
'weather' 'weather'
] ]
from GridDataHistory import GridDataHistory from .GridDataHistory import GridDataHistory

View file

@ -24,5 +24,5 @@ __all__ = [
'ProjectionData' 'ProjectionData'
] ]
from ProjectionData import ProjectionData from .ProjectionData import ProjectionData

View file

@ -29,10 +29,10 @@ __all__ = [
'TimeConstraints' 'TimeConstraints'
] ]
from DatabaseID import DatabaseID from .DatabaseID import DatabaseID
from GFERecord import GFERecord from .GFERecord import GFERecord
from GridLocation import GridLocation from .GridLocation import GridLocation
from GridParmInfo import GridParmInfo from .GridParmInfo import GridParmInfo
from ParmID import ParmID from .ParmID import ParmID
from TimeConstraints import TimeConstraints from .TimeConstraints import TimeConstraints

View file

@ -24,5 +24,5 @@ __all__ = [
'DiscreteKey' 'DiscreteKey'
] ]
from DiscreteKey import DiscreteKey from .DiscreteKey import DiscreteKey

View file

@ -25,6 +25,6 @@ __all__ = [
'Grid2DFloat' 'Grid2DFloat'
] ]
from Grid2DByte import Grid2DByte from .Grid2DByte import Grid2DByte
from Grid2DFloat import Grid2DFloat from .Grid2DFloat import Grid2DFloat

View file

@ -21,11 +21,10 @@
# File auto-generated against equivalent DynamicSerialize Java class # File auto-generated against equivalent DynamicSerialize Java class
import abc import abc
from six import with_metaclass
class AbstractGfeRequest(object): class AbstractGfeRequest(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.siteID = None self.siteID = None

View file

@ -23,11 +23,10 @@
import abc import abc
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.request import GetGridRequest from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.request import GetGridRequest
from six import with_metaclass
class GetGridDataRequest(object): class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.requests = [] self.requests = []

View file

@ -54,30 +54,30 @@ __all__ = [
'RsyncGridsToCWFRequest', 'RsyncGridsToCWFRequest',
] ]
from AbstractGfeRequest import AbstractGfeRequest from .AbstractGfeRequest import AbstractGfeRequest
from CommitGridsRequest import CommitGridsRequest from .CommitGridsRequest import CommitGridsRequest
from ConfigureTextProductsRequest import ConfigureTextProductsRequest from .ConfigureTextProductsRequest import ConfigureTextProductsRequest
from ExecuteIfpNetCDFGridRequest import ExecuteIfpNetCDFGridRequest from .ExecuteIfpNetCDFGridRequest import ExecuteIfpNetCDFGridRequest
from ExecuteIscMosaicRequest import ExecuteIscMosaicRequest from .ExecuteIscMosaicRequest import ExecuteIscMosaicRequest
from ExportGridsRequest import ExportGridsRequest from .ExportGridsRequest import ExportGridsRequest
from GetASCIIGridsRequest import GetASCIIGridsRequest from .GetASCIIGridsRequest import GetASCIIGridsRequest
from GetGridDataRequest import GetGridDataRequest from .GetGridDataRequest import GetGridDataRequest
from GetGridInventoryRequest import GetGridInventoryRequest from .GetGridInventoryRequest import GetGridInventoryRequest
from GetLatestDbTimeRequest import GetLatestDbTimeRequest from .GetLatestDbTimeRequest import GetLatestDbTimeRequest
from GetLatestModelDbIdRequest import GetLatestModelDbIdRequest from .GetLatestModelDbIdRequest import GetLatestModelDbIdRequest
from GetLockTablesRequest import GetLockTablesRequest from .GetLockTablesRequest import GetLockTablesRequest
from GetOfficialDbNameRequest import GetOfficialDbNameRequest from .GetOfficialDbNameRequest import GetOfficialDbNameRequest
from GetParmListRequest import GetParmListRequest from .GetParmListRequest import GetParmListRequest
from GetSelectTimeRangeRequest import GetSelectTimeRangeRequest from .GetSelectTimeRangeRequest import GetSelectTimeRangeRequest
from GetSingletonDbIdsRequest import GetSingletonDbIdsRequest from .GetSingletonDbIdsRequest import GetSingletonDbIdsRequest
from GetSiteTimeZoneInfoRequest import GetSiteTimeZoneInfoRequest from .GetSiteTimeZoneInfoRequest import GetSiteTimeZoneInfoRequest
from GridLocRequest import GridLocRequest from .GridLocRequest import GridLocRequest
from IscDataRecRequest import IscDataRecRequest from .IscDataRecRequest import IscDataRecRequest
from LockChangeRequest import LockChangeRequest from .LockChangeRequest import LockChangeRequest
from ProcessReceivedConfRequest import ProcessReceivedConfRequest from .ProcessReceivedConfRequest import ProcessReceivedConfRequest
from ProcessReceivedDigitalDataRequest import ProcessReceivedDigitalDataRequest from .ProcessReceivedDigitalDataRequest import ProcessReceivedDigitalDataRequest
from PurgeGfeGridsRequest import PurgeGfeGridsRequest from .PurgeGfeGridsRequest import PurgeGfeGridsRequest
from SaveASCIIGridsRequest import SaveASCIIGridsRequest from .SaveASCIIGridsRequest import SaveASCIIGridsRequest
from SmartInitRequest import SmartInitRequest from .SmartInitRequest import SmartInitRequest
from RsyncGridsToCWFRequest import RsyncGridsToCWFRequest from .RsyncGridsToCWFRequest import RsyncGridsToCWFRequest

View file

@ -25,6 +25,6 @@ __all__ = [
'LockTable' 'LockTable'
] ]
from Lock import Lock from .Lock import Lock
from LockTable import LockTable from .LockTable import LockTable

View file

@ -61,5 +61,5 @@ class ServerResponse(object):
def __str__(self): def __str__(self):
return self.message() return self.message()
def __nonzero__(self): def __bool__(self):
return self.isOkay() return self.isOkay()

View file

@ -25,6 +25,6 @@ __all__ = [
'ServerResponse' 'ServerResponse'
] ]
from ServerMsg import ServerMsg from .ServerMsg import ServerMsg
from ServerResponse import ServerResponse from .ServerResponse import ServerResponse

View file

@ -26,7 +26,7 @@
# #
## ##
import GfeNotification from . import GfeNotification
class CombinationsFileChangedNotification(GfeNotification.GfeNotification): class CombinationsFileChangedNotification(GfeNotification.GfeNotification):

View file

@ -28,7 +28,7 @@
# #
## ##
import GfeNotification from . import GfeNotification
class DBInvChangeNotification(GfeNotification.GfeNotification): class DBInvChangeNotification(GfeNotification.GfeNotification):

View file

@ -25,10 +25,9 @@
# #
## ##
import abc import abc
from six import with_metaclass
class GfeNotification(object): class GfeNotification(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.siteID = None self.siteID = None

View file

@ -26,9 +26,9 @@
# #
## ##
import GfeNotification from . import GfeNotification
class GridHistoryUpdateNotification(GfeNotification.GfeNotification): class GridHistoryUpdateNotification(GfeNotification):
def __init__(self): def __init__(self):
super(GridHistoryUpdateNotification, self).__init__() super(GridHistoryUpdateNotification, self).__init__()

View file

@ -27,9 +27,9 @@
# #
## ##
import GfeNotification from . import GfeNotification
class GridUpdateNotification(GfeNotification.GfeNotification): class GridUpdateNotification(GfeNotification):
def __init__(self): def __init__(self):
super(GridUpdateNotification, self).__init__() super(GridUpdateNotification, self).__init__()

View file

@ -27,9 +27,9 @@
# #
## ##
import GfeNotification from . import GfeNotification
class LockNotification(GfeNotification.GfeNotification): class LockNotification(GfeNotification):
def __init__(self): def __init__(self):
super(LockNotification, self).__init__() super(LockNotification, self).__init__()

View file

@ -26,9 +26,9 @@
# #
## ##
import GfeNotification from . import GfeNotification
class ServiceBackupJobStatusNotification(GfeNotification.GfeNotification): class ServiceBackupJobStatusNotification(GfeNotification):
def __init__(self): def __init__(self):
super(ServiceBackupJobStatusNotification, self).__init__() super(ServiceBackupJobStatusNotification, self).__init__()

View file

@ -26,9 +26,8 @@
# #
## ##
import GfeNotification from . import GfeNotification
class UserMessageNotification(GfeNotification):
class UserMessageNotification(GfeNotification.GfeNotification):
def __init__(self): def __init__(self):
super(UserMessageNotification, self).__init__() super(UserMessageNotification, self).__init__()

View file

@ -31,12 +31,12 @@ __all__ = [
'UserMessageNotification' 'UserMessageNotification'
] ]
from CombinationsFileChangedNotification import CombinationsFileChangedNotification from .CombinationsFileChangedNotification import CombinationsFileChangedNotification
from DBInvChangeNotification import DBInvChangeNotification from .DBInvChangeNotification import DBInvChangeNotification
from GfeNotification import GfeNotification from .GfeNotification import GfeNotification
from GridHistoryUpdateNotification import GridHistoryUpdateNotification from .GridHistoryUpdateNotification import GridHistoryUpdateNotification
from GridUpdateNotification import GridUpdateNotification from .GridUpdateNotification import GridUpdateNotification
from LockNotification import LockNotification from .LockNotification import LockNotification
from ServiceBackupJobStatusNotification import ServiceBackupJobStatusNotification from .ServiceBackupJobStatusNotification import ServiceBackupJobStatusNotification
from UserMessageNotification import UserMessageNotification from .UserMessageNotification import UserMessageNotification

View file

@ -27,8 +27,8 @@ __all__ = [
'LockTableRequest' 'LockTableRequest'
] ]
from CommitGridRequest import CommitGridRequest from .CommitGridRequest import CommitGridRequest
from GetGridRequest import GetGridRequest from .GetGridRequest import GetGridRequest
from LockRequest import LockRequest from .LockRequest import LockRequest
from LockTableRequest import LockTableRequest from .LockTableRequest import LockTableRequest

View file

@ -19,11 +19,9 @@
## ##
import abc import abc
from six import with_metaclass
class AbstractGridSlice(with_metaclass(abc.ABCMeta, object)):
class AbstractGridSlice(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.validTime = None self.validTime = None

View file

@ -28,9 +28,9 @@ __all__ = [
'WeatherGridSlice' 'WeatherGridSlice'
] ]
from AbstractGridSlice import AbstractGridSlice from .AbstractGridSlice import AbstractGridSlice
from DiscreteGridSlice import DiscreteGridSlice from .DiscreteGridSlice import DiscreteGridSlice
from ScalarGridSlice import ScalarGridSlice from .ScalarGridSlice import ScalarGridSlice
from VectorGridSlice import VectorGridSlice from .VectorGridSlice import VectorGridSlice
from WeatherGridSlice import WeatherGridSlice from .WeatherGridSlice import WeatherGridSlice

View file

@ -30,4 +30,4 @@ __all__ = [
'JobProgress', 'JobProgress',
] ]
from JobProgress import JobProgress from .JobProgress import JobProgress

View file

@ -25,6 +25,6 @@ __all__ = [
'WeatherSubKey' 'WeatherSubKey'
] ]
from WeatherKey import WeatherKey from .WeatherKey import WeatherKey
from WeatherSubKey import WeatherSubKey from .WeatherSubKey import WeatherSubKey

View file

@ -24,5 +24,5 @@ __all__ = [
'DeleteAllGridDataRequest' 'DeleteAllGridDataRequest'
] ]
from DeleteAllGridDataRequest import DeleteAllGridDataRequest from .DeleteAllGridDataRequest import DeleteAllGridDataRequest

View file

@ -36,7 +36,7 @@
import numpy import numpy
import re 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]+)$") LEVEL_NAMING_REGEX = re.compile("^(\d*(?:\.\d*)?)(?:_(\d*(?:\.\d*)?))?([a-zA-Z]+)$")
@ -45,7 +45,7 @@ INVALID_VALUE = numpy.float64(-999999)
class Level(object): class Level(object):
def __init__(self, levelString=None): def __init__(self, levelString=None):
self.id = 0L self.id = 0
self.identifier = None self.identifier = None
self.masterLevel = None self.masterLevel = None
self.levelonevalue = INVALID_VALUE self.levelonevalue = INVALID_VALUE
@ -55,7 +55,7 @@ class Level(object):
matcher = LEVEL_NAMING_REGEX.match(str(levelString)) matcher = LEVEL_NAMING_REGEX.match(str(levelString))
if matcher is not None: if matcher is not None:
self.levelonevalue = numpy.float64(matcher.group(1)) self.levelonevalue = numpy.float64(matcher.group(1))
self.masterLevel = MasterLevel.MasterLevel(matcher.group(3)) self.masterLevel = MasterLevel(matcher.group(3))
levelTwo = matcher.group(2) levelTwo = matcher.group(2)
if levelTwo: if levelTwo:
self.leveltwovalue = numpy.float64(levelTwo) self.leveltwovalue = numpy.float64(levelTwo)

View file

@ -25,6 +25,6 @@ __all__ = [
'MasterLevel' 'MasterLevel'
] ]
from Level import Level from .Level import Level
from MasterLevel import MasterLevel from .MasterLevel import MasterLevel

View file

@ -24,5 +24,5 @@ __all__ = [
'DataURINotificationMessage' 'DataURINotificationMessage'
] ]
from DataURINotificationMessage import DataURINotificationMessage from .DataURINotificationMessage import DataURINotificationMessage

View file

@ -24,5 +24,5 @@ __all__ = [
'GetRadarDataRecordRequest' 'GetRadarDataRecordRequest'
] ]
from GetRadarDataRecordRequest import GetRadarDataRecordRequest from .GetRadarDataRecordRequest import GetRadarDataRecordRequest

View file

@ -25,6 +25,6 @@ __all__ = [
'RadarDataRecord' 'RadarDataRecord'
] ]
from GetRadarDataRecordResponse import GetRadarDataRecordResponse from .GetRadarDataRecordResponse import GetRadarDataRecordResponse
from RadarDataRecord import RadarDataRecord from .RadarDataRecord import RadarDataRecord

View file

@ -24,5 +24,5 @@ __all__ = [
'TextDBRequest' 'TextDBRequest'
] ]
from TextDBRequest import TextDBRequest from .TextDBRequest import TextDBRequest

View file

@ -24,5 +24,5 @@ __all__ = [
'SubscriptionRequest' 'SubscriptionRequest'
] ]
from SubscriptionRequest import SubscriptionRequest from .SubscriptionRequest import SubscriptionRequest

View file

@ -40,6 +40,6 @@ __all__ = [
'StorageStatus', 'StorageStatus',
] ]
from Request import Request from .Request import Request
from StorageProperties import StorageProperties from .StorageProperties import StorageProperties
from StorageStatus import StorageStatus from .StorageStatus import StorageStatus

View file

@ -43,11 +43,11 @@ __all__ = [
'StringDataRecord' 'StringDataRecord'
] ]
from ByteDataRecord import ByteDataRecord from .ByteDataRecord import ByteDataRecord
from DoubleDataRecord import DoubleDataRecord from .DoubleDataRecord import DoubleDataRecord
from FloatDataRecord import FloatDataRecord from .FloatDataRecord import FloatDataRecord
from IntegerDataRecord import IntegerDataRecord from .IntegerDataRecord import IntegerDataRecord
from LongDataRecord import LongDataRecord from .LongDataRecord import LongDataRecord
from ShortDataRecord import ShortDataRecord from .ShortDataRecord import ShortDataRecord
from StringDataRecord import StringDataRecord from .StringDataRecord import StringDataRecord

View file

@ -43,7 +43,7 @@ knownLevels = {"BASE": {"text" : "BASE",
class LocalizationLevel(object): class LocalizationLevel(object):
def __init__(self, level, order=750, systemLevel=False): def __init__(self, level, order=750, systemLevel=False):
if knownLevels.has_key(level.upper()): if level.upper() in knownLevels:
self.text = level.upper() self.text = level.upper()
self.order = knownLevels[self.text]["order"] self.order = knownLevels[self.text]["order"]
self.systemLevel = knownLevels[self.text]["systemLevel"] self.systemLevel = knownLevels[self.text]["systemLevel"]

View file

@ -28,7 +28,7 @@ __all__ = [
'stream' 'stream'
] ]
from LocalizationContext import LocalizationContext from .LocalizationContext import LocalizationContext
from LocalizationLevel import LocalizationLevel from .LocalizationLevel import LocalizationLevel
from LocalizationType import LocalizationType from .LocalizationType import LocalizationType

View file

@ -31,12 +31,12 @@ __all__ = [
'UtilityResponseMessage' 'UtilityResponseMessage'
] ]
from DeleteUtilityCommand import DeleteUtilityCommand from .DeleteUtilityCommand import DeleteUtilityCommand
from DeleteUtilityResponse import DeleteUtilityResponse from .DeleteUtilityResponse import DeleteUtilityResponse
from ListResponseEntry import ListResponseEntry from .ListResponseEntry import ListResponseEntry
from ListUtilityCommand import ListUtilityCommand from .ListUtilityCommand import ListUtilityCommand
from ListUtilityResponse import ListUtilityResponse from .ListUtilityResponse import ListUtilityResponse
from PrivilegedUtilityRequestMessage import PrivilegedUtilityRequestMessage from .PrivilegedUtilityRequestMessage import PrivilegedUtilityRequestMessage
from UtilityRequestMessage import UtilityRequestMessage from .UtilityRequestMessage import UtilityRequestMessage
from UtilityResponseMessage import UtilityResponseMessage from .UtilityResponseMessage import UtilityResponseMessage

View file

@ -23,10 +23,9 @@
import abc import abc
import os import os
from dynamicserialize.dstypes.com.raytheon.uf.common.plugin.nwsauth.user import User from dynamicserialize.dstypes.com.raytheon.uf.common.plugin.nwsauth.user import User
from six import with_metaclass
class AbstractLocalizationStreamRequest(object): class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod @abc.abstractmethod
def __init__(self): def __init__(self):
self.context = None self.context = None

View file

@ -26,7 +26,7 @@ __all__ = [
'LocalizationStreamPutRequest' 'LocalizationStreamPutRequest'
] ]
from AbstractLocalizationStreamRequest import AbstractLocalizationStreamRequest from .AbstractLocalizationStreamRequest import AbstractLocalizationStreamRequest
from LocalizationStreamGetRequest import LocalizationStreamGetRequest from .LocalizationStreamGetRequest import LocalizationStreamGetRequest
from LocalizationStreamPutRequest import LocalizationStreamPutRequest from .LocalizationStreamPutRequest import LocalizationStreamPutRequest

View file

@ -26,6 +26,6 @@ __all__ = [
'diagnostic' 'diagnostic'
] ]
from ChangeContextRequest import ChangeContextRequest from .ChangeContextRequest import ChangeContextRequest
from PassThroughRequest import PassThroughRequest from .PassThroughRequest import PassThroughRequest

View file

@ -26,7 +26,7 @@ __all__ = [
'StatusRequest' 'StatusRequest'
] ]
from GetClusterMembersRequest import GetClusterMembersRequest from .GetClusterMembersRequest import GetClusterMembersRequest
from GetContextsRequest import GetContextsRequest from .GetContextsRequest import GetContextsRequest
from StatusRequest import StatusRequest from .StatusRequest import StatusRequest

View file

@ -26,7 +26,7 @@ __all__ = [
'StatusResponse' 'StatusResponse'
] ]
from ClusterMembersResponse import ClusterMembersResponse from .ClusterMembersResponse import ClusterMembersResponse
from ContextsResponse import ContextsResponse from .ContextsResponse import ContextsResponse
from StatusResponse import StatusResponse from .StatusResponse import StatusResponse

View file

@ -20,7 +20,7 @@
# File auto-generated against equivalent DynamicSerialize Java class # File auto-generated against equivalent DynamicSerialize Java class
from Property import Property from .Property import Property
class Header(object): class Header(object):
@ -31,7 +31,7 @@ class Header(object):
self.properties = properties self.properties = properties
if multimap is not None: if multimap is not None:
for k, l in multimap.iteritems(): for k, l in multimap.items():
for v in l: for v in l:
self.properties.append(Property(k, v)) self.properties.append(Property(k, v))

View file

@ -31,7 +31,10 @@ import struct
import socket import socket
import os import os
import pwd import pwd
import thread try:
import _thread
except ImportError:
import thread as _thread
class WsId(object): class WsId(object):
@ -50,7 +53,7 @@ class WsId(object):
self.pid = os.getpid() self.pid = os.getpid()
self.threadId = long(thread.get_ident()) self.threadId = int(_thread.get_ident())
def getNetworkId(self): def getNetworkId(self):
return self.networkId return self.networkId

View file

@ -40,8 +40,8 @@ __all__ = [
# #
from Body import Body from .Body import Body
from Header import Header from .Header import Header
from Message import Message from .Message import Message
from Property import Property from .Property import Property
from WsId import WsId from .WsId import WsId

View file

@ -25,6 +25,6 @@ __all__ = [
'UserId' 'UserId'
] ]
from User import User from .User import User
from UserId import UserId from .UserId import UserId

View file

@ -24,5 +24,5 @@ __all__ = [
'NewAdaptivePlotRequest' 'NewAdaptivePlotRequest'
] ]
from NewAdaptivePlotRequest import NewAdaptivePlotRequest from .NewAdaptivePlotRequest import NewAdaptivePlotRequest

View file

@ -26,5 +26,5 @@ __all__ = [
'response' 'response'
] ]
from PointTest import PointTest from .PointTest import PointTest

View file

@ -33,13 +33,13 @@ __all__ = [
'StoreRequest' 'StoreRequest'
] ]
from CopyRequest import CopyRequest from .CopyRequest import CopyRequest
from CreateDatasetRequest import CreateDatasetRequest from .CreateDatasetRequest import CreateDatasetRequest
from DatasetDataRequest import DatasetDataRequest from .DatasetDataRequest import DatasetDataRequest
from DatasetNamesRequest import DatasetNamesRequest from .DatasetNamesRequest import DatasetNamesRequest
from DeleteFilesRequest import DeleteFilesRequest from .DeleteFilesRequest import DeleteFilesRequest
from DeleteRequest import DeleteRequest from .DeleteRequest import DeleteRequest
from GroupsRequest import GroupsRequest from .GroupsRequest import GroupsRequest
from RepackRequest import RepackRequest from .RepackRequest import RepackRequest
from RetrieveRequest import RetrieveRequest from .RetrieveRequest import RetrieveRequest
from StoreRequest import StoreRequest from .StoreRequest import StoreRequest

View file

@ -28,8 +28,8 @@ __all__ = [
'StoreResponse' 'StoreResponse'
] ]
from DeleteResponse import DeleteResponse from .DeleteResponse import DeleteResponse
from ErrorResponse import ErrorResponse from .ErrorResponse import ErrorResponse
from FileActionResponse import FileActionResponse from .FileActionResponse import FileActionResponse
from RetrieveResponse import RetrieveResponse from .RetrieveResponse import RetrieveResponse
from StoreResponse import StoreResponse from .StoreResponse import StoreResponse

View file

@ -39,8 +39,8 @@ class SerializableExceptionWrapper(object):
def __repr__(self): def __repr__(self):
if not self.message: if not self.message:
self.message = '' self.message = b''
retVal = "" + self.exceptionClass + " exception thrown: " + self.message + "\n" retVal = b"" + self.exceptionClass + b" exception thrown: " + self.message + b"\n"
for element in self.stackTrace: for element in self.stackTrace:
retVal += "\tat " + str(element) + "\n" retVal += "\tat " + str(element) + "\n"

View file

@ -38,4 +38,4 @@ __all__ = [
'SerializableExceptionWrapper', 'SerializableExceptionWrapper',
] ]
from SerializableExceptionWrapper import SerializableExceptionWrapper from .SerializableExceptionWrapper import SerializableExceptionWrapper

View file

@ -37,4 +37,4 @@ __all__ = [
'ServerErrorResponse', 'ServerErrorResponse',
] ]
from ServerErrorResponse import ServerErrorResponse from .ServerErrorResponse import ServerErrorResponse

View file

@ -27,7 +27,7 @@
## ##
# File auto-generated against equivalent DynamicSerialize Java class # File auto-generated against equivalent DynamicSerialize Java class
from SiteActivationNotification import SiteActivationNotification from .SiteActivationNotification import SiteActivationNotification
class ClusterActivationNotification(SiteActivationNotification): class ClusterActivationNotification(SiteActivationNotification):
def __init__(self): def __init__(self):

View file

@ -25,6 +25,6 @@ __all__ = [
'SiteActivationNotification', 'SiteActivationNotification',
] ]
from ClusterActivationNotification import ClusterActivationNotification from .ClusterActivationNotification import ClusterActivationNotification
from SiteActivationNotification import SiteActivationNotification from .SiteActivationNotification import SiteActivationNotification

View file

@ -26,7 +26,7 @@ __all__ = [
'GetActiveSitesRequest', 'GetActiveSitesRequest',
] ]
from ActivateSiteRequest import ActivateSiteRequest from .ActivateSiteRequest import ActivateSiteRequest
from DeactivateSiteRequest import DeactivateSiteRequest from .DeactivateSiteRequest import DeactivateSiteRequest
from GetActiveSitesRequest import GetActiveSitesRequest from .GetActiveSitesRequest import GetActiveSitesRequest

Some files were not shown because too many files have changed in this diff Show more