mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
fixing for python 2 compatibility
now requires module six
This commit is contained in:
parent
718d242ffe
commit
91f230b45a
14 changed files with 35 additions and 23 deletions
|
@ -17,8 +17,10 @@
|
|||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
import http.client
|
||||
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 = http.client.HTTPConnection(hostString)
|
||||
self.__httpConn = httpcl.HTTPConnection(hostString)
|
||||
else:
|
||||
if (port is None):
|
||||
self.__httpConn = http.client.HTTPConnection(host)
|
||||
self.__httpConn = httpcl.HTTPConnection(host)
|
||||
else:
|
||||
self.__httpConn = http.client.HTTPConnection(host, port)
|
||||
self.__httpConn = httpcl.HTTPConnection(host, port)
|
||||
|
||||
self.__uri = uri
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ __all__ = [
|
|||
]
|
||||
|
||||
import abc
|
||||
|
||||
class IDataRequest(object, metaclass=abc.ABCMeta):
|
||||
from six import with_metaclass
|
||||
class IDataRequest(with_metaclass(abc.ABCMeta, object)):
|
||||
"""
|
||||
An IDataRequest to be submitted to the DataAccessLayer to retrieve data.
|
||||
"""
|
||||
|
@ -163,7 +163,7 @@ class IDataRequest(object, metaclass=abc.ABCMeta):
|
|||
|
||||
|
||||
|
||||
class IData(object, metaclass=abc.ABCMeta):
|
||||
class IData(with_metaclass(abc.ABCMeta, object)):
|
||||
"""
|
||||
An IData representing data returned from the DataAccessLayer.
|
||||
"""
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
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()
|
||||
|
|
|
@ -22,8 +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
|
||||
|
|
|
@ -31,8 +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,8 +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
|
||||
|
||||
|
|
|
@ -21,9 +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
|
||||
|
|
|
@ -21,9 +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,9 +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 = []
|
||||
|
|
|
@ -25,8 +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
|
||||
|
|
|
@ -19,9 +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
|
||||
|
|
|
@ -23,8 +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
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -11,6 +11,6 @@ setup(
|
|||
download_url='https://github.com/Unidata/python-awips/tarball/0.9.3',
|
||||
author='Unidata',
|
||||
author_email='mjames@ucar.edu',
|
||||
requires=['argparse','shapely','numpy']
|
||||
requires=['argparse','shapely','numpy','six']
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue