'Pillow>=9.1.0',
'texml',
'ebooklib',
- 'aeneas',
'mutagen',
'qrcode',
'requests',
'fonttools',
+ 'python-bidi',
],
entry_points = {
"console_scripts": [
import subprocess
import tempfile
import zipfile
-from aeneas.executetask import ExecuteTask
-from aeneas.task import Task
from lxml import etree
import mutagen
from librarian import OutputFile, get_resource
directory + "book%d.mp3" % i,
)
- config_string = "task_language=pol|is_text_type=unparsed|is_text_unparsed_id_regex=sec\d+$|is_text_unparsed_id_sort=numeric|os_task_file_format=tab"
+ config_string = "task_language=pol|is_text_type=unparsed|is_text_unparsed_id_regex=sec\\d+$|is_text_unparsed_id_sort=numeric|os_task_file_format=tab"
task = Task(config_string=config_string)
with tempfile.TemporaryDirectory() as temp:
for i, child in enumerate(self):
if isinstance(child, WLElement):
getattr(child, build_method)(builder)
- elif getattr(builder, 'debug') and child.tag is etree.Comment:
+ elif getattr(builder, 'debug', False) and child.tag is etree.Comment:
builder.process_comment(child)
if self.CAN_HAVE_TEXT and child.tail:
text = self.normalize_text(child.tail, builder)
document.edoc.getroot().set(flag, 'yes')
ltag = document.edoc.find('//' + DCNS('language'))
- lang = functions.lang_code_3to2(ltag.text) or 'pl'
+ if ltag is not None:
+ lang = functions.lang_code_3to2(ltag.text)
+ else:
+ lang = 'pl'
document.edoc.getroot().set('lang', lang)
document.clean_ed_note()
-<div xmlns:wl="http://wolnelektury.pl/functions" xmlns:dc="http://purl.org/dc/elements/1.1/" id="book-text">
+<div xmlns:wl="http://wolnelektury.pl/functions" xmlns:dc="http://purl.org/dc/elements/1.1/" id="book-text" lang="pl">
<div id="toc">
<h2>Spis treści</h2>
<ol></ol>
<div class="stanza">
<a name="sec7"></a><div class="verse">Prócz tych wspólnych, jasnych zdrojów,</div>
<div class="verse">Z których serce zachwyt piło;</div>
-<a name="f15" class="target"> </a><a href="#f15" class="anchor">15</a><div class="verse">Prócz pierwiosnków<a name="anchor-idmNNN"></a><a href="#footnote-idmNNN" class="annotation">[1]</a><a class="reference" data-uri="https://www.wikidata.org/wiki/Q158974"></a> i powojów,—</div>
+<a name="f15" class="target"> </a><a href="#f15" class="anchor">15</a><div class="verse">Prócz pierwiosnków<a name="anchor-id1"></a><a href="#footnote-id1" class="annotation">[1]</a><a class="reference" data-uri="https://www.wikidata.org/wiki/Q158974"></a> i powojów,—</div>
<div class="verse">Między nami nic nie było!<span class="theme-end" fid="1189062528872"></span><span class="theme-end" fid="1189062500041"></span>
</div>
</div>
<div id="footnotes">
<h3>Przypisy</h3>
<div class="fn-pe">
-<a name="footnote-idmNNN"></a><a href="#anchor-idmNNN" class="annotation">[1]</a><p><em class="foreign-word">pierwiosnek</em> — taki kwiatek [przypis edytorski]</p>
+<a name="footnote-id1"></a><a href="#anchor-id1" class="annotation">[1]</a><p><em class="foreign-word">pierwiosnek</em> — taki kwiatek [przypis edytorski]</p>
</div>
</div>
</div>
[tox]
envlist =
clean,
- py{37,38,39,310,311},
+ py{38,39,310,311,312},
stats
[testenv]
deps =
coverage
-passenv = HOME ; Needed to find locally installed fonts when testing PDF production.
+; Needed to find locally installed fonts when testing PDF production.
+passenv = HOME
download = true
commands =
coverage run
-install_command = pip install numpy; pip install --extra-index-url https://py.mdrn.pl/simple {packages}
+install_command = pip install --extra-index-url https://py.mdrn.pl/simple {packages}
[testenv:clean]
-basepython = python3
+basepython = python312
commands =
coverage erase
deps = coverage
[testenv:stats]
-basepython = python3
+basepython = python312
commands =
coverage combine
coverage report