8895aa8dde3ef7ca0657d09664c31c3d2bd2b11d
[librarian.git] / src / librarian / elements / drama / lista_osob.py
1 from lxml import etree
2 from ..base import WLElement
3
4
5 class ListaOsob(WLElement):
6     CAN_HAVE_TEXT = False
7     SHOULD_HAVE_ID = True
8
9     TXT_TOP_MARGIN = 3
10     TXT_BOTTOM_MARGIN = 3
11     TXT_LEGACY_TOP_MARGIN = 3
12     TXT_LEGACY_BOTTOM_MARGIN = 1
13
14     HTML_TAG = "div"
15     HTML_CLASS = "person-list"
16
17     def _html_build_inner(self, builder):
18         ol = etree.Element('ol')
19         builder.create_fragment('list', ol)
20         super(ListaOsob, self)._html_build_inner(builder)
21         builder.cursor.append(ol)
22         builder.forget_fragment('list')
23
24     def _epub_build_inner(self, builder):
25         ol = etree.Element('ol')
26         builder.create_fragment('list', ol)
27         super(ListaOsob, self)._epub_build_inner(builder)
28         builder.cursor.append(ol)
29         builder.forget_fragment('list')