1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
7 class WersWciety(Wers):
10 v = self.attrib.get('typ')
11 return int(v) if v else 1
13 def _txt_build_inner(self, builder):
14 ## Temporary legacy compatibility fix.
15 typ = min(self.typ, 2)
17 builder.push_text(' ' * self.typ, prepared=True)
18 super(WersWciety, self)._txt_build_inner(builder)
20 def get_html_attr(self, builder):
21 attr = super(WersWciety, self).get_html_attr(builder)
22 attr['style'] = "padding-left: {}em".format(self.typ)
25 def get_epub_attr(self, builder):
26 attr = super(WersWciety, self).get_html_attr(builder)
27 attr['style'] = "margin-left: {}em".format(self.typ)