from librarian import DCNS, get_resource, IOFile
from librarian import functions
from pdf import PDFFormat, substitute_hyphens, fix_hanging
from librarian import DCNS, get_resource, IOFile
from librarian import functions
from pdf import PDFFormat, substitute_hyphens, fix_hanging
return
@escape(True)
def get_rightsinfo(self, element):
rights_lic = self.get_dc(element, 'rights.license', True)
return
@escape(True)
def get_rightsinfo(self, element):
rights_lic = self.get_dc(element, 'rights.license', True)
- return u'<cmd name="rightsinfostr">' + \
- (rights_lic and u'<opt>%s</opt>' % rights_lic or '') +\
- u'<parm>%s</parm>' % self.get_dc(element, 'rights', True) +\
- u'</cmd>'
+ return u'<cmd name="rightsinfostr">' + (rights_lic and u'<opt>%s</opt>' % rights_lic or '') + \
+ u'<parm>%s</parm>' % self.get_dc(element, 'rights', True) + \
+ u'</cmd>'
- <TeXML xmlns="http://getfo.sourceforge.net/texml/ns1">
- <TeXML escape="0">
- \\documentclass[%s]{wl}
- \\usepackage{style}''' % self.options['customization_str'],
- self.options['has_cover'] and '\usepackage{makecover}',
- (self.options['morefloats'] == 'new' and '\usepackage[maxfloats=64]{morefloats}') or
- (self.options['morefloats'] == 'old' and '\usepackage{morefloats}') or
- (self.options['morefloats'] == 'none' and
- u'''\\IfFileExists{morefloats.sty}{
- \\usepackage{morefloats}
- }{}'''),
- u'''\\def\\authors{%s}''' % self.get_authors(element),
- u'''\\def\\authorsexpert{%s}''' % self.get_authors(element, 'expert'),
- u'''\\def\\authorsscenario{%s}''' % self.get_authors(element, 'scenario'),
- u'''\\def\\authorstextbook{%s}''' % self.get_authors(element, 'textbook'),
-
- u'''\\author{\\authors}''',
- u'''\\title{%s}''' % self.get_title(element),
- u'''\\def\\bookurl{%s}''' % self.options['wldoc'].book_info.url.canonical(),
- u'''\\def\\rightsinfo{%s}''' % self.get_rightsinfo(element),
- u'</TeXML>']
+ <TeXML xmlns="http://getfo.sourceforge.net/texml/ns1">
+ <TeXML escape="0">
+ \\documentclass[%s]{wl}
+ \\usepackage{style}''' % self.options['customization_str'],
+ self.options['has_cover'] and '\usepackage{makecover}',
+ (self.options['morefloats'] == 'new' and '\usepackage[maxfloats=64]{morefloats}') or
+ (self.options['morefloats'] == 'old' and '\usepackage{morefloats}') or
+ (self.options['morefloats'] == 'none' and
+ u'''\\IfFileExists{morefloats.sty}{
+ \\usepackage{morefloats}
+ }{}'''),
+ u'''\\def\\authors{%s}''' % self.get_authors(element),
+ u'''\\def\\authorsexpert{%s}''' % self.get_authors(element, 'expert'),
+ u'''\\def\\authorsscenario{%s}''' % self.get_authors(element, 'scenario'),
+ u'''\\def\\authorstextbook{%s}''' % self.get_authors(element, 'textbook'),
+
+ u'''\\author{\\authors}''',
+ u'''\\title{%s}''' % self.get_title(element),
+ u'''\\def\\bookurl{%s}''' % self.options['wldoc'].book_info.url.canonical(),
+ u'''\\def\\rightsinfo{%s}''' % self.get_rightsinfo(element),
+ u'</TeXML>'
+ ]
- handle_akap = \
- handle_akap_cd = \
- handle_akap_cd = \
- handle_akap_dialog = \
- handle_akap_dialog = \
- handle_autor_utworu = \
- handle_dedykacja = \
- handle_didaskalia = \
- handle_didask_tekst = \
- handle_dlugi_cytat = \
- handle_dzielo_nadrzedne = \
- handle_lista_osoba = \
- handle_mat = \
- handle_miejsce_czas = \
- handle_motto = \
- handle_motto_podpis = \
- handle_naglowek_akt = \
- handle_naglowek_czesc = \
- handle_naglowek_listy = \
- handle_naglowek_osoba = \
- handle_naglowek_scena = \
- handle_nazwa_utworu = \
- handle_nota = \
- handle_osoba = \
- handle_pa = \
- handle_pe = \
- handle_podtytul = \
- handle_poezja_cyt = \
- handle_pr = \
- handle_pt = \
- handle_sekcja_asterysk = \
- handle_sekcja_swiatlo = \
- handle_separator_linia = \
- handle_slowo_obce = \
- handle_srodtytul = \
- handle_tytul_dziela = \
- handle_wyroznienie = \
- handle_dywiz = \
- handle_texcommand
+ handle_akap_cd = \
+ handle_akap_dialog = \
+ handle_autor_utworu = \
+ handle_dedykacja = \
+ handle_didaskalia = \
+ handle_didask_tekst = \
+ handle_dlugi_cytat = \
+ handle_dzielo_nadrzedne = \
+ handle_lista_osoba = \
+ handle_mat = \
+ handle_miejsce_czas = \
+ handle_motto = \
+ handle_motto_podpis = \
+ handle_naglowek_akt = \
+ handle_naglowek_czesc = \
+ handle_naglowek_listy = \
+ handle_naglowek_osoba = \
+ handle_naglowek_scena = \
+ handle_nazwa_utworu = \
+ handle_nota = \
+ handle_osoba = \
+ handle_pa = \
+ handle_pe = \
+ handle_podtytul = \
+ handle_poezja_cyt = \
+ handle_pr = \
+ handle_pt = \
+ handle_sekcja_asterysk = \
+ handle_sekcja_swiatlo = \
+ handle_separator_linia = \
+ handle_slowo_obce = \
+ handle_srodtytul = \
+ handle_tytul_dziela = \
+ handle_wyroznienie = \
+ handle_dywiz = \
+ handle_texcommand
# print '** missing src on <slowniczek>, setting default'
surl = 'http://edukacjamedialna.edu.pl/lekcje/slowniczek/'
sxml = etree.fromstring(self.options['wldoc'].provider.by_uri(surl).get_string())
# print '** missing src on <slowniczek>, setting default'
surl = 'http://edukacjamedialna.edu.pl/lekcje/slowniczek/'
sxml = etree.fromstring(self.options['wldoc'].provider.by_uri(surl).get_string())
if self.options['slowniczek_xml'] is not None and (nxt is None or nxt.tag != 'definiens'):
sxml = self.options['slowniczek_xml']
assert element.text != ''
if self.options['slowniczek_xml'] is not None and (nxt is None or nxt.tag != 'definiens'):
sxml = self.options['slowniczek_xml']
assert element.text != ''
- # has_frames = int(element.attrib.get("ramki", "0"))
- # if has_frames: frames_c = "framed"
- # else: frames_c = ""
- # return u"""<table class="%s">""" % frames_c, u"</table>"
+ # has_frames = int(element.attrib.get("ramki", "0"))
+ # if has_frames: frames_c = "framed"
+ # else: frames_c = ""
+ # return u"""<table class="%s">""" % frames_c, u"</table>"
img_path = "video/%s.jpg" % name.replace("_", "")
self.options['format'].attachments[img_path] = thumb
canon_url = "https://www.youtube.com/watch?v=%s" % name
img_path = "video/%s.jpg" % name.replace("_", "")
self.options['format'].attachments[img_path] = thumb
canon_url = "https://www.youtube.com/watch?v=%s" % name
def __init__(self, *args, **kw):
self.question_counter = 0
super(Exercise, self).__init__(*args, **kw)
def __init__(self, *args, **kw):
self.question_counter = 0
super(Exercise, self).__init__(*args, **kw)
# Add a single <pytanie> tag if it's not there
if not element.xpath(".//pytanie"):
qpre, qpost = self.handle_pytanie(element)
# Add a single <pytanie> tag if it's not there
if not element.xpath(".//pytanie"):
qpre, qpost = self.handle_pytanie(element)
class Wybor(Exercise):
def handle_cwiczenie(self, element):
pre, post = super(Wybor, self).handle_cwiczenie(element)
class Wybor(Exercise):
def handle_cwiczenie(self, element):
pre, post = super(Wybor, self).handle_cwiczenie(element)