From 34a7c25cef926e18465f996cf15c67a9cf783d0d Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 25 Mar 2013 12:23:32 +0100 Subject: [PATCH] [cookboob] export handle comments --- weboob/capabilities/recipe.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/weboob/capabilities/recipe.py b/weboob/capabilities/recipe.py index a58759e9..88d61270 100644 --- a/weboob/capabilities/recipe.py +++ b/weboob/capabilities/recipe.py @@ -113,6 +113,22 @@ class Recipe(CapBaseObject): instructions = ET.SubElement(recipe, 'krecipes-instructions') instructions.text = self.instructions + if not empty(self.comments): + ratings = ET.SubElement(recipe, 'krecipes-ratings') + for c in self.comments: + rating = ET.SubElement(ratings, 'rating') + com = ET.SubElement(rating, 'comment') + com.text = c + crits = ET.SubElement(rating, 'criterion') + crit = ET.SubElement(crits, 'criteria') + critname = ET.SubElement(crit, 'name') + critname.text = '' + critstars = ET.SubElement(crit, 'stars') + critstars.text = '' + + rater = ET.SubElement(rating, 'rater') + rater.text = '' + return header + ET.tostring(doc, encoding='UTF-8', pretty_print=True).decode('utf-8')