Don't call super cause it makes little sense
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 6 Feb 2013 13:42:56 +0000 (14:42 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 6 Feb 2013 13:49:11 +0000 (14:49 +0100)
fix searching for luki/zastap tags

librarian/pyhtml.py

index bed9798..e5ca40e 100644 (file)
@@ -302,7 +302,8 @@ Overrides the returned content default handle_pytanie
 
 class Luki(Exercise):
     def find_pieces(self, question):
-        return question.xpath("//luka")
+        print question.xpath(".//luka")
+        return question.xpath(".//luka")
 
     def solution_html(self, piece):
         return piece.text + ''.join(
@@ -325,8 +326,7 @@ class Luki(Exercise):
         return qpre, qpost
 
     def handle_opis(self, element):
-        pre, post = super(Luki, self).handle_opis(element)
-        return pre, self.words_html + post
+        return '', self.words_html
 
     def handle_luka(self, element):
         self.piece_counter += 1
@@ -335,7 +335,7 @@ class Luki(Exercise):
 
 class Zastap(Luki):
     def find_pieces(self, question):
-        return question.xpath("//zastap")
+        return question.xpath(".//zastap")
 
     def solution_html(self, piece):
         return piece.attrib['rozw']