From 49647d96e64199aee8ab6fbe0982c126d9a9ebcb Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Sat, 30 Mar 2013 17:19:15 +0100 Subject: [PATCH] [recipe] handle nb_person interval in export --- weboob/capabilities/recipe.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/weboob/capabilities/recipe.py b/weboob/capabilities/recipe.py index 3fa820fd..ab325cfd 100644 --- a/weboob/capabilities/recipe.py +++ b/weboob/capabilities/recipe.py @@ -91,9 +91,13 @@ class Recipe(CapBaseObject): eyield = ET.SubElement(desc, 'yield') if not empty(self.nb_person): amount = ET.SubElement(eyield, 'amount') - amount.text = '%s' % self.nb_person[0] - if len(self.nb_person) > 1: - amount.text += '/%s' % self.nb_person[1] + if len(self.nb_person) == 1: + amount.text = '%s' % self.nb_person[0] + else: + mini = ET.SubElement(amount, 'min') + mini.text = u'%s' % self.nb_person[0] + maxi = ET.SubElement(amount, 'max') + maxi.text = u'%s' % self.nb_person[1] etype = ET.SubElement(eyield, 'type') etype.text = 'persons' if not empty(self.preparation_time):