Back to index

moin  1.9.0~rc2
Functions
MoinMoin.script.old.xmlrpc-tools.wikirestore Namespace Reference

Functions

def run

Function Documentation

def MoinMoin.script.old.xmlrpc-tools.wikirestore.run ( )

Definition at line 22 of file wikirestore.py.

00022 
00023 def run():
00024     import xmlrpclib
00025     from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
00026     from MoinMoin.util import pickle
00027 
00028     user = "ThomasWaldmann"
00029     password = "xxxxxxxxxxxx"
00030     dsttrans = BasicAuthTransport(user, password)
00031     dstwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/__xmlrpc/?action=xmlrpc2", transport=dsttrans)
00032     #dstwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/?action=xmlrpc2")
00033 
00034     backupfile = open("wikibackup.pickle", "r")
00035     backup = pickle.load(backupfile)
00036     backupfile.close()
00037 
00038     for pagename in backup:
00039         pagedata = backup[pagename]
00040         dstwiki.putPage(pagename, pagedata) # TODO: add error check
00041         print "Put %s." % pagename