From 68e36d400bac79788e5fe06f56236c3a9f09e018 Mon Sep 17 00:00:00 2001 From: Michael James Date: Mon, 15 Oct 2018 08:19:21 -0600 Subject: [PATCH] cleanup PyGeometryData getString()/2 --- awips/dataaccess/PyGeometryData.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/awips/dataaccess/PyGeometryData.py b/awips/dataaccess/PyGeometryData.py index d83c62c..c61f3c0 100644 --- a/awips/dataaccess/PyGeometryData.py +++ b/awips/dataaccess/PyGeometryData.py @@ -42,10 +42,13 @@ class PyGeometryData(IGeometryData, PyData.PyData): def getString(self, param): if six.PY2: - return str(self.__dataMap[param][0]) - else: - value = self.__dataMap[param.encode('utf-8')][0] + return self.__dataMap[param][0] + value = self.__dataMap[param.encode('utf-8')][0] + if isinstance(value, int): + return str(value) + if value is not None: return str(value.decode('utf-8')) + return value def getNumber(self, param): t = self.getType(param)