X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/fe8e5b5e224d32baebbdaa2fecf4a847ed4e5354..3b0b98465bc1862306b05bb8305a1abbf40ca310:/librarian/fb2.py diff --git a/librarian/fb2.py b/librarian/fb2.py index 1e110f5..bc1504d 100644 --- a/librarian/fb2.py +++ b/librarian/fb2.py @@ -17,10 +17,11 @@ functions.reg_person_name() def sectionify(tree): """Finds section headers and adds a tree of _section tags.""" - sections = ['naglowek_czesc', - 'naglowek_akt', 'naglowek_rozdzial', 'naglowek_scena', - 'naglowek_podrozdzial'] - section_level = dict((v,k) for (k,v) in enumerate(sections)) + sections = [ + 'naglowek_czesc', + 'naglowek_akt', 'naglowek_rozdzial', 'naglowek_scena', + 'naglowek_podrozdzial'] + section_level = {v: k for (k, v) in enumerate(sections)} # We can assume there are just subelements an no text at section level. for level, section_name in reversed(list(enumerate(sections))):