X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/26aa2369c47124fb322236e03084324914aa24af..565aa32ff31bdbe6e2aaf9f47b124ac1f883a990:/librarian/pyhtml.py diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 8615ba2..163d11c 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -131,7 +131,7 @@ class EduModule(Xmill): counter = self.activity_counter - if element.getnext().tag == 'aktywnosc' or self.activity_last.getnext() == element: + if element.getnext().tag == 'aktywnosc' or (self.activity_last and self.activity_last.getnext() == element): counter_html = """%(counter)d.""" % {'counter': counter} else: counter_html = '' @@ -153,7 +153,7 @@ class EduModule(Xmill):
-""" % {'wskazowki': wskazowki, 'czas': czas, 'forma': forms, 'pomoce': pomoce}) +""" % {'wskazowki': wskazowki, 'czas': czas, 'forma': forma, 'pomoce': pomoce}) handle_opis = ifoption(sub_gen=True)(tag('div', 'description')) handle_wskazowki = ifoption(sub_gen=True)(tag('div', ('hints', 'teacher'))) @@ -251,7 +251,7 @@ class EduModule(Xmill): subgen = EduModule(self.options) definiens_s = subgen.generate(definiens) else: - print "!! Missing definiendum in source: '%s'" % element.text + print ("!! Missing definiendum in source: '%s'" % element.text).encode('utf-8') return u"
" % self.naglowek_to_anchor(element), u"
" + definiens_s @@ -659,7 +659,7 @@ class EduModuleFormat(Format): order = {pmf: i for (i, pmf) in enumerate(self.PRIMARY_MATERIAL_FORMATS)} mats = self.materials_by_slug.get(slug, {}).items() if not mats: - print "!! Material missing: '%s'" % slug + print ("!! Material missing: '%s'" % slug).encode('utf-8') return sorted(mats, key=lambda (x, y): order.get(x, x)) def url_for_material(self, slug, fmt):