[cookboob] cap/app modified to handle interval number of persons

This commit is contained in:
Julien Veyssier 2013-03-30 15:02:56 +01:00
commit 06b670af47
2 changed files with 10 additions and 5 deletions

View file

@ -43,7 +43,10 @@ class RecipeInfoFormatter(IFormatter):
if not empty(obj.cooking_time):
result += 'Cooking time: %smin\n' % obj.cooking_time
if not empty(obj.nb_person):
result += 'Amount of people: %s\n' % obj.nb_person
nbstr = obj.nb_person[0]
if len(obj.nb_person) > 1:
nbstr += '/%s' % obj.nb_person[1]
result += 'Amount of people: %s\n' % nbstr
result += '\n%sIngredients%s\n' % (self.BOLD, self.NC)
for i in obj.ingredients:
result += ' * %s\n' % i