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 reads a wikibackup.pickle file and puts
all Pages contained there into a wiki via xmlrpc.
We use wiki rpc v2 here.

Important note:

This script ONLY handles the current versions of the wiki pages.

It does NOT handle:
    * event or edit logs (page history)
    * old versions of pages
    * attachments
    * user account data
    * MoinMoin code or config running the wiki
So this is definitely NOT a complete restore.

GPL software, 2003-10-24 Thomas Waldmann
def run():
    import xmlrpclib
    from import BasicAuthTransport

    user = "ThomasWaldmann"
    password = "xxxxxxxxxxxx"
    dsttrans = BasicAuthTransport(user,password)
    dstwiki = xmlrpclib.ServerProxy("", transport=dsttrans)
    #dstwiki = xmlrpclib.ServerProxy("")

        import cPickle as pickle
    except ImportError:
        import pickle

    backupfile = open("wikibackup.pickle","r")
    backup = pickle.load(backupfile)

    allpages = backup.keys()
    for pagename in allpages:
        pagedata = backup[pagename]
        dstwiki.putPage(pagename, pagedata) # TODO: add error check
        print "Put %s." % pagename

if __name__ == "__main__":