view MoinMoin/script/old/xmlrpc-tools/getsystempages.py @ 3115:cd6cfc715261

replace wikiwikiweb.de by moinmo.in, replace contact Juergen Hermann by Thomas Waldmann, cleanup wikiconfig (ported from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Feb 2008 23:53:55 +0100
parents ef41e35985dc
children
line wrap: on
line source

#!/usr/bin/env python
"""
This script gets all SystemPages from srcwiki via xmlrpc and
stores them into dstwiki via xmlrpc. We use wiki rpc v1 here.

*** DO NOT USE, SEE getsystempages2.py ***

GPL software, 2003-08-10 Thomas Waldmann
"""

from xmlrpclib import *

srcwiki = ServerProxy("http://master.moinmo.in/?action=xmlrpc")
#srcwiki = ServerProxy("http://master.moinmo.in/?action=xmlrpc")
dstwiki = ServerProxy("http://devel.linuxwiki.org/moin--cvs?action=xmlrpc")

def transferpage(srcwiki, dstwiki, pagename):
    pagedata = srcwiki.getPage(pagename).data
    dstwiki.putPage(pagename, Binary(pagedata))
    print "Transferred %s." % pagename

def run():
    allsystempagesgroup = 'AllSystemPagesGroup'
    transferpage(srcwiki, dstwiki, allsystempagesgroup)
    allgrouppages = srcwiki.listLinks(allsystempagesgroup)
    for langgrouppage in allgrouppages:
        pagename = langgrouppage['name']
        transferpage(srcwiki, dstwiki, pagename)
        pages = srcwiki.listLinks(pagename)
        for page in pages:
            transferpage(srcwiki, dstwiki, page['name'])

if __name__ == "__main__":
    run()