mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 22:57:56 -05:00
revert all utf-8 encoding/decoding
This commit is contained in:
parent
ec6bf0fd79
commit
9ed66f22c6
2 changed files with 7 additions and 11 deletions
|
@ -23,8 +23,8 @@ class PyData(IData):
|
||||||
self.__attributes = dataRecord.getAttributes()
|
self.__attributes = dataRecord.getAttributes()
|
||||||
|
|
||||||
def getAttribute(self, key):
|
def getAttribute(self, key):
|
||||||
value = self.__attributes[key.encode('utf-8')]
|
value = self.__attributes[key]
|
||||||
return value.decode('utf-8')
|
return value
|
||||||
|
|
||||||
def getAttributes(self):
|
def getAttributes(self):
|
||||||
return list(self.__attributes.keys())
|
return list(self.__attributes.keys())
|
||||||
|
@ -33,7 +33,7 @@ class PyData(IData):
|
||||||
return self.__time
|
return self.__time
|
||||||
|
|
||||||
def getLevel(self):
|
def getLevel(self):
|
||||||
return self.__level.decode('utf-8')
|
return self.__level
|
||||||
|
|
||||||
def getLocationName(self):
|
def getLocationName(self):
|
||||||
return self.__locationName
|
return self.__locationName
|
||||||
|
|
|
@ -37,13 +37,11 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
||||||
return list(self.__dataMap.keys())
|
return list(self.__dataMap.keys())
|
||||||
|
|
||||||
def getString(self, param):
|
def getString(self, param):
|
||||||
param = param.encode('utf-8')
|
|
||||||
value = self.__dataMap[param][0]
|
value = self.__dataMap[param][0]
|
||||||
return value.decode('utf-8')
|
return value
|
||||||
|
|
||||||
def getNumber(self, param):
|
def getNumber(self, param):
|
||||||
t = self.getType(param)
|
t = self.getType(param)
|
||||||
param = param.encode('utf-8')
|
|
||||||
value = self.__dataMap[param][0]
|
value = self.__dataMap[param][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)
|
||||||
|
@ -52,14 +50,12 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
||||||
elif t == 'DOUBLE':
|
elif t == 'DOUBLE':
|
||||||
return float(value)
|
return float(value)
|
||||||
else:
|
else:
|
||||||
raise TypeError("Data for parameter " + param.decode('utf-8') + " is not a numeric type.")
|
raise TypeError("Data for parameter " + param + " is not a numeric type.")
|
||||||
|
|
||||||
def getUnit(self, param):
|
def getUnit(self, param):
|
||||||
param = param.encode('utf-8')
|
|
||||||
unit = self.__dataMap[param][2]
|
unit = self.__dataMap[param][2]
|
||||||
return unit.decode('utf-8')
|
return unit
|
||||||
|
|
||||||
def getType(self, param):
|
def getType(self, param):
|
||||||
param = param.encode('utf-8')
|
|
||||||
type = self.__dataMap[param][1]
|
type = self.__dataMap[param][1]
|
||||||
return type.decode('utf-8')
|
return type
|
||||||
|
|
Loading…
Add table
Reference in a new issue