Exemplo n.º 1
0
Arquivo: html.py Projeto: chfoo/wuff
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        footer = E.footer(role='contentinfo', id='layout-footer')
        content = E.main(role='main', id='layout-content')
        header = E.header(role='banner', id='layout-header')
        layout = E.div(header, content, footer, id='layout-wrapper')
        body = E.body(layout)
        head = E.head(prefix='og: http://ogp.me/ns#')
        html = E.html(head, body, dir='rtl' if self.locale.rtl else 'ltr')

        self.elements = Elements(html=html, head=head, body=body,
            layout=layout, header=header, content=content, footer=footer)
        self.meta = HTMLMeta()
        self.links = HTMLLinks()

        self.stylesheets = []
        self.scripts = []

        self.meta.app_name = self.handler.application.settings[
            'application_name']
Exemplo n.º 2
0
 def test_html_builder(self):
     html = HE.html(HE.head(HE.title("H-T-M-L!")), HE.body(HE.p("TexT")))
     self.assertEqual("TexT", html.findtext(".//p"))