From 76c345461747e182572ff85d18a3ab24d7fca851 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Sat, 30 Mar 2013 23:50:12 +0100 Subject: [PATCH] [cookboob] [qcookboob] better nb_person interval display --- weboob/applications/cookboob/cookboob.py | 4 +--- weboob/applications/qcookboob/recipe.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/weboob/applications/cookboob/cookboob.py b/weboob/applications/cookboob/cookboob.py index c6f3d90a..613689d1 100644 --- a/weboob/applications/cookboob/cookboob.py +++ b/weboob/applications/cookboob/cookboob.py @@ -44,9 +44,7 @@ class RecipeInfoFormatter(IFormatter): if not empty(obj.cooking_time): result += 'Cooking time: %smin\n' % obj.cooking_time if not empty(obj.nb_person): - nbstr = '%s' % obj.nb_person[0] - if len(obj.nb_person) > 1: - nbstr += '/%s' % obj.nb_person[1] + nbstr = '-'.join(str(num) for num in obj.nb_person) result += 'Amount of people: %s\n' % nbstr result += '\n%sIngredients%s\n' % (self.BOLD, self.NC) for i in obj.ingredients: diff --git a/weboob/applications/qcookboob/recipe.py b/weboob/applications/qcookboob/recipe.py index bb9c3ff6..f8937a4e 100644 --- a/weboob/applications/qcookboob/recipe.py +++ b/weboob/applications/qcookboob/recipe.py @@ -43,9 +43,7 @@ class Recipe(QFrame): if not empty(recipe.title): self.ui.titleLabel.setText(recipe.title) if not empty(recipe.nb_person): - nbstr = '%s' % recipe.nb_person[0] - if len(recipe.nb_person) > 1: - nbstr += '/%s' % recipe.nb_person[1] + nbstr = '-'.join(str(num) for num in recipe.nb_person) self.ui.nbPersonLabel.setText(nbstr) else: self.ui.nbPersonLabel.parent().hide()