mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 22:57:56 -05:00
more six python version control for encodings
This commit is contained in:
parent
e332f3184a
commit
60e470c02c
2 changed files with 8 additions and 2 deletions
|
@ -50,6 +50,9 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
||||||
|
|
||||||
def getNumber(self, param):
|
def getNumber(self, param):
|
||||||
t = self.getType(param)
|
t = self.getType(param)
|
||||||
|
if six.PY2:
|
||||||
|
value = self.__dataMap[param][0]
|
||||||
|
else:
|
||||||
value = self.__dataMap[param.encode('utf-8')][0]
|
value = self.__dataMap[param.encode('utf-8')][0]
|
||||||
if t == 'INT' or t == 'SHORT' or t == 'LONG':
|
if t == 'INT' or t == 'SHORT' or t == 'LONG':
|
||||||
return int(value)
|
return int(value)
|
||||||
|
|
|
@ -124,6 +124,9 @@ class ThriftClientRouter(object):
|
||||||
for gridDataRecord in response.getGridData():
|
for gridDataRecord in response.getGridData():
|
||||||
locationName = gridDataRecord.getLocationName()
|
locationName = gridDataRecord.getLocationName()
|
||||||
if locationName is not None:
|
if locationName is not None:
|
||||||
|
if six.PY2:
|
||||||
|
locData = locSpecificData[locationName]
|
||||||
|
else:
|
||||||
locData = locSpecificData[locationName.encode('utf-8')]
|
locData = locSpecificData[locationName.encode('utf-8')]
|
||||||
else:
|
else:
|
||||||
locData = locSpecificData[locationName]
|
locData = locSpecificData[locationName]
|
||||||
|
|
Loading…
Add table
Reference in a new issue