Logo Search packages:      
Sourcecode: uicilibris version File versions  Download package

def uicilibris::wikiParser::wikiParser::wikiTemplates (   self,
  contents 
)
calls the special page ExpandTemplates in the wiki
to apply templates which must be processed by mediawiki
@param contents the code with templates (unicode string)
@result the code with all templates expanded

Definition at line 365 of file wikiParser.py.

                                     :
        """
        calls the special page ExpandTemplates in the wiki
        to apply templates which must be processed by mediawiki
        @param contents the code with templates (unicode string)
        @result the code with all templates expanded
        """
        completeUrl="http://%s/index.php/%s" %(self.baseAddress, "Sp%C3%A9cial:ExpandTemplates")
        data={"contexttitle":"",
              "input":"%s" %contents.encode("utf-8"),
              "removecomments":"1",
              "generate_xml":"0"}
        data=url.urlencode(data)
        page=url.urlopen(completeUrl, data)
        soup = BeautifulSoup(page.read())
        area = soup.find('textarea', id="output")
        if area:
            processedContents=area.contents[0]
        else:
            processedContents=""
        return processedContents


Generated by  Doxygen 1.6.0   Back to index