From ba8c5f53b309b7ee2d993397e24640615777ab16 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Wed, 9 Jan 2013 10:45:21 +0100 Subject: [PATCH] add if missing --- librarian/pyhtml.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index bd3bbce..909217a 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -142,11 +142,11 @@ class Excercise(EduModule): self.question_counter = 0 self.piece_counter = 0 - return u""" + pre = u"""
-""" % element.attrib, \ -u""" +""" % element.attrib + post = u"""
@@ -155,8 +155,16 @@ u"""
""" + # Add a single tag if it's not there + if not element.xpath(".//pytanie"): + qpre, qpost = self.handle_pytanie(element) + pre = pre + qpre + post = qpost + post + return pre, post def handle_pytanie(self, element): + """This will handle element, when there is no + """ self.question_counter += 1 self.piece_counter = 0 solution = element.attrib.get('rozw', None) @@ -189,7 +197,6 @@ class Uporzadkuj(Excercise): def handle_cwiczenie(self, element): pre, post = super(Uporzadkuj, self).handle_cwiczenie(element) order_items = element.xpath(".//punkt/@rozw") - import pdb if order_items == []: pdb.set_trace() return pre + u"""
""" % \ -- 2.20.1