aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-07-17 13:10:55 +0300
committerFilipp Lepalaan <f@230.to>2013-07-17 13:10:55 +0300
commit7e8264ca52597adbecc99cd2e6d13561213c4dd3 (patch)
tree800b250c2f752161e2790f1494a79d3d57796b0d
parentd1ea36c16454c15e9792c33e52d3f548936402ff (diff)
downloadpy-gsxws-7e8264ca52597adbecc99cd2e6d13561213c4dd3.tar.gz
py-gsxws-7e8264ca52597adbecc99cd2e6d13561213c4dd3.tar.bz2
py-gsxws-7e8264ca52597adbecc99cd2e6d13561213c4dd3.zip
Always return Element.text if StringElement
-rw-r--r--gsxws/objectify.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/gsxws/objectify.py b/gsxws/objectify.py
index 800e7e9..96b7c6e 100644
--- a/gsxws/objectify.py
+++ b/gsxws/objectify.py
@@ -85,21 +85,23 @@ class GsxElement(objectify.ObjectifiedElement):
return result.pyval
if isinstance(result, objectify.StringElement):
+
name = result.tag
+ result = result.text
- if not result.text:
+ if not result:
return
if name in DATETIME_TYPES:
- return gsx_datetime(result.text)
+ return gsx_datetime(result)
if name in BASE64_TYPES:
- return gsx_attachment(result.text)
+ return gsx_attachment(result)
if name in FLOAT_TYPES:
return GsxPriceElement
if re.search(r'Date$', name):
- return gsx_date(result.text)
- if re.search(r'^[YN]$', result.text):
- return gsx_boolean(result.text)
+ return gsx_date(result)
+ if re.search(r'^[YN]$', result):
+ return gsx_boolean(result)
return result