From d6d07b7e85c360fe7ea047d3bc80b8769c90e660 Mon Sep 17 00:00:00 2001 From: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl> Date: Thu, 14 Feb 2013 15:23:43 +0100 Subject: [PATCH] minor fixes --- librarian/pyhtml.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index d36e0fe..d868a17 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -268,7 +268,7 @@ u"""%(wskazowki)s url = self.options['urlmapper'].url_for_image(slug, ext) thumb_url = self.options['urlmapper'].url_for_image(slug, ext, IMAGE_THUMB_WIDTH) e = etree.Element("a", attrib={"href": url, "class": "image"}) - e.append(etree.Element("img", attrib={"src": url, "alt": alt, + e.append(etree.Element("img", attrib={"src": thumb_url, "alt": alt, "width": str(IMAGE_THUMB_WIDTH)})) return etree.tostring(e, encoding=unicode), u"" @@ -277,7 +277,7 @@ u"""%(wskazowki)s if not url: print '!! <video> missing url' return - m = re.match(r'https?://(?:www.)?youtube.com/watch\?(?:.*&)?v=([^&]+)(?:$|&)', url) + m = re.match(r'(?:https?://)?(?:www.)?youtube.com/watch\?(?:.*&)?v=([^&]+)(?:$|&)', url) if not m: print '!! unknown <video> url scheme:', url return @@ -491,7 +491,6 @@ class Przyporzadkuj(Exercise): u"Kliknij numer odpowiedzi, przeciÄ gnij i upuÅÄ w wybranym polu."] def get_instruction(self): - print self.options['handles'] if not self.instruction_printed: self.instruction_printed = True return u'<span class="instruction">%s</span>' % self.INSTRUCTION[self.options['handles'] and 1 or 0] -- 2.20.1