From: Radek Czajka Date: Mon, 18 Feb 2013 12:32:29 +0000 (+0100) Subject: slowniczek in pdf X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/f20435fd054f9176b8f867cd85322697d242b493?hp=bfdf1fb55d9a5ee7be5a16ef73e6237ad949ddcb slowniczek in pdf --- 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'), })