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
|
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
# further licensing information.
|
# further licensing information.
|
||||||
##
|
##
|
||||||
|
try:
|
||||||
import http.client
|
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 = http.client.HTTPConnection(hostString)
|
self.__httpConn = httpcl.HTTPConnection(hostString)
|
||||||
else:
|
else:
|
||||||
if (port is None):
|
if (port is None):
|
||||||
self.__httpConn = http.client.HTTPConnection(host)
|
self.__httpConn = httpcl.HTTPConnection(host)
|
||||||
else:
|
else:
|
||||||
self.__httpConn = http.client.HTTPConnection(host, port)
|
self.__httpConn = httpcl.HTTPConnection(host, port)
|
||||||
|
|
||||||
self.__uri = uri
|
self.__uri = uri
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ __all__ = [
|
||||||
]
|
]
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
from six import with_metaclass
|
||||||
class IDataRequest(object, metaclass=abc.ABCMeta):
|
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.
|
||||||
"""
|
"""
|
||||||
|
@ -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.
|
An IData representing data returned from the DataAccessLayer.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
from . import ActiveTableKey
|
from . import ActiveTableKey
|
||||||
import abc
|
import abc
|
||||||
|
from six import with_metaclass
|
||||||
class ActiveTableRecord(object, metaclass=abc.ABCMeta):
|
class ActiveTableRecord(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.key = ActiveTableKey.ActiveTableKey()
|
self.key = ActiveTableKey.ActiveTableKey()
|
||||||
|
|
|
@ -22,8 +22,9 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
|
from six import with_metaclass
|
||||||
|
|
||||||
class AbstractFailedResponse(object, metaclass=abc.ABCMeta):
|
class AbstractFailedResponse(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.request = None
|
self.request = None
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
|
from six import with_metaclass
|
||||||
class AbstractDataAccessRequest(object, metaclass=abc.ABCMeta):
|
class AbstractDataAccessRequest(with_metaclass(abc.ABCMeta, object)):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.requestParameters = None
|
self.requestParameters = None
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
from six import with_metaclass
|
||||||
|
|
||||||
class AbstractIdentifierRequest(object, metaclass=abc.ABCMeta):
|
class AbstractIdentifierRequest(with_metaclass(abc.ABCMeta, object)):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.datatype = None
|
self.datatype = None
|
||||||
|
|
||||||
|
|
|
@ -21,9 +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, metaclass=abc.ABCMeta):
|
class AbstractResponseData(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.time = None
|
self.time = None
|
||||||
|
|
|
@ -21,9 +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, metaclass=abc.ABCMeta):
|
class AbstractGfeRequest(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.siteID = None
|
self.siteID = None
|
||||||
|
|
|
@ -23,9 +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, metaclass=abc.ABCMeta):
|
class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.requests = []
|
self.requests = []
|
||||||
|
|
|
@ -25,8 +25,9 @@
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
import abc
|
import abc
|
||||||
|
from six import with_metaclass
|
||||||
|
|
||||||
class GfeNotification(object, metaclass=abc.ABCMeta):
|
class GfeNotification(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.siteID = None
|
self.siteID = None
|
||||||
|
|
|
@ -19,9 +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
|
||||||
|
|
|
@ -23,8 +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, metaclass=abc.ABCMeta):
|
class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)):
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.context = None
|
self.context = None
|
||||||
|
|
|
@ -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):
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -11,6 +11,6 @@ setup(
|
||||||
download_url='https://github.com/Unidata/python-awips/tarball/0.9.3',
|
download_url='https://github.com/Unidata/python-awips/tarball/0.9.3',
|
||||||
author='Unidata',
|
author='Unidata',
|
||||||
author_email='mjames@ucar.edu',
|
author_email='mjames@ucar.edu',
|
||||||
requires=['argparse','shapely','numpy']
|
requires=['argparse','shapely','numpy','six']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue