~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/script/old/xmlrpc-tools/getsystempages.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
"""
3
 
This script gets all SystemPages from srcwiki via xmlrpc and
4
 
stores them into dstwiki via xmlrpc. We use wiki rpc v1 here.
5
 
 
6
 
*** DO NOT USE, SEE getsystempages2.py ***
7
 
 
8
 
GPL software, 2003-08-10 Thomas Waldmann
9
 
"""
10
 
 
11
 
from xmlrpclib import *
12
 
 
13
 
srcwiki = ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc")
14
 
#srcwiki = ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc")
15
 
dstwiki = ServerProxy("http://devel.linuxwiki.org/moin--cvs?action=xmlrpc")
16
 
 
17
 
def transferpage(srcwiki, dstwiki, pagename):
18
 
    pagedata = srcwiki.getPage(pagename).data
19
 
    dstwiki.putPage(pagename, Binary(pagedata))
20
 
    print "Transferred %s." % pagename
21
 
 
22
 
def run():
23
 
    allsystempagesgroup = 'AllSystemPagesGroup'
24
 
    transferpage(srcwiki, dstwiki, allsystempagesgroup)
25
 
    allgrouppages = srcwiki.listLinks(allsystempagesgroup)
26
 
    for langgrouppage in allgrouppages:
27
 
        pagename = langgrouppage['name']
28
 
        transferpage(srcwiki, dstwiki, pagename)
29
 
        pages = srcwiki.listLinks(pagename)
30
 
        for page in pages:
31
 
            transferpage(srcwiki, dstwiki, page['name'])
32
 
 
33
 
if __name__ == "__main__":
34
 
    run()
35