changeset 3166:a56218a337fb

xmlrpc-tools: remove some old crap
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 02 Mar 2008 02:45:03 +0100
parents b8dc6c2e6c53
children 91092bf1816a
files MoinMoin/script/old/xmlrpc-tools/get_es_pages.py MoinMoin/script/old/xmlrpc-tools/getmasterpages2.py MoinMoin/script/old/xmlrpc-tools/getsystempages.py MoinMoin/script/old/xmlrpc-tools/getsystempages2.py MoinMoin/script/old/xmlrpc-tools/putPageTest.py
diffstat 5 files changed, 0 insertions(+), 191 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/old/xmlrpc-tools/get_es_pages.py	Sun Mar 02 02:19:42 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-""" get some pages from another wiki """
-
-def run():
-    import sys, os, xmlrpclib, codecs
-
-    sys.path.insert(0, "..")
-    from MoinMoin import wikiutil
-
-    s = xmlrpclib.ServerProxy("http://wainu.ii.uned.es/wainuki/?action=xmlrpc2")
-    index = open("index")
-
-    for l in index:
-        d = l.split('||')
-        pn = d[3].strip()
-        pd = s.getPage(pn)
-        dn = wikiutil.quoteWikinameFS(pn.decode("utf-8"))
-        os.mkdir(dn)
-        cn = os.path.join(dn, 'current')
-        f = open(cn, 'w')
-        f.write('00000001\n')
-        f.close()
-        dn2 = os.path.join(dn, 'revisions')
-        os.mkdir(dn2)
-        fn = os.path.join(dn2, '00000001')
-        f = codecs.open(fn, "wb", "utf-8")
-        pd = pd.replace('\n', '\r\n')
-        f.write(pd)
-        f.close()
-
-if __name__ == "__main__":
-    run()
-
--- a/MoinMoin/script/old/xmlrpc-tools/getmasterpages2.py	Sun Mar 02 02:19:42 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-"""
-This script is a hack because moinmaster wiki does not support
-xmlrpc due to unknown reasons. It gets all SystemPages from srcwiki
-via action=raw and stores them into dstwiki via xmlrpc.
-
-We use wiki rpc v2 here.
-
-GPL software, 2003-09-27 Thomas Waldmann
-"""
-
-import xmlrpclib, urllib
-from MoinMoin import wikiutil
-from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
-
-srcurlformat = "http://master.moinmo.in/%s?action=raw"
-user = "YourWikiName"
-password = "yourbasicauthpassword"
-srcwiki = xmlrpclib.ServerProxy("http://master.moinmo.in/?action=xmlrpc2")
-dsttrans = BasicAuthTransport(user, password)
-dstwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--main/__xmlrpc/?action=xmlrpc2", transport=dsttrans)
-
-def rawGetPage(srcurl, pagename, encoding='iso-8859-1'):
-    url = srcurl % wikiutil.quoteWikinameFS(pagename.encode(encoding))
-    pagedata = urllib.urlopen(url).read()
-    return unicode(pagedata, encoding).encode('utf-8')
-
-def transferpage(srcurlformat, dstwiki, pagename):
-    pagedata = srcwiki.getPage(pagename)
-    #pagedata = rawGetPage(srcurlformat, pagename, 'iso-8859-1')
-    rc = dstwiki.putPage(pagename, pagedata)
-    print "Transferred %s. Len = %d, rc = %s" % (pagename.encode('ascii', 'replace'), len(pagedata), str(rc))
-
-def run():
-    allsystempagesgroup = 'AllSystemPagesGroup'
-    transferpage(srcurlformat, dstwiki, allsystempagesgroup)
-    allgrouppages = dstwiki.listLinks(allsystempagesgroup)
-
-    for langgrouppage in allgrouppages:
-        pagename = langgrouppage['name']
-        transferpage(srcurlformat, dstwiki, pagename)
-        pages = dstwiki.listLinks(pagename)
-        for page in pages:
-            transferpage(srcurlformat, dstwiki, page['name'])
-
-if __name__ == "__main__":
-    run()
-
--- a/MoinMoin/script/old/xmlrpc-tools/getsystempages.py	Sun Mar 02 02:19:42 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-"""
-This script gets all SystemPages from srcwiki via xmlrpc and
-stores them into dstwiki via xmlrpc. We use wiki rpc v1 here.
-
-*** DO NOT USE, SEE getsystempages2.py ***
-
-GPL software, 2003-08-10 Thomas Waldmann
-"""
-
-from xmlrpclib import *
-
-srcwiki = ServerProxy("http://master.moinmo.in/?action=xmlrpc")
-#srcwiki = ServerProxy("http://master.moinmo.in/?action=xmlrpc")
-dstwiki = ServerProxy("http://devel.linuxwiki.org/moin--cvs?action=xmlrpc")
-
-def transferpage(srcwiki, dstwiki, pagename):
-    pagedata = srcwiki.getPage(pagename).data
-    dstwiki.putPage(pagename, Binary(pagedata))
-    print "Transferred %s." % pagename
-
-def run():
-    allsystempagesgroup = 'AllSystemPagesGroup'
-    transferpage(srcwiki, dstwiki, allsystempagesgroup)
-    allgrouppages = srcwiki.listLinks(allsystempagesgroup)
-    for langgrouppage in allgrouppages:
-        pagename = langgrouppage['name']
-        transferpage(srcwiki, dstwiki, pagename)
-        pages = srcwiki.listLinks(pagename)
-        for page in pages:
-            transferpage(srcwiki, dstwiki, page['name'])
-
-if __name__ == "__main__":
-    run()
-
--- a/MoinMoin/script/old/xmlrpc-tools/getsystempages2.py	Sun Mar 02 02:19:42 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-"""
-This script gets all SystemPages from srcwiki via xmlrpc and
-stores them into dstwiki via xmlrpc. We use wiki rpc v2 here.
-
-GPL software, 2003-08-10 Thomas Waldmann
-"""
-
-import xmlrpclib
-from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
-
-#srcwiki = xmlrpclib.ServerProxy("http://master.moinmo.in/?action=xmlrpc")
-user = "YourWikiName"
-password = "yourbasicauthpassword"
-srctrans = BasicAuthTransport(user, password)
-dsttrans = BasicAuthTransport(user, password)
-srcwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/__xmlrpc/?action=xmlrpc2", transport=srctrans)
-dstwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/__xmlrpc/?action=xmlrpc2", transport=dsttrans)
-
-def transferpage(srcwiki, dstwiki, pagename):
-    pagedata = srcwiki.getPage(pagename)
-    dstwiki.putPage(pagename, pagedata)
-    print "Transferred %s." % pagename.encode('ascii', 'replace')
-
-def run():
-    allsystempagesgroup = 'AllSystemPagesGroup'
-    transferpage(srcwiki, dstwiki, allsystempagesgroup)
-    allgrouppages = srcwiki.listLinks(allsystempagesgroup)
-    for langgrouppage in allgrouppages:
-        pagename = langgrouppage['name']
-        transferpage(srcwiki, dstwiki, pagename)
-        pages = srcwiki.listLinks(pagename)
-        for page in pages:
-            transferpage(srcwiki, dstwiki, page['name'])
-
-if __name__ == "__main__":
-    run()
-
--- a/MoinMoin/script/old/xmlrpc-tools/putPageTest.py	Sun Mar 02 02:19:42 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
-This script is just an example how to put data into a wiki using xmlrpc.
-We use wiki rpc v2 here.
-
-This script only works if you edited MoinMoin/xmlrpc/__init__.py (see the
-comment in the putPage handler) to not require http auth (trusted user) and to
-really use the pagename we give.
-
-This can be done for migrating data into an offline moin wiki running on
-localhost - don't put a wiki configured like this on the internet!
-
-GPL software, 2005 Thomas Waldmann
-"""
-def run():
-    import xmlrpclib
-    mywiki = xmlrpclib.ServerProxy("http://localhost/mywiki/?action=xmlrpc2")
-
-    # first a simple test in pure ascii
-    pagename = "ApureAsciiPage"
-    pagedata = "My first test."
-    mywiki.putPage(pagename, pagedata)
-
-    # now let's use some utf-8 encoded pagename and text
-    # this stuff will only look correct if you use utf-8 enabled equipment.
-    pagename = "SomeUtf8Pagename-äöüÄÖÜߢ" # we use some german chars here
-    pagedata = "Some UTF-8 content: äöü ÄÖÜ ß ¢"
-    mywiki.putPage(pagename, pagedata)
-
-    # if you have data in iso-8859-1 (latin1) encoding, then use code similar to:
-    # pagename = latin1pagename.decode('iso-8859-1').encode('utf-8')
-    # pagedata = latin1pagedata.decode('iso-8859-1').encode('utf-8')
-    # mywiki.putPage(pagename, pagedata)
-
-if __name__ == "__main__":
-    run()
-