Exemplo n.º 1
0
    def convert_menu(self, s, loc, toks):
        yield toks.block_id[0]
        yield " "
        yield toks.block_type

        # A menu can't have CAPTION, so don't try to translate it.
        yield " "
        yield from toks.post_caption  # The rest of the options
        yield NL

        yield BLOCK_START
        yield NL

        pre_name = generate_menu_pre_name(toks.block_type, toks.block_id[0])

        for p in toks.popups:
            yield from self.convert_popup(p, pre_name)

        yield BLOCK_END
Exemplo n.º 2
0
    def convert_menu(self, s, loc, toks):
        out = []

        out.append(toks.block_id)
        out.append(" ")
        out.append(toks.block_type)

        # A menu can't have CAPTION, so don't try to translate it.
        out.append(" ")
        out.extend(toks.post_caption)  # The rest of the options
        out.append(NL)

        out.append(BLOCK_START)
        out.append(NL)

        pre_name = generate_menu_pre_name(toks.block_type, toks.block_id[0])

        for p in toks.popups:
            out.extend(self.convert_popup(p, pre_name))

        out.append(BLOCK_END)

        return out