f9e210dd5631eb3b7be95179da245e51ae554ecb
[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     TXT_LEGACY_TOP_MARGIN = 3
15     TXT_LEGACY_BOTTOM_MARGIN = 1
16
17     HTML_TAG = "div"
18     HTML_CLASS = "person-list"
19
20     def _html_build_inner(self, builder):
21         ol = etree.Element('ol')
22         builder.create_fragment('list', ol)
23         super(ListaOsob, self)._html_build_inner(builder)
24         builder.cursor.append(ol)
25         builder.forget_fragment('list')
26
27     def _epub_build_inner(self, builder):
28         ol = etree.Element('ol')
29         builder.create_fragment('list', ol)
30         super(ListaOsob, self)._epub_build_inner(builder)
31         builder.cursor.append(ol)
32         builder.forget_fragment('list')