diff options
author | Filipp Lepalaan <filipp@mac.com> | 2014-03-07 11:16:21 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2014-03-07 11:16:21 +0200 |
commit | 79e4628a53f1cac06f6426b301dafa1351412702 (patch) | |
tree | ae04368811a29f30b1d8b9298abcfcd2cd471fbf /gsxws/objectify.py | |
parent | 187735f29c43e5356b8d153f7db82e05d2440d60 (diff) | |
download | py-gsxws-79e4628a53f1cac06f6426b301dafa1351412702.tar.gz py-gsxws-79e4628a53f1cac06f6426b301dafa1351412702.tar.bz2 py-gsxws-79e4628a53f1cac06f6426b301dafa1351412702.zip |
Added timestamp datatype, more tests
Diffstat (limited to 'gsxws/objectify.py')
-rw-r--r-- | gsxws/objectify.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gsxws/objectify.py b/gsxws/objectify.py index 3480b70..b37379c 100644 --- a/gsxws/objectify.py +++ b/gsxws/objectify.py @@ -84,7 +84,8 @@ def gsx_datetime(value): def gsx_timestamp(value): - return datetime.strptime(value, "%d-%b-%y %H:%M:%S") + # 03/06/14 09:01 PM + return datetime.strptime(value, "%m/%d/%y %H:%M %p") class GsxElement(objectify.ObjectifiedElement): @@ -126,6 +127,8 @@ class GsxElement(objectify.ObjectifiedElement): return gsx_price(result) if name.endswith('Date'): return gsx_date(result) + if name.endswith('Timestamp'): + return gsx_timestamp(result) if re.search(r'^[YN]$', result): return gsx_boolean(result) @@ -153,8 +156,10 @@ def parse(root, response): return root.find('*//%s' % response) + if __name__ == '__main__': import doctest import logging logging.basicConfig(level=logging.DEBUG) doctest.testmod() + |