view data/plugin/macro/EmbedContent.py @ 653:127da830be6c

updated copyright
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 19 Apr 2016 16:29:54 +0200
parents 78ca2464edf9
children
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - macro to embed content of an other (wiki) page

    <<EmbedContent(url="http://localhost:8080/Example?action=content")>>

    @copyright: 2010-2016 by MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.
"""
import urllib2

def macro_EmbedContent(macro, url=u""):
    fmt = macro.formatter
    if url:
        uo = urllib2.urlopen(url)
        html = uo.read()
        uo.close()
        return fmt.rawHTML(html)