Don't call super cause it makes little sense
[librarian.git] / librarian / pyhtml.py
index 5538b7f..e5ca40e 100644 (file)
@@ -42,9 +42,9 @@ class EduModule(Xmill):
         self.activity_counter += 1
         self.options = {
             'activity': True,
-            'activity_counter': self.activity_counter
+            'activity_counter': self.activity_counter,
             }
-        submill = EduModule(self.options)
+        submill = EduModule(dict(self.options.items() + {'sub_gen': True}.items()))
 
         opis = submill.generate(element.xpath('opis')[0])
 
@@ -78,10 +78,10 @@ class EduModule(Xmill):
 </div>
 """ % locals()
 
-    handle_opis = ifoption(activity=True)(tag('div', 'description'))
-    handle_wskazowki = ifoption(activity=True)(tag('div', ('hints', 'teacher')))
+    handle_opis = ifoption(sub_gen=True)(tag('div', 'description'))
+    handle_wskazowki = ifoption(sub_gen=True)(tag('div', ('hints', 'teacher')))
 
-    @ifoption(activity=True)
+    @ifoption(sub_gen=True)
     @tagged('div', 'materials')
     def handle_pomoce(self, _):
         return "Pomoce: ", ""
@@ -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']