2
# -*- coding: utf-8 -*-
4
This script is just an example how to put data into a wiki using xmlrpc.
5
We use wiki rpc v2 here.
7
This script only works if you edited MoinMoin/wikirpc.py (see the comment
8
in the putPage handler) to not require http auth (trusted user) and to
9
really use the pagename we give.
11
This can be done for migrating data into an offline moin wiki running on
12
localhost - don't put a wiki configured like this on the internet!
14
GPL software, 2005 Thomas Waldmann
18
mywiki = xmlrpclib.ServerProxy("http://localhost/mywiki/?action=xmlrpc2")
20
# first a simple test in pure ascii
21
pagename = "ApureAsciiPage"
22
pagedata = "My first test."
23
mywiki.putPage(pagename, pagedata)
25
# now let's use some utf-8 encoded pagename and text
26
# this stuff will only look correct if you use utf-8 enabled equipment.
27
pagename = "SomeUtf8Pagename-äöüÄÖÜߢ" # we use some german chars here
28
pagedata = "Some UTF-8 content: äöü ÄÖÜ ß ¢"
29
mywiki.putPage(pagename, pagedata)
31
# if you have data in iso-8859-1 (latin1) encoding, then use code similar to:
32
# pagename = latin1pagename.decode('iso-8859-1').encode('utf-8')
33
# pagedata = latin1pagedata.decode('iso-8859-1').encode('utf-8')
34
# mywiki.putPage(pagename, pagedata)
36
if __name__ == "__main__":