## page was renamed from ReimarBauer/xmlrpc_getPage = wikiconfig = {{{ actions_excluded = multiconfig.DefaultConfig.actions_excluded[:] actions_excluded.remove('xmlrpc') acl_rights_before = u"AdminName:read,write,delete,revert,admin" acl_rights_default = u"UserGroup:read,write,delete,revert All:" }}} = Examples = == put page == {{{#!python #!/usr/bin/env python # -*- coding: iso-8859-1 -*- import xmlrpclib name = "TestUser" password = "secret" wikiurl = "http://localhost:8080" homewiki = xmlrpclib.ServerProxy(wikiurl + "?action=xmlrpc2", allow_none=True) auth_token = homewiki.getAuthToken(name, password) mc = xmlrpclib.MultiCall(homewiki) mc.applyAuthToken(auth_token) pagename = 'TestSeite' text = 'Dies ist eine Zeile Text' mc.putPage(pagename, text) result = mc() }}} == get page == {{{#!python #!/usr/bin/env python # -*- coding: iso-8859-1 -*- import xmlrpclib name = "TestUser" password = "secret" wikiurl = "http://localhost:8080/" homewiki = xmlrpclib.ServerProxy(wikiurl + "?action=xmlrpc2", allow_none=True) auth_token = homewiki.getAuthToken(name, password) mc = xmlrpclib.MultiCall(homewiki) mc.applyAuthToken(auth_token) pagename = u'FrontPage' mc.getPage(pagename) result = mc() success, raw = tuple(result) if success: print raw }}} == put attachment == {{{#!python #!/usr/bin/env python # -*- coding: iso-8859-1 -*- import xmlrpclib name = "TestUser" password = "secret" wikiurl = "http://localhost:8080" homewiki = xmlrpclib.ServerProxy(wikiurl + "?action=xmlrpc2", allow_none=True) mc = xmlrpclib.MultiCall(homewiki) auth_token = homewiki.getAuthToken(name, password) mc.applyAuthToken(auth_token) pagename = 'WikiSandBox' attachname = 'Beispiel.txt' text = file(attachname, 'rb').read() data = xmlrpclib.Binary(text) mc.putAttachment(pagename, attachname, data) result = mc() }}} == get attachment == {{{#!python #!/usr/bin/env python # -*- coding: iso-8859-1 -*- import xmlrpclib wikiurl = "http://localhost:8080" homewiki = xmlrpclib.ServerProxy(wikiurl + "?action=xmlrpc2", allow_none=True) pagename = 'TestSeite' attachname = 'Beispiel.txt' data = homewiki.getAttachment(pagename, attachname) file(attachname, 'wb').write(data.data) }}}