From f20435fd054f9176b8f867cd85322697d242b493 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 18 Feb 2013 13:32:29 +0100 Subject: [PATCH] slowniczek in pdf --- librarian/pdf.py | 2 +- librarian/pypdf.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/librarian/pdf.py b/librarian/pdf.py index 2cbc2c0..03879fe 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -290,7 +290,7 @@ class PDFFormat(Format): p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE) if p: - raise ParseError("Error parsing .tex file") + raise ParseError("Error parsing .tex file: %s" % tex_path) if cwd is not None: os.chdir(cwd) diff --git a/librarian/pypdf.py b/librarian/pypdf.py index adc414c..b56d1a6 100644 --- a/librarian/pypdf.py +++ b/librarian/pypdf.py @@ -263,7 +263,10 @@ class EduModule(Xmill): return None ltype = element.attrib.get('typ', 'punkt') if ltype == 'slowniczek': - surl = element.attrib.get('href', None) + surl = element.attrib.get('src', None) + if surl is None: + # print '** missing src on , setting default' + surl = 'http://edukacjamedialna.edu.pl/slowniczek' sxml = None if surl: sxml = etree.fromstring(self.options['provider'].by_uri(surl).get_string()) @@ -305,7 +308,7 @@ class EduModule(Xmill): definiens_s = '' # let's pull definiens from another document - if self.options['slowniczek_xml'] and (not nxt or nxt.tag != 'definiens'): + if self.options['slowniczek_xml'] is not None and (nxt is None or nxt.tag != 'definiens'): sxml = self.options['slowniczek_xml'] assert element.text != '' defloc = sxml.xpath("//definiendum[text()='%s']" % element.text) @@ -583,6 +586,7 @@ class EduModulePDFFormat(PDFFormat): def get_texml(self): self.attachments = {} edumod = EduModule({ + 'provider': self.wldoc.provider, "format": self, "teacher": self.customization.get('teacher'), }) -- 2.20.1