Ejemplo n.º 1
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_39931128 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236bf50> name=None at 236be90> -> _value
    _value = _static_37142352
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36787856 = _i18n_domain
    _i18n_domain = u'old'
    _backup_attrs_39848848 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236b8d0> name=None at 236b150> -> _value
    _value = _static_37140688
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_37142224 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_40301704 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236b650> name=None at 236b050> -> _value
    _value = _static_37140048
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_37142416 = _DebuggingOutputStream()
    _append_37142416 = _stream_37142416.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_37142416(_content_139955154988272)
    _msgid_37142416 = re_whitespace(''.join(_stream_37142416)).strip()
    append(translate(_msgid_37142416, mapping=None, default=_msgid_37142416, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_40301704 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_40301704
    _i18n_domain = _previous_i18n_domain_37142224
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_39862784 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x249f290> name=None at 249f3d0> -> _value
    _value = _static_38400656
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38576208 = _DebuggingOutputStream()
    _append_38576208 = _stream_38576208.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_38576208(_content_139955154988272)
    _msgid_38576208 = re_whitespace(''.join(_stream_38576208)).strip()
    append(translate(_msgid_38576208, mapping=None, default=_msgid_38576208, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_39862784 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39862784
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36789456 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_38619904 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x249f8d0> name=None at 249fe10> -> _value
    _value = _static_38402256
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div')
    _backup_default_38620624 = get('default', _marker)
    _value = u'test'
    econtext['default'] = _value

    # <Translate msgid=None node=<_ast.Str object at 0x249fc10> at 249f190> -> _attr_class
    _attr_class = u'test'
    _attr_class = translate(_attr_class, default=_attr_class, domain=_i18n_domain)
    if (_attr_class is None):
        pass
    else:
        if (_attr_class is False):
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if (_tt is str):
                        _attr_class = decode(_attr_class)
                    else:
                        if (_tt is not unicode):
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if ((_attr_class is not None) and (re_needs_escape(_attr_class) is not None)):
                        if ('&' in _attr_class):
                            if (';' in _attr_class):
                                _attr_class = re_amp.sub('&amp;', _attr_class)
                            else:
                                _attr_class = _attr_class.replace('&', '&amp;')
                        if ('<' in _attr_class):
                            _attr_class = _attr_class.replace('<', '&lt;')
                        if ('>' in _attr_class):
                            _attr_class = _attr_class.replace('>', '&gt;')
                        if (u'"' in _attr_class):
                            _attr_class = _attr_class.replace(u'"', '&#34;')
    if (_attr_class is not None):
        append((u' class="%s"' % _attr_class))
    if (_backup_default_38620624 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_38620624
    append(u'>')
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_38619904 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38619904
    _i18n_domain = _previous_i18n_domain_36789456
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36786320 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_38620120 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2315590> name=None at 23151d0> -> _value
    _value = _static_36787600
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div')
    _backup_default_38618464 = get('default', _marker)
    _value = u'test'
    econtext['default'] = _value

    # <Translate msgid=u'test_msgid' node=<_ast.Str object at 0x2315050> at 2315f10> -> _attr_class
    _attr_class = u'test'
    _attr_class = translate(u'test_msgid', default=_attr_class, domain=_i18n_domain)
    if (_attr_class is None):
        pass
    else:
        if (_attr_class is False):
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if (_tt is str):
                        _attr_class = decode(_attr_class)
                    else:
                        if (_tt is not unicode):
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if ((_attr_class is not None) and (re_needs_escape(_attr_class) is not None)):
                        if ('&' in _attr_class):
                            if (';' in _attr_class):
                                _attr_class = re_amp.sub('&amp;', _attr_class)
                            else:
                                _attr_class = _attr_class.replace('&', '&amp;')
                        if ('<' in _attr_class):
                            _attr_class = _attr_class.replace('<', '&lt;')
                        if ('>' in _attr_class):
                            _attr_class = _attr_class.replace('>', '&gt;')
                        if (u'"' in _attr_class):
                            _attr_class = _attr_class.replace(u'"', '&#34;')
    if (_attr_class is not None):
        append((u' class="%s"' % _attr_class))
    if (_backup_default_38618464 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_38618464
    append(u'>')
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_38620120 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38620120
    _i18n_domain = _previous_i18n_domain_36786320
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_39848848 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39848848
    _i18n_domain = _previous_i18n_domain_36787856
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_39931128 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39931128
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
Ejemplo n.º 2
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38432352 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x222b450> name=None at 222bfd0> -> _value
    _value = _static_35828816
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38429976 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4310> name=None at 24b4a50> -> _value
    _value = _static_38486800
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38429832 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b44d0> name=None at 24b45d0> -> _value
    _value = _static_38487248
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38489104 = _DebuggingOutputStream()
    _append_38489104 = _stream_38489104.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_38489104(_content_139955154988272)
    _msgid_38489104 = re_whitespace(''.join(_stream_38489104)).strip()
    append(translate(_msgid_38489104, mapping=None, default=_msgid_38489104, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38429832 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38429832
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38412088 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4210> name=None at 24b4510> -> _value
    _value = _static_38486544
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38487760 = _DebuggingOutputStream()
    _append_38487760 = _stream_38487760.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_38487760(_content_139955154988272)
    _msgid_38487760 = re_whitespace(''.join(_stream_38487760)).strip()
    append(translate(u'hello_world', mapping=None, default=_msgid_38487760, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38412088 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38412088
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38411152 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4e50> name=None at 24b4950> -> _value
    _value = _static_38489680
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38487888 = _DebuggingOutputStream()
    _append_38487888 = _stream_38487888.append
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _backup_attrs_38409280 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4a90> name=None at 24b4f10> -> _value
    _value = _static_38488720
    econtext['attrs'] = _value

    # <sup ... (10:6)
    # --------------------------------------------------------
    _append_38487888(u'<sup>')
    _content_139955154988272 = u'Hello world!'
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _append_38487888(u'</sup>')
    if (_backup_attrs_38409280 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38409280
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _msgid_38487888 = re_whitespace(''.join(_stream_38487888)).strip()
    append(translate(_msgid_38487888, mapping=None, default=_msgid_38487888, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38411152 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38411152
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38408848 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b41d0> name=None at 24b4350> -> _value
    _value = _static_38486480
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38489040 = _DebuggingOutputStream()
    _append_38489040 = _stream_38489040.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38489040(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_38460520 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24cac50> name=None at 24ca050> -> _value
    _value = _static_38579280
    econtext['attrs'] = _value

    # <em ... (13:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (13:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((u"'world'", 13, 36, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_38460520 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38460520
    _append_38489040(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38489040(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_38461384 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca910> name=None at 24cae10> -> _value
    _value = _static_38578448
    econtext['attrs'] = _value

    # <em ... (14:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (14:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((u"'planet'", 14, 39, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_38461384 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38461384
    _append_38489040(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38489040(_content_139955154988272)
    _msgid_38489040 = re_whitespace(''.join(_stream_38489040)).strip()
    append(translate(_msgid_38489040, mapping={u'second': _stream_35215016_second, u'first': _stream_35215016_first, }, default=_msgid_38489040, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38408848 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38408848
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38459368 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24caa90> name=None at 24ca6d0> -> _value
    _value = _static_38578832
    econtext['attrs'] = _value

    # <div ... (16:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38578576 = _DebuggingOutputStream()
    _append_38578576 = _stream_38578576.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38578576(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_37105888 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2238cd0> name=None at 2238f90> -> _value
    _value = _static_35884240
    econtext['attrs'] = _value

    # <em ... (17:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (17:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((u"'world'", 17, 36, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_37105888 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_37105888
    _append_38578576(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38578576(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_37108840 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x22f8e10> name=None at 22f8510> -> _value
    _value = _static_36670992
    econtext['attrs'] = _value

    # <em ... (18:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (18:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((u"'planet'", 18, 39, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_37108840 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_37108840
    _append_38578576(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38578576(_content_139955154988272)
    _msgid_38578576 = re_whitespace(''.join(_stream_38578576)).strip()
    append(translate(u'hello_goodbye', mapping={u'second': _stream_35215016_second, u'first': _stream_35215016_first, }, default=_msgid_38578576, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38459368 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38459368
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_38429976 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38429976
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_38432352 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38432352
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
Ejemplo n.º 3
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38960088 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x22f8dd0> name=None at 22f8610> -> _value
    _value = _static_36670928
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38430264 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24cac50> name=None at 24ca050> -> _value
    _value = _static_38579280
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_39079448 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca910> name=None at 24cad10> -> _value
    _value = _static_38578448
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_price = ''
    _stream_38577872 = _DebuggingOutputStream()
    _append_38577872 = _stream_38577872.append
    _content_139955154988272 = u'\n      Price:\n      '
    if (_content_139955154988272 is not None):
        _append_38577872(_content_139955154988272)
    _stream_35215016_price = _DebuggingOutputStream()
    _append_35215016_price = _stream_35215016_price.append
    _backup_attrs_39124432 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4a10> name=None at 24b4d50> -> _value
    _value = _static_38488592
    econtext['attrs'] = _value

    # <span ... (5:6)
    # --------------------------------------------------------
    _append_35215016_price(u'<span>')
    _stream_35215248_amount = ''
    _stream_38576464 = _DebuggingOutputStream()
    _append_38576464 = _stream_38576464.append
    _content_139955154988272 = u'\n        Per kilo '
    if (_content_139955154988272 is not None):
        _append_38576464(_content_139955154988272)
    _stream_35215248_amount = _DebuggingOutputStream()
    _append_35215248_amount = _stream_35215248_amount.append
    _backup_attrs_38958432 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24a5e90> name=None at 24a5bd0> -> _value
    _value = _static_38428304
    econtext['attrs'] = _value

    # <em ... (6:17)
    # --------------------------------------------------------
    _append_35215248_amount(u'<em>')

    # <Expression u'12.5' (6:42)> -> _content_139955154988272
    try:
        _content_139955154988272 = 12.5
    except:
        rcontext.setdefault('__error__', []).append((u'12.5', 6, 42, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215248_amount(_content_139955154988272)
    _append_35215248_amount(u'</em>')
    if (_backup_attrs_38958432 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38958432
    _append_38576464(u'${amount}')
    _stream_35215248_amount = ''.join(_stream_35215248_amount)
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38576464(_content_139955154988272)
    _msgid_38576464 = re_whitespace(''.join(_stream_38576464)).strip()
    _append_35215016_price(translate(_msgid_38576464, mapping={u'amount': _stream_35215248_amount, }, default=_msgid_38576464, domain=_i18n_domain))
    _append_35215016_price(u'</span>')
    if (_backup_attrs_39124432 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39124432
    _append_38577872(u'${price}')
    _stream_35215016_price = ''.join(_stream_35215016_price)
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        _append_38577872(_content_139955154988272)
    _msgid_38577872 = re_whitespace(''.join(_stream_38577872)).strip()
    append(translate(_msgid_38577872, mapping={u'price': _stream_35215016_price, }, default=_msgid_38577872, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_39079448 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39079448
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_38430264 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38430264
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_38960088 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38960088
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38450168 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca410> name=None at 24ca490> -> _value
    _value = _static_38577168
    econtext['attrs'] = _value

    # <div ... (1:0)
    # --------------------------------------------------------
    append(u'<div')
    _attr_xmlns = u'http://www.w3.org/1999/xhtml'
    if (_attr_xmlns is not None):
        append((u' xmlns="%s"' % _attr_xmlns))
    append(u'>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _stream_35214320_year = ''
    _stream_35214320_monthname = ''
    _stream_38579664 = _DebuggingOutputStream()
    _append_38579664 = _stream_38579664.append
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38579664(_content_139955154988272)
    _stream_35214320_monthname = _DebuggingOutputStream()
    _append_35214320_monthname = _stream_35214320_monthname.append
    _backup_default_38618392 = get('default', _marker)

    # <Marker name='default' at 24ae690> -> _value
    _value = _marker_default
    econtext['default'] = _value

    # <Expression u"'october'" (6:25)> -> _cache_38463888
    try:
        _cache_38463888 = 'october'
    except:
        rcontext.setdefault('__error__', []).append((u"'october'", 6, 25, '<string>', _sys.exc_info()[1], ))
        raise


    # <Identity expression=<Expression u"'october'" (6:25)> value=<Marker name='default' at 24ae150> at 24ae890> -> _condition
    _expression = _cache_38463888

    # <Marker name='default' at 24ae150> -> _value
    _value = _marker_default
    _condition = (_expression is _value)
    if _condition:
        _content_139955154988272 = u'monthname'
        if (_content_139955154988272 is not None):
            _append_35214320_monthname(_content_139955154988272)
    else:
        _content = _cache_38463888
        _content = translate(_content, default=None, domain=_i18n_domain)
        if (_content is not None):
            _append_35214320_monthname(_content)
    if (_backup_default_38618392 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_38618392
    _append_38579664(u'${monthname}')
    _stream_35214320_monthname = ''.join(_stream_35214320_monthname)
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38579664(_content_139955154988272)
    _stream_35214320_year = _DebuggingOutputStream()
    _append_35214320_year = _stream_35214320_year.append
    _backup_default_36748968 = get('default', _marker)

    # <Marker name='default' at 24a5dd0> -> _value
    _value = _marker_default
    econtext['default'] = _value

    # <Expression u'1982' (10:25)> -> _cache_38427600
    try:
        _cache_38427600 = 1982
    except:
        rcontext.setdefault('__error__', []).append((u'1982', 10, 25, '<string>', _sys.exc_info()[1], ))
        raise


    # <Identity expression=<Expression u'1982' (10:25)> value=<Marker name='default' at 24a5410> at 24a5f90> -> _condition
    _expression = _cache_38427600

    # <Marker name='default' at 24a5410> -> _value
    _value = _marker_default
    _condition = (_expression is _value)
    if _condition:
        _content_139955154988272 = u'year'
        if (_content_139955154988272 is not None):
            _append_35214320_year(_content_139955154988272)
    else:
        _content = _cache_38427600
        _content = translate(_content, default=None, domain=_i18n_domain)
        if (_content is not None):
            _append_35214320_year(_content)
    if (_backup_default_36748968 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_36748968
    _append_38579664(u'${year}')
    _stream_35214320_year = ''.join(_stream_35214320_year)
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        _append_38579664(_content_139955154988272)
    _msgid_38579664 = re_whitespace(''.join(_stream_38579664)).strip()
    append(translate(_msgid_38579664, mapping={u'monthname': _stream_35214320_monthname, u'year': _stream_35214320_year, }, default=_msgid_38579664, domain=_i18n_domain))
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_38450168 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38450168
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38450168 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca410> name=None at 24ca490> -> _value
    _value = _static_38577168
    econtext['attrs'] = _value

    # <div ... (1:0)
    # --------------------------------------------------------
    append(u'<div')
    _attr_xmlns = u'http://www.w3.org/1999/xhtml'
    if (_attr_xmlns is not None):
        append((u' xmlns="%s"' % _attr_xmlns))
    append(u'>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _stream_35214320_year = ''
    _stream_35214320_monthname = ''
    _stream_38579664 = _DebuggingOutputStream()
    _append_38579664 = _stream_38579664.append
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38579664(_content_139955154988272)
    _stream_35214320_monthname = _DebuggingOutputStream()
    _append_35214320_monthname = _stream_35214320_monthname.append
    _backup_default_38618392 = get('default', _marker)

    # <Marker name='default' at 24ae690> -> _value
    _value = _marker_default
    econtext['default'] = _value

    # <Expression u"'october'" (6:25)> -> _cache_38463888
    try:
        _cache_38463888 = 'october'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'october'",
            6,
            25,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    # <Identity expression=<Expression u"'october'" (6:25)> value=<Marker name='default' at 24ae150> at 24ae890> -> _condition
    _expression = _cache_38463888

    # <Marker name='default' at 24ae150> -> _value
    _value = _marker_default
    _condition = (_expression is _value)
    if _condition:
        _content_139955154988272 = u'monthname'
        if (_content_139955154988272 is not None):
            _append_35214320_monthname(_content_139955154988272)
    else:
        _content = _cache_38463888
        _content = translate(_content, default=None, domain=_i18n_domain)
        if (_content is not None):
            _append_35214320_monthname(_content)
    if (_backup_default_38618392 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_38618392
    _append_38579664(u'${monthname}')
    _stream_35214320_monthname = ''.join(_stream_35214320_monthname)
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38579664(_content_139955154988272)
    _stream_35214320_year = _DebuggingOutputStream()
    _append_35214320_year = _stream_35214320_year.append
    _backup_default_36748968 = get('default', _marker)

    # <Marker name='default' at 24a5dd0> -> _value
    _value = _marker_default
    econtext['default'] = _value

    # <Expression u'1982' (10:25)> -> _cache_38427600
    try:
        _cache_38427600 = 1982
    except:
        rcontext.setdefault('__error__', []).append((
            u'1982',
            10,
            25,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    # <Identity expression=<Expression u'1982' (10:25)> value=<Marker name='default' at 24a5410> at 24a5f90> -> _condition
    _expression = _cache_38427600

    # <Marker name='default' at 24a5410> -> _value
    _value = _marker_default
    _condition = (_expression is _value)
    if _condition:
        _content_139955154988272 = u'year'
        if (_content_139955154988272 is not None):
            _append_35214320_year(_content_139955154988272)
    else:
        _content = _cache_38427600
        _content = translate(_content, default=None, domain=_i18n_domain)
        if (_content is not None):
            _append_35214320_year(_content)
    if (_backup_default_36748968 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_36748968
    _append_38579664(u'${year}')
    _stream_35214320_year = ''.join(_stream_35214320_year)
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        _append_38579664(_content_139955154988272)
    _msgid_38579664 = re_whitespace(''.join(_stream_38579664)).strip()
    append(
        translate(_msgid_38579664,
                  mapping={
                      u'monthname': _stream_35214320_monthname,
                      u'year': _stream_35214320_year,
                  },
                  default=_msgid_38579664,
                  domain=_i18n_domain))
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_38450168 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38450168
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38960088 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x22f8dd0> name=None at 22f8610> -> _value
    _value = _static_36670928
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38430264 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24cac50> name=None at 24ca050> -> _value
    _value = _static_38579280
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_39079448 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca910> name=None at 24cad10> -> _value
    _value = _static_38578448
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_price = ''
    _stream_38577872 = _DebuggingOutputStream()
    _append_38577872 = _stream_38577872.append
    _content_139955154988272 = u'\n      Price:\n      '
    if (_content_139955154988272 is not None):
        _append_38577872(_content_139955154988272)
    _stream_35215016_price = _DebuggingOutputStream()
    _append_35215016_price = _stream_35215016_price.append
    _backup_attrs_39124432 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4a10> name=None at 24b4d50> -> _value
    _value = _static_38488592
    econtext['attrs'] = _value

    # <span ... (5:6)
    # --------------------------------------------------------
    _append_35215016_price(u'<span>')
    _stream_35215248_amount = ''
    _stream_38576464 = _DebuggingOutputStream()
    _append_38576464 = _stream_38576464.append
    _content_139955154988272 = u'\n        Per kilo '
    if (_content_139955154988272 is not None):
        _append_38576464(_content_139955154988272)
    _stream_35215248_amount = _DebuggingOutputStream()
    _append_35215248_amount = _stream_35215248_amount.append
    _backup_attrs_38958432 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24a5e90> name=None at 24a5bd0> -> _value
    _value = _static_38428304
    econtext['attrs'] = _value

    # <em ... (6:17)
    # --------------------------------------------------------
    _append_35215248_amount(u'<em>')

    # <Expression u'12.5' (6:42)> -> _content_139955154988272
    try:
        _content_139955154988272 = 12.5
    except:
        rcontext.setdefault('__error__', []).append((
            u'12.5',
            6,
            42,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215248_amount(_content_139955154988272)
    _append_35215248_amount(u'</em>')
    if (_backup_attrs_38958432 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38958432
    _append_38576464(u'${amount}')
    _stream_35215248_amount = ''.join(_stream_35215248_amount)
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38576464(_content_139955154988272)
    _msgid_38576464 = re_whitespace(''.join(_stream_38576464)).strip()
    _append_35215016_price(
        translate(_msgid_38576464,
                  mapping={
                      u'amount': _stream_35215248_amount,
                  },
                  default=_msgid_38576464,
                  domain=_i18n_domain))
    _append_35215016_price(u'</span>')
    if (_backup_attrs_39124432 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39124432
    _append_38577872(u'${price}')
    _stream_35215016_price = ''.join(_stream_35215016_price)
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        _append_38577872(_content_139955154988272)
    _msgid_38577872 = re_whitespace(''.join(_stream_38577872)).strip()
    append(
        translate(_msgid_38577872,
                  mapping={
                      u'price': _stream_35215016_price,
                  },
                  default=_msgid_38577872,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_39079448 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39079448
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_38430264 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38430264
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_38960088 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38960088
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem("decode")
    convert = getitem("convert")
    translate = getitem("translate")
    _backup_attrs_35899728 = get("attrs", _marker)

    # <Static value=<_ast.Dict object at 0x249f050> name=None at 249fdd0> -> _value
    _value = _static_38400080
    econtext["attrs"] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u"<html>")
    _content_139955154988272 = u"\n  "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    _previous_i18n_domain_37140368 = _i18n_domain
    _i18n_domain = u"old"
    _backup_attrs_35899296 = get("attrs", _marker)

    # <Static value=<_ast.Dict object at 0x249f6d0> name=None at 249f850> -> _value
    _value = _static_38401744
    econtext["attrs"] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u"<body>")
    _content_139955154988272 = u"\n    "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    _previous_i18n_domain_36787664 = _i18n_domain
    _i18n_domain = u"new"
    _backup_attrs_35899656 = get("attrs", _marker)

    # <Static value=<_ast.Dict object at 0x2315550> name=None at 2315d90> -> _value
    _value = _static_36787536
    econtext["attrs"] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u"<div>")
    _stream_36789456 = _DebuggingOutputStream()
    _append_36789456 = _stream_36789456.append
    _content_139955154988272 = u"\n      Hello world!\n    "
    if _content_139955154988272 is not None:
        _append_36789456(_content_139955154988272)
    _msgid_36789456 = re_whitespace("".join(_stream_36789456)).strip()
    append(translate(_msgid_36789456, mapping=None, default=_msgid_36789456, domain=_i18n_domain))
    append(u"</div>")
    if _backup_attrs_35899656 is _marker:
        del econtext["attrs"]
    else:
        econtext["attrs"] = _backup_attrs_35899656
    _i18n_domain = _previous_i18n_domain_36787664
    _content_139955154988272 = u"\n    "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    _backup_attrs_38614584 = get("attrs", _marker)

    # <Static value=<_ast.Dict object at 0x2315510> name=None at 23153d0> -> _value
    _value = _static_36787472
    econtext["attrs"] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u"<div>")
    _stream_36787280 = _DebuggingOutputStream()
    _append_36787280 = _stream_36787280.append
    _content_139955154988272 = u"\n      Hello world!\n    "
    if _content_139955154988272 is not None:
        _append_36787280(_content_139955154988272)
    _msgid_36787280 = re_whitespace("".join(_stream_36787280)).strip()
    append(translate(_msgid_36787280, mapping=None, default=_msgid_36787280, domain=_i18n_domain))
    append(u"</div>")
    if _backup_attrs_38614584 is _marker:
        del econtext["attrs"]
    else:
        econtext["attrs"] = _backup_attrs_38614584
    _content_139955154988272 = u"\n    "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    _previous_i18n_domain_37139408 = _i18n_domain
    _i18n_domain = u"new"
    _backup_attrs_36648648 = get("attrs", _marker)

    # <Static value=<_ast.Dict object at 0x236bc50> name=None at 24ae750> -> _value
    _value = _static_37141584
    econtext["attrs"] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u"<div")
    _backup_default_36650880 = get("default", _marker)
    _value = u"test"
    econtext["default"] = _value

    # <Translate msgid=None node=<_ast.Str object at 0x236bf50> at 236b210> -> _attr_class
    _attr_class = u"test"
    _attr_class = translate(_attr_class, default=_attr_class, domain=_i18n_domain)
    if _attr_class is None:
        pass
    else:
        if _attr_class is False:
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if (_tt is int) or (_tt is float) or (_tt is long):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if _tt is str:
                        _attr_class = decode(_attr_class)
                    else:
                        if _tt is not unicode:
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if (_attr_class is not None) and (re_needs_escape(_attr_class) is not None):
                        if "&" in _attr_class:
                            if ";" in _attr_class:
                                _attr_class = re_amp.sub("&amp;", _attr_class)
                            else:
                                _attr_class = _attr_class.replace("&", "&amp;")
                        if "<" in _attr_class:
                            _attr_class = _attr_class.replace("<", "&lt;")
                        if ">" in _attr_class:
                            _attr_class = _attr_class.replace(">", "&gt;")
                        if u'"' in _attr_class:
                            _attr_class = _attr_class.replace(u'"', "&#34;")
    if _attr_class is not None:
        append((u' class="%s"' % _attr_class))
    if _backup_default_36650880 is _marker:
        del econtext["default"]
    else:
        econtext["default"] = _backup_default_36650880
    append(u">")
    _content_139955154988272 = u"\n      Hello world!\n    "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    append(u"</div>")
    if _backup_attrs_36648648 is _marker:
        del econtext["attrs"]
    else:
        econtext["attrs"] = _backup_attrs_36648648
    _i18n_domain = _previous_i18n_domain_37139408
    _content_139955154988272 = u"\n    "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    _previous_i18n_domain_37139344 = _i18n_domain
    _i18n_domain = u"new"
    _backup_attrs_39044808 = get("attrs", _marker)

    # <Static value=<_ast.Dict object at 0x236bed0> name=None at 236b4d0> -> _value
    _value = _static_37142224
    econtext["attrs"] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u"<div")
    _backup_default_39044664 = get("default", _marker)
    _value = u"test"
    econtext["default"] = _value

    # <Translate msgid=u'test_msgid' node=<_ast.Str object at 0x236b650> at 236b7d0> -> _attr_class
    _attr_class = u"test"
    _attr_class = translate(u"test_msgid", default=_attr_class, domain=_i18n_domain)
    if _attr_class is None:
        pass
    else:
        if _attr_class is False:
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if (_tt is int) or (_tt is float) or (_tt is long):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if _tt is str:
                        _attr_class = decode(_attr_class)
                    else:
                        if _tt is not unicode:
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if (_attr_class is not None) and (re_needs_escape(_attr_class) is not None):
                        if "&" in _attr_class:
                            if ";" in _attr_class:
                                _attr_class = re_amp.sub("&amp;", _attr_class)
                            else:
                                _attr_class = _attr_class.replace("&", "&amp;")
                        if "<" in _attr_class:
                            _attr_class = _attr_class.replace("<", "&lt;")
                        if ">" in _attr_class:
                            _attr_class = _attr_class.replace(">", "&gt;")
                        if u'"' in _attr_class:
                            _attr_class = _attr_class.replace(u'"', "&#34;")
    if _attr_class is not None:
        append((u' class="%s"' % _attr_class))
    if _backup_default_39044664 is _marker:
        del econtext["default"]
    else:
        econtext["default"] = _backup_default_39044664
    append(u">")
    _content_139955154988272 = u"\n      Hello world!\n    "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    append(u"</div>")
    if _backup_attrs_39044808 is _marker:
        del econtext["attrs"]
    else:
        econtext["attrs"] = _backup_attrs_39044808
    _i18n_domain = _previous_i18n_domain_37139344
    _content_139955154988272 = u"\n  "
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    append(u"</body>")
    if _backup_attrs_35899296 is _marker:
        del econtext["attrs"]
    else:
        econtext["attrs"] = _backup_attrs_35899296
    _i18n_domain = _previous_i18n_domain_37140368
    _content_139955154988272 = u"\n"
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
    append(u"</html>")
    if _backup_attrs_35899728 is _marker:
        del econtext["attrs"]
    else:
        econtext["attrs"] = _backup_attrs_35899728
    _content_139955154988272 = u"\n"
    if _content_139955154988272 is not None:
        append(_content_139955154988272)
Ejemplo n.º 8
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_35899728 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x249f050> name=None at 249fdd0> -> _value
    _value = _static_38400080
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_37140368 = _i18n_domain
    _i18n_domain = u'old'
    _backup_attrs_35899296 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x249f6d0> name=None at 249f850> -> _value
    _value = _static_38401744
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36787664 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_35899656 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2315550> name=None at 2315d90> -> _value
    _value = _static_36787536
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_36789456 = _DebuggingOutputStream()
    _append_36789456 = _stream_36789456.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_36789456(_content_139955154988272)
    _msgid_36789456 = re_whitespace(''.join(_stream_36789456)).strip()
    append(
        translate(_msgid_36789456,
                  mapping=None,
                  default=_msgid_36789456,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_35899656 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_35899656
    _i18n_domain = _previous_i18n_domain_36787664
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38614584 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2315510> name=None at 23153d0> -> _value
    _value = _static_36787472
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_36787280 = _DebuggingOutputStream()
    _append_36787280 = _stream_36787280.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_36787280(_content_139955154988272)
    _msgid_36787280 = re_whitespace(''.join(_stream_36787280)).strip()
    append(
        translate(_msgid_36787280,
                  mapping=None,
                  default=_msgid_36787280,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38614584 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38614584
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_37139408 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_36648648 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236bc50> name=None at 24ae750> -> _value
    _value = _static_37141584
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div')
    _backup_default_36650880 = get('default', _marker)
    _value = u'test'
    econtext['default'] = _value

    # <Translate msgid=None node=<_ast.Str object at 0x236bf50> at 236b210> -> _attr_class
    _attr_class = u'test'
    _attr_class = translate(_attr_class,
                            default=_attr_class,
                            domain=_i18n_domain)
    if (_attr_class is None):
        pass
    else:
        if (_attr_class is False):
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if (_tt is str):
                        _attr_class = decode(_attr_class)
                    else:
                        if (_tt is not unicode):
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if ((_attr_class is not None)
                            and (re_needs_escape(_attr_class) is not None)):
                        if ('&' in _attr_class):
                            if (';' in _attr_class):
                                _attr_class = re_amp.sub('&amp;', _attr_class)
                            else:
                                _attr_class = _attr_class.replace('&', '&amp;')
                        if ('<' in _attr_class):
                            _attr_class = _attr_class.replace('<', '&lt;')
                        if ('>' in _attr_class):
                            _attr_class = _attr_class.replace('>', '&gt;')
                        if (u'"' in _attr_class):
                            _attr_class = _attr_class.replace(u'"', '&#34;')
    if (_attr_class is not None):
        append((u' class="%s"' % _attr_class))
    if (_backup_default_36650880 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_36650880
    append(u'>')
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_36648648 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_36648648
    _i18n_domain = _previous_i18n_domain_37139408
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_37139344 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_39044808 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236bed0> name=None at 236b4d0> -> _value
    _value = _static_37142224
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div')
    _backup_default_39044664 = get('default', _marker)
    _value = u'test'
    econtext['default'] = _value

    # <Translate msgid=u'test_msgid' node=<_ast.Str object at 0x236b650> at 236b7d0> -> _attr_class
    _attr_class = u'test'
    _attr_class = translate(u'test_msgid',
                            default=_attr_class,
                            domain=_i18n_domain)
    if (_attr_class is None):
        pass
    else:
        if (_attr_class is False):
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if (_tt is str):
                        _attr_class = decode(_attr_class)
                    else:
                        if (_tt is not unicode):
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if ((_attr_class is not None)
                            and (re_needs_escape(_attr_class) is not None)):
                        if ('&' in _attr_class):
                            if (';' in _attr_class):
                                _attr_class = re_amp.sub('&amp;', _attr_class)
                            else:
                                _attr_class = _attr_class.replace('&', '&amp;')
                        if ('<' in _attr_class):
                            _attr_class = _attr_class.replace('<', '&lt;')
                        if ('>' in _attr_class):
                            _attr_class = _attr_class.replace('>', '&gt;')
                        if (u'"' in _attr_class):
                            _attr_class = _attr_class.replace(u'"', '&#34;')
    if (_attr_class is not None):
        append((u' class="%s"' % _attr_class))
    if (_backup_default_39044664 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_39044664
    append(u'>')
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_39044808 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39044808
    _i18n_domain = _previous_i18n_domain_37139344
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_35899296 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_35899296
    _i18n_domain = _previous_i18n_domain_37140368
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_35899728 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_35899728
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_39931128 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236bf50> name=None at 236be90> -> _value
    _value = _static_37142352
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36787856 = _i18n_domain
    _i18n_domain = u'old'
    _backup_attrs_39848848 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236b8d0> name=None at 236b150> -> _value
    _value = _static_37140688
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_37142224 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_40301704 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x236b650> name=None at 236b050> -> _value
    _value = _static_37140048
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_37142416 = _DebuggingOutputStream()
    _append_37142416 = _stream_37142416.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_37142416(_content_139955154988272)
    _msgid_37142416 = re_whitespace(''.join(_stream_37142416)).strip()
    append(
        translate(_msgid_37142416,
                  mapping=None,
                  default=_msgid_37142416,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_40301704 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_40301704
    _i18n_domain = _previous_i18n_domain_37142224
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_39862784 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x249f290> name=None at 249f3d0> -> _value
    _value = _static_38400656
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38576208 = _DebuggingOutputStream()
    _append_38576208 = _stream_38576208.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_38576208(_content_139955154988272)
    _msgid_38576208 = re_whitespace(''.join(_stream_38576208)).strip()
    append(
        translate(_msgid_38576208,
                  mapping=None,
                  default=_msgid_38576208,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_39862784 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39862784
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36789456 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_38619904 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x249f8d0> name=None at 249fe10> -> _value
    _value = _static_38402256
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div')
    _backup_default_38620624 = get('default', _marker)
    _value = u'test'
    econtext['default'] = _value

    # <Translate msgid=None node=<_ast.Str object at 0x249fc10> at 249f190> -> _attr_class
    _attr_class = u'test'
    _attr_class = translate(_attr_class,
                            default=_attr_class,
                            domain=_i18n_domain)
    if (_attr_class is None):
        pass
    else:
        if (_attr_class is False):
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if (_tt is str):
                        _attr_class = decode(_attr_class)
                    else:
                        if (_tt is not unicode):
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if ((_attr_class is not None)
                            and (re_needs_escape(_attr_class) is not None)):
                        if ('&' in _attr_class):
                            if (';' in _attr_class):
                                _attr_class = re_amp.sub('&amp;', _attr_class)
                            else:
                                _attr_class = _attr_class.replace('&', '&amp;')
                        if ('<' in _attr_class):
                            _attr_class = _attr_class.replace('<', '&lt;')
                        if ('>' in _attr_class):
                            _attr_class = _attr_class.replace('>', '&gt;')
                        if (u'"' in _attr_class):
                            _attr_class = _attr_class.replace(u'"', '&#34;')
    if (_attr_class is not None):
        append((u' class="%s"' % _attr_class))
    if (_backup_default_38620624 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_38620624
    append(u'>')
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_38619904 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38619904
    _i18n_domain = _previous_i18n_domain_36789456
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _previous_i18n_domain_36786320 = _i18n_domain
    _i18n_domain = u'new'
    _backup_attrs_38620120 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2315590> name=None at 23151d0> -> _value
    _value = _static_36787600
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div')
    _backup_default_38618464 = get('default', _marker)
    _value = u'test'
    econtext['default'] = _value

    # <Translate msgid=u'test_msgid' node=<_ast.Str object at 0x2315050> at 2315f10> -> _attr_class
    _attr_class = u'test'
    _attr_class = translate(u'test_msgid',
                            default=_attr_class,
                            domain=_i18n_domain)
    if (_attr_class is None):
        pass
    else:
        if (_attr_class is False):
            _attr_class = None
        else:
            _tt = type(_attr_class)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _attr_class = unicode(_attr_class)
            else:
                try:
                    if (_tt is str):
                        _attr_class = decode(_attr_class)
                    else:
                        if (_tt is not unicode):
                            try:
                                _attr_class = _attr_class.__html__
                            except:
                                _attr_class = convert(_attr_class)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _attr_class = _attr_class()
                else:
                    if ((_attr_class is not None)
                            and (re_needs_escape(_attr_class) is not None)):
                        if ('&' in _attr_class):
                            if (';' in _attr_class):
                                _attr_class = re_amp.sub('&amp;', _attr_class)
                            else:
                                _attr_class = _attr_class.replace('&', '&amp;')
                        if ('<' in _attr_class):
                            _attr_class = _attr_class.replace('<', '&lt;')
                        if ('>' in _attr_class):
                            _attr_class = _attr_class.replace('>', '&gt;')
                        if (u'"' in _attr_class):
                            _attr_class = _attr_class.replace(u'"', '&#34;')
    if (_attr_class is not None):
        append((u' class="%s"' % _attr_class))
    if (_backup_default_38618464 is _marker):
        del econtext['default']
    else:
        econtext['default'] = _backup_default_38618464
    append(u'>')
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</div>')
    if (_backup_attrs_38620120 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38620120
    _i18n_domain = _previous_i18n_domain_36786320
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_39848848 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39848848
    _i18n_domain = _previous_i18n_domain_36787856
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_39931128 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39931128
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
Ejemplo n.º 10
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38523248 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x22f8410> name=None at 2372990> -> _value
    _value = _static_36668432
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38625792 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2238a50> name=None at 2238690> -> _value
    _value = _static_35883600
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38624936 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x222bd50> name=None at 222be10> -> _value
    _value = _static_35831120
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35884752 = _DebuggingOutputStream()
    _append_35884752 = _stream_35884752.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_35884752(_content_139955154988272)
    _msgid_35884752 = re_whitespace(''.join(_stream_35884752)).strip()
    append(translate(_msgid_35884752, mapping=None, default=_msgid_35884752, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38624936 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38624936
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38619904 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x21b1bd0> name=None at 23171d0> -> _value
    _value = _static_35331024
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_36796624 = _DebuggingOutputStream()
    _append_36796624 = _stream_36796624.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_36796624(_content_139955154988272)
    _msgid_36796624 = re_whitespace(''.join(_stream_36796624)).strip()
    append(translate(u'hello_world', mapping=None, default=_msgid_36796624, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38619904 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38619904
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38620264 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4f50> name=None at 24b4d10> -> _value
    _value = _static_38489936
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38487504 = _DebuggingOutputStream()
    _append_38487504 = _stream_38487504.append
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38487504(_content_139955154988272)
    _backup_attrs_38617888 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b48d0> name=None at 24b4e10> -> _value
    _value = _static_38488272
    econtext['attrs'] = _value

    # <sup ... (10:6)
    # --------------------------------------------------------
    _append_38487504(u'<sup>')
    _content_139955154988272 = u'Hello world!'
    if (_content_139955154988272 is not None):
        _append_38487504(_content_139955154988272)
    _append_38487504(u'</sup>')
    if (_backup_attrs_38617888 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38617888
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        _append_38487504(_content_139955154988272)
    _msgid_38487504 = re_whitespace(''.join(_stream_38487504)).strip()
    append(translate(_msgid_38487504, mapping=None, default=_msgid_38487504, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38620264 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38620264
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38616672 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b47d0> name=None at 24b4890> -> _value
    _value = _static_38488016
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38487888 = _DebuggingOutputStream()
    _append_38487888 = _stream_38487888.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_39096120 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4650> name=None at 24b42d0> -> _value
    _value = _static_38487632
    econtext['attrs'] = _value

    # <em ... (13:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (13:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((u"'world'", 13, 36, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_39096120 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39096120
    _append_38487888(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_39090152 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4490> name=None at 24b4150> -> _value
    _value = _static_38487184
    econtext['attrs'] = _value

    # <em ... (14:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (14:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((u"'planet'", 14, 39, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_39090152 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39090152
    _append_38487888(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _msgid_38487888 = re_whitespace(''.join(_stream_38487888)).strip()
    append(translate(_msgid_38487888, mapping={u'second': _stream_35215016_second, u'first': _stream_35215016_first, }, default=_msgid_38487888, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38616672 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38616672
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_39091376 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24caf10> name=None at 24ca850> -> _value
    _value = _static_38579984
    econtext['attrs'] = _value

    # <div ... (16:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38486672 = _DebuggingOutputStream()
    _append_38486672 = _stream_38486672.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38486672(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_39080520 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca2d0> name=None at 24cafd0> -> _value
    _value = _static_38576848
    econtext['attrs'] = _value

    # <em ... (17:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (17:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((u"'world'", 17, 36, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_39080520 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39080520
    _append_38486672(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38486672(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_39080592 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24cad50> name=None at 24ca110> -> _value
    _value = _static_38579536
    econtext['attrs'] = _value

    # <em ... (18:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (18:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((u"'planet'", 18, 39, '<string>', _sys.exc_info()[1], ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(_content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(_content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None) and (re_needs_escape(_content_139955154988272) is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub('&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace('&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace('\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_39080592 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39080592
    _append_38486672(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38486672(_content_139955154988272)
    _msgid_38486672 = re_whitespace(''.join(_stream_38486672)).strip()
    append(translate(u'hello_goodbye', mapping={u'second': _stream_35215016_second, u'first': _stream_35215016_first, }, default=_msgid_38486672, domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_39091376 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39091376
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_38625792 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38625792
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_38523248 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38523248
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
Ejemplo n.º 11
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38523248 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x22f8410> name=None at 2372990> -> _value
    _value = _static_36668432
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38625792 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2238a50> name=None at 2238690> -> _value
    _value = _static_35883600
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38624936 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x222bd50> name=None at 222be10> -> _value
    _value = _static_35831120
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35884752 = _DebuggingOutputStream()
    _append_35884752 = _stream_35884752.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_35884752(_content_139955154988272)
    _msgid_35884752 = re_whitespace(''.join(_stream_35884752)).strip()
    append(
        translate(_msgid_35884752,
                  mapping=None,
                  default=_msgid_35884752,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38624936 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38624936
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38619904 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x21b1bd0> name=None at 23171d0> -> _value
    _value = _static_35331024
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_36796624 = _DebuggingOutputStream()
    _append_36796624 = _stream_36796624.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_36796624(_content_139955154988272)
    _msgid_36796624 = re_whitespace(''.join(_stream_36796624)).strip()
    append(
        translate(u'hello_world',
                  mapping=None,
                  default=_msgid_36796624,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38619904 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38619904
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38620264 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4f50> name=None at 24b4d10> -> _value
    _value = _static_38489936
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38487504 = _DebuggingOutputStream()
    _append_38487504 = _stream_38487504.append
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38487504(_content_139955154988272)
    _backup_attrs_38617888 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b48d0> name=None at 24b4e10> -> _value
    _value = _static_38488272
    econtext['attrs'] = _value

    # <sup ... (10:6)
    # --------------------------------------------------------
    _append_38487504(u'<sup>')
    _content_139955154988272 = u'Hello world!'
    if (_content_139955154988272 is not None):
        _append_38487504(_content_139955154988272)
    _append_38487504(u'</sup>')
    if (_backup_attrs_38617888 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38617888
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        _append_38487504(_content_139955154988272)
    _msgid_38487504 = re_whitespace(''.join(_stream_38487504)).strip()
    append(
        translate(_msgid_38487504,
                  mapping=None,
                  default=_msgid_38487504,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38620264 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38620264
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38616672 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b47d0> name=None at 24b4890> -> _value
    _value = _static_38488016
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38487888 = _DebuggingOutputStream()
    _append_38487888 = _stream_38487888.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_39096120 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4650> name=None at 24b42d0> -> _value
    _value = _static_38487632
    econtext['attrs'] = _value

    # <em ... (13:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (13:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'world'",
            13,
            36,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_39096120 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39096120
    _append_38487888(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_39090152 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4490> name=None at 24b4150> -> _value
    _value = _static_38487184
    econtext['attrs'] = _value

    # <em ... (14:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (14:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'planet'",
            14,
            39,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_39090152 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39090152
    _append_38487888(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _msgid_38487888 = re_whitespace(''.join(_stream_38487888)).strip()
    append(
        translate(_msgid_38487888,
                  mapping={
                      u'second': _stream_35215016_second,
                      u'first': _stream_35215016_first,
                  },
                  default=_msgid_38487888,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38616672 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38616672
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_39091376 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24caf10> name=None at 24ca850> -> _value
    _value = _static_38579984
    econtext['attrs'] = _value

    # <div ... (16:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38486672 = _DebuggingOutputStream()
    _append_38486672 = _stream_38486672.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38486672(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_39080520 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca2d0> name=None at 24cafd0> -> _value
    _value = _static_38576848
    econtext['attrs'] = _value

    # <em ... (17:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (17:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'world'",
            17,
            36,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_39080520 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39080520
    _append_38486672(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38486672(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_39080592 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24cad50> name=None at 24ca110> -> _value
    _value = _static_38579536
    econtext['attrs'] = _value

    # <em ... (18:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (18:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'planet'",
            18,
            39,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_39080592 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39080592
    _append_38486672(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38486672(_content_139955154988272)
    _msgid_38486672 = re_whitespace(''.join(_stream_38486672)).strip()
    append(
        translate(u'hello_goodbye',
                  mapping={
                      u'second': _stream_35215016_second,
                      u'first': _stream_35215016_first,
                  },
                  default=_msgid_38486672,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_39091376 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_39091376
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_38625792 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38625792
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_38523248 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38523248
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
Ejemplo n.º 12
0
def render(stream, econtext, rcontext):
    append = stream.append
    getitem = econtext.__getitem__
    get = econtext.get
    _i18n_domain = None
    re_amp = g_re_amp
    re_needs_escape = g_re_needs_escape
    decode = getitem('decode')
    convert = getitem('convert')
    translate = getitem('translate')
    _backup_attrs_38432352 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x222b450> name=None at 222bfd0> -> _value
    _value = _static_35828816
    econtext['attrs'] = _value

    # <html ... (1:0)
    # --------------------------------------------------------
    append(u'<html>')
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38429976 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4310> name=None at 24b4a50> -> _value
    _value = _static_38486800
    econtext['attrs'] = _value

    # <body ... (2:2)
    # --------------------------------------------------------
    append(u'<body>')
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38429832 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b44d0> name=None at 24b45d0> -> _value
    _value = _static_38487248
    econtext['attrs'] = _value

    # <div ... (3:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38489104 = _DebuggingOutputStream()
    _append_38489104 = _stream_38489104.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_38489104(_content_139955154988272)
    _msgid_38489104 = re_whitespace(''.join(_stream_38489104)).strip()
    append(
        translate(_msgid_38489104,
                  mapping=None,
                  default=_msgid_38489104,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38429832 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38429832
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38412088 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4210> name=None at 24b4510> -> _value
    _value = _static_38486544
    econtext['attrs'] = _value

    # <div ... (6:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38487760 = _DebuggingOutputStream()
    _append_38487760 = _stream_38487760.append
    _content_139955154988272 = u'\n      Hello world!\n    '
    if (_content_139955154988272 is not None):
        _append_38487760(_content_139955154988272)
    _msgid_38487760 = re_whitespace(''.join(_stream_38487760)).strip()
    append(
        translate(u'hello_world',
                  mapping=None,
                  default=_msgid_38487760,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38412088 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38412088
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38411152 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4e50> name=None at 24b4950> -> _value
    _value = _static_38489680
    econtext['attrs'] = _value

    # <div ... (9:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_38487888 = _DebuggingOutputStream()
    _append_38487888 = _stream_38487888.append
    _content_139955154988272 = u'\n      '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _backup_attrs_38409280 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b4a90> name=None at 24b4f10> -> _value
    _value = _static_38488720
    econtext['attrs'] = _value

    # <sup ... (10:6)
    # --------------------------------------------------------
    _append_38487888(u'<sup>')
    _content_139955154988272 = u'Hello world!'
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _append_38487888(u'</sup>')
    if (_backup_attrs_38409280 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38409280
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        _append_38487888(_content_139955154988272)
    _msgid_38487888 = re_whitespace(''.join(_stream_38487888)).strip()
    append(
        translate(_msgid_38487888,
                  mapping=None,
                  default=_msgid_38487888,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38411152 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38411152
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38408848 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24b41d0> name=None at 24b4350> -> _value
    _value = _static_38486480
    econtext['attrs'] = _value

    # <div ... (12:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38489040 = _DebuggingOutputStream()
    _append_38489040 = _stream_38489040.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38489040(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_38460520 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24cac50> name=None at 24ca050> -> _value
    _value = _static_38579280
    econtext['attrs'] = _value

    # <em ... (13:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (13:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'world'",
            13,
            36,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_38460520 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38460520
    _append_38489040(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38489040(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_38461384 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24ca910> name=None at 24cae10> -> _value
    _value = _static_38578448
    econtext['attrs'] = _value

    # <em ... (14:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (14:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'planet'",
            14,
            39,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_38461384 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38461384
    _append_38489040(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38489040(_content_139955154988272)
    _msgid_38489040 = re_whitespace(''.join(_stream_38489040)).strip()
    append(
        translate(_msgid_38489040,
                  mapping={
                      u'second': _stream_35215016_second,
                      u'first': _stream_35215016_first,
                  },
                  default=_msgid_38489040,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38408848 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38408848
    _content_139955154988272 = u'\n    '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    _backup_attrs_38459368 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x24caa90> name=None at 24ca6d0> -> _value
    _value = _static_38578832
    econtext['attrs'] = _value

    # <div ... (16:4)
    # --------------------------------------------------------
    append(u'<div>')
    _stream_35215016_first = ''
    _stream_35215016_second = ''
    _stream_38578576 = _DebuggingOutputStream()
    _append_38578576 = _stream_38578576.append
    _content_139955154988272 = u'\n      Hello '
    if (_content_139955154988272 is not None):
        _append_38578576(_content_139955154988272)
    _stream_35215016_first = _DebuggingOutputStream()
    _append_35215016_first = _stream_35215016_first.append
    _backup_attrs_37105888 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x2238cd0> name=None at 2238f90> -> _value
    _value = _static_35884240
    econtext['attrs'] = _value

    # <em ... (17:12)
    # --------------------------------------------------------
    _append_35215016_first(u'<em>')

    # <Expression u"'world'" (17:36)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'world'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'world'",
            17,
            36,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_first(_content_139955154988272)
    _append_35215016_first(u'</em>')
    if (_backup_attrs_37105888 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_37105888
    _append_38578576(u'${first}')
    _stream_35215016_first = ''.join(_stream_35215016_first)
    _content_139955154988272 = u'!\n      Goodbye '
    if (_content_139955154988272 is not None):
        _append_38578576(_content_139955154988272)
    _stream_35215016_second = _DebuggingOutputStream()
    _append_35215016_second = _stream_35215016_second.append
    _backup_attrs_37108840 = get('attrs', _marker)

    # <Static value=<_ast.Dict object at 0x22f8e10> name=None at 22f8510> -> _value
    _value = _static_36670992
    econtext['attrs'] = _value

    # <em ... (18:14)
    # --------------------------------------------------------
    _append_35215016_second(u'<em>')

    # <Expression u"'planet'" (18:39)> -> _content_139955154988272
    try:
        _content_139955154988272 = 'planet'
    except:
        rcontext.setdefault('__error__', []).append((
            u"'planet'",
            18,
            39,
            '<string>',
            _sys.exc_info()[1],
        ))
        raise

    if (_content_139955154988272 is None):
        pass
    else:
        if (_content_139955154988272 is False):
            _content_139955154988272 = None
        else:
            _tt = type(_content_139955154988272)
            if ((_tt is int) or (_tt is float) or (_tt is long)):
                _content_139955154988272 = unicode(_content_139955154988272)
            else:
                try:
                    if (_tt is str):
                        _content_139955154988272 = decode(
                            _content_139955154988272)
                    else:
                        if (_tt is not unicode):
                            try:
                                _content_139955154988272 = _content_139955154988272.__html__
                            except:
                                _content_139955154988272 = convert(
                                    _content_139955154988272)
                            else:
                                raise RuntimeError
                except RuntimeError:
                    _content_139955154988272 = _content_139955154988272()
                else:
                    if ((_content_139955154988272 is not None)
                            and (re_needs_escape(_content_139955154988272)
                                 is not None)):
                        if ('&' in _content_139955154988272):
                            if (';' in _content_139955154988272):
                                _content_139955154988272 = re_amp.sub(
                                    '&amp;', _content_139955154988272)
                            else:
                                _content_139955154988272 = _content_139955154988272.replace(
                                    '&', '&amp;')
                        if ('<' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '<', '&lt;')
                        if ('>' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '>', '&gt;')
                        if ('\x00' in _content_139955154988272):
                            _content_139955154988272 = _content_139955154988272.replace(
                                '\x00', '&#34;')
    _content_139955154988272 = _content_139955154988272
    if (_content_139955154988272 is not None):
        _append_35215016_second(_content_139955154988272)
    _append_35215016_second(u'</em>')
    if (_backup_attrs_37108840 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_37108840
    _append_38578576(u'${second}')
    _stream_35215016_second = ''.join(_stream_35215016_second)
    _content_139955154988272 = u'!\n    '
    if (_content_139955154988272 is not None):
        _append_38578576(_content_139955154988272)
    _msgid_38578576 = re_whitespace(''.join(_stream_38578576)).strip()
    append(
        translate(u'hello_goodbye',
                  mapping={
                      u'second': _stream_35215016_second,
                      u'first': _stream_35215016_first,
                  },
                  default=_msgid_38578576,
                  domain=_i18n_domain))
    append(u'</div>')
    if (_backup_attrs_38459368 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38459368
    _content_139955154988272 = u'\n  '
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</body>')
    if (_backup_attrs_38429976 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38429976
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)
    append(u'</html>')
    if (_backup_attrs_38432352 is _marker):
        del econtext['attrs']
    else:
        econtext['attrs'] = _backup_attrs_38432352
    _content_139955154988272 = u'\n'
    if (_content_139955154988272 is not None):
        append(_content_139955154988272)