Exemple #1
0
    def renderRequestTrust(self):
        result = [

            Panel(heading='Untrusted',
                  content=[
                      T.p(id='untrusted')[
                          T.a(href='#', onclick='return IGBManager.requestTrust()')['Please trust me!']
                      ],

                      T.p()[
                          T.a(href='#', onclick='return IGBManager.reload()')['Reload page'],
                          ' when you accepted trust request'
                      ]
                  ])


        ]

        return result
Exemple #2
0
def test_escaping():
    """escaping, xml() directive"""
    template = T.html[
        T.head[T.title[my_name()]],
        T.body[
            T.div(style='width: 400px;<should be &escaped&>')[
                T.p(class_='foo')['&&&'],
                T.p['Coffee', E.nbsp, E.amp, E.nbsp, 'cream'],
                xml ("""<div>this should be <u>unescaped</u> &amp; unaltered.</div>""")
            ]
        ]
    ]
    output = flatten(template)
    assert output == ('<html><head><title>test_escaping</title></head>'
                      '<body><div style="width: 400px;&lt;should be &amp;escaped&amp;&gt;">'
                      '<p class="foo">&amp;&amp;&amp;</p><p>Coffee&#160;&#38;&#160;cream</p>'
                      '<div>this should be <u>unescaped</u> &amp; unaltered.</div></div>'
                      '</body></html>')