From 03215467d467c429962822b90c5f95473389378a Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 20 Dec 2011 21:03:14 +0100 Subject: tracking: Added proper check for delivered packages. --- modules/tracking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') 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): -- cgit v1.2.3