From ffddda74331a3a95d9ae48c0a499d8e8e377a1f5 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Wed, 21 Nov 2018 02:03:01 +0100 Subject: Filter 'rupture de stock' from prix-carburant --- jobs/prix_carburant.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'jobs') diff --git a/jobs/prix_carburant.py b/jobs/prix_carburant.py index 21e6c26..0f3eb86 100755 --- a/jobs/prix_carburant.py +++ b/jobs/prix_carburant.py @@ -6,6 +6,8 @@ from html.parser import HTMLParser from urllib import request +rupture = 'Rupture de stock' + class Station: def __init__(self): self.station_name = "" @@ -14,6 +16,7 @@ class Station: def clean(self): self.prices = filter(lambda kv: kv[1] != '', self.prices.items()) + self.prices = filter(lambda kv: kv[1] != rupture, self.prices) self.prices = dict(map(lambda kv: (kv[0], float(kv[1])), self.prices)) def __repr__(self): -- cgit v1.2.1