Exemplo n.º 1
0
 def setUp(self):
     """Parse the mediawiki XML file"""
     self.handler = mediawikixmlparser.parseMediaWikiXMLExport("xml/export3.xml")
     self.info = wikiinfo.WikiInfo()
     self.info.set(self.handler.pages, self.handler.pageRedirects, self.handler.templates,
                   self.handler.templateRedirects, self.handler.talkpages)
     self.info.doStuff()
Exemplo n.º 2
0
    def setUp(self):
        """Parse the mediawiki XML file"""
        self.handler = mediawikixmlparser.parseMediaWikiXMLExport("xml/export3.xml")
        self.pages = { \
            'A': {'id': 290}, \
            'B': {'id': 3783}, \
            'Genetics': {'id': 12266}, \
            'Biochemistry': {'id': 3954}, \
            'EBay': {'id': 130495}, \
            'Cell nucleus': {'id': 6235}, \
            'Deoxyribonuclease I': {'id': 5507057}, \
            'DNA': {'id': 7955}}
            #'Messenger RNA':{'id':20232}, \
            #'Mitochondrion':{'id':19588}, \
            #'Ribosome':{'id':25766}, \
            #'RNA':{'id':25758}, \
            #'RNA splicing':{'id':28524}, \
            #'\xc3\x86':{'id':184309}, \
            #'\xc3\x9f':{'id':198274}, \

        self.pageRedirects = {'Dna': {'id': 0x1f14L, 'redirect': u'DNA'}, \
            'Messenger rna': {'id': 0xacee79L, 'redirect': u'Messenger RNA'}, \
            'Mitochondria': {'id': 0x4999L, 'redirect': u'Mitochondrion'}, \
            'Ribosomes': {'id': 0xf3c59L, 'redirect': u'Ribosome'}, \
            'Rna': {'id': 0x4f2f89L, 'redirect': u'RNA'}, \
            'Rna splicing': {'id': 0x4e3056L, 'redirect': u'RNA splicing'}} \
Exemplo n.º 3
0
 def setUp(self):
     """Parse the MediaWiki XML file, write it out in cdb format and initialize the cdb reader"""
     self.handler = mediawikixmlparser.parseMediaWikiXMLExport("xml/export3.xml")
     self.info = wikiinfo.WikiInfo()
     self.info.set(self.handler.pages, self.handler.pageRedirects, self.handler.templates,
                   self.handler.templateRedirects, self.handler.talkpages)
     self.info.doStuff()
     self.writer = mediawikicdbwriter.MediaWikiCdbWriter()
     self.writer.writeCdbFiles(self.info, "cdb/")