diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-12-20 21:03:14 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-12-20 21:03:14 +0100 |
commit | 03215467d467c429962822b90c5f95473389378a (patch) | |
tree | 2f404d72701013f553be7970855626d4aed127d8 /modules | |
parent | bdb00c28a02f844c6832d5438bc60328dd47aced (diff) |
tracking: Added proper check for delivered packages.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tracking.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/tracking.py b/modules/tracking.py index 548faa2..64db2b6 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -113,10 +113,11 @@ class PostenModule(TrackingModule): isodate = last.find('{%s}OccuredAtIsoDateTime' % ns).text[:-10] isodate = datetime.datetime.strptime(isodate, '%Y-%m-%dT%H:%M:%S') city = last.find('{%s}City' % ns).text + status = last.find('{%s}Status' % ns).text.encode('utf-8') if city: desc = '%s (%s)' % (desc, city.encode('utf8')) date = last.find('{%s}OccuredAtDisplayDate' % ns).text + ' ' + last.find('{%s}OccuredAtDisplayTime' % ns).text - results.append(TrackingResult(code, isodate, desc, 'Sendingen er utlevert' in desc)) + results.append(TrackingResult(code, isodate, desc, status == 'DELIVERED')) return results def code_split(code): |