view MoinMoin/scripts/xmlrpc-tools/ @ 491:be33ecd58d4e

add run() methods to scripts, include version info into MoinMoin/ for epydoc imported from: moin--main--1.5--patch-495
author Thomas Waldmann <>
date Wed, 22 Mar 2006 09:55:32 +0000
parents 77665d8e2254
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 ***

GPL software, 2003-08-10 Thomas Waldmann

from xmlrpclib import *

srcwiki = ServerProxy("")
#srcwiki = ServerProxy("")
dstwiki = ServerProxy("")

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__":