d8ea32ad77ae72a36216614612e4a1e34baa6d01
[librarian.git] / src / librarian / elements / drama / lista_osob.py
1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 from lxml import etree
5 from ..base import WLElement
6
7
8 class ListaOsob(WLElement):
9     NUMBERING = 'i'
10     CAN_HAVE_TEXT = False
11
12     TXT_TOP_MARGIN = 3
13     TXT_BOTTOM_MARGIN = 3
14
15     HTML_TAG = "div"
16     HTML_CLASS = "person-list"
17
18     def _html_build_inner(self, builder):
19         ol = etree.Element('ol')
20         builder.create_fragment('list', ol)
21         super(ListaOsob, self)._html_build_inner(builder)
22         builder.cursor.append(ol)
23         builder.forget_fragment('list')
24
25     def _epub_build_inner(self, builder):
26         ol = etree.Element('ol')
27         builder.create_fragment('list', ol)
28         super(ListaOsob, self)._epub_build_inner(builder)
29         builder.cursor.append(ol)
30         builder.forget_fragment('list')