Back to index

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

Functions

def run

Function Documentation

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

Definition at line 21 of file wikibackup.py.

00021 
00022 def run():
00023     import xmlrpclib
00024     from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
00025     from MoinMoin.util import pickle, PICKLE_PROTOCOL
00026 
00027     #user = "username"
00028     #password = "xxxxxxxx"
00029     #srctrans = BasicAuthTransport(user,password)
00030     #srcwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/__xmlrpc/?action=xmlrpc2", transport=srctrans)
00031     srcwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/?action=xmlrpc2")
00032 
00033     backup = {}
00034     allpages = srcwiki.getAllPages()
00035     for pagename in allpages:
00036         pagedata = srcwiki.getPage(pagename)
00037         print "Got %s." % pagename
00038         backup[pagename] = pagedata
00039 
00040     backupfile = open("wikibackup.pickle", "w")
00041     pickle.dump(backup, backupfile, PICKLE_PROTOCOL)
00042     backupfile.close()