Ejemplo n.º 1
0
def run():
    import xmlrpclib
    from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
    from MoinMoin.util import pickle, PICKLE_PROTOCOL

    #user = "******"
    #password = "******"
    #srctrans = BasicAuthTransport(user,password)
    #srcwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/__xmlrpc/?action=xmlrpc2", transport=srctrans)
    srcwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/?action=xmlrpc2")

    backup = {}
    allpages = srcwiki.getAllPages()
    for pagename in allpages:
        pagedata = srcwiki.getPage(pagename)
        print "Got %s." % pagename
        backup[pagename] = pagedata

    backupfile = open("wikibackup.pickle", "w")
    pickle.dump(backup, backupfile, PICKLE_PROTOCOL)
    backupfile.close()
Ejemplo n.º 2
0
 def commit(self):
     """ Writes the memory contents to the data file. """
     datafile = file(self.filename, "wb")
     pickle.dump(self.tags, datafile, pickle.HIGHEST_PROTOCOL)
     datafile.close()
Ejemplo n.º 3
0
 def commit(self):
     """ Writes the memory contents to the data file. """
     datafile = file(self.filename, "wb")
     pickle.dump(self.tags, datafile, pickle.HIGHEST_PROTOCOL)
     datafile.close()