diff options
author | Filipp Lepalaan <f@230.to> | 2013-07-20 22:00:54 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-07-20 22:00:54 +0300 |
commit | 05551fbdd641d25cc20648afade7e8c78545a341 (patch) | |
tree | c641c878c9a09b73e2c0c378b6bcca39fec04c39 /gsxws/objectify.py | |
parent | ce8ada78e4b285f51ae83ad78990b16582588a36 (diff) | |
download | py-gsxws-05551fbdd641d25cc20648afade7e8c78545a341.tar.gz py-gsxws-05551fbdd641d25cc20648afade7e8c78545a341.tar.bz2 py-gsxws-05551fbdd641d25cc20648afade7e8c78545a341.zip |
Return prices correctly
Diffstat (limited to 'gsxws/objectify.py')
-rw-r--r-- | gsxws/objectify.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gsxws/objectify.py b/gsxws/objectify.py index 43d6426..a1856d9 100644 --- a/gsxws/objectify.py +++ b/gsxws/objectify.py @@ -51,10 +51,8 @@ def gsx_boolean(value): return value == 'Y' or value == 'true' -class GsxPriceElement(): - @property - def pyval(self): - return float(re.sub(r'[A-Z ,]', '', self.text)) +def gsx_price(value): + return float(re.sub(r'[A-Z ,]', '', value)) def gsx_attachment(value): @@ -97,7 +95,7 @@ class GsxElement(objectify.ObjectifiedElement): if name in BASE64_TYPES: return gsx_attachment(result) if name in FLOAT_TYPES: - return GsxPriceElement + return gsx_price(result) if re.search(r'Date$', name): return gsx_date(result) if re.search(r'^[YN]$', result): |