view tests/rpctest.py @ 724:fbe43f9574f1 SOC2006-START

removed tag SOC2006-START
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 27 May 2006 14:07:25 +0200
parents 77665d8e2254
children
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
import xmlrpclib

if __name__ == "__main__":

    server = xmlrpclib.ServerProxy('http://127.0.0.1/cgi-bin/wiki.bat/?action=xmlrpc')
    print server

    try:
        frontpage = server.getPage('FrontPage').data.decode('UTF-8')
        print "Length of FrontPage:", len(frontpage)
        print "Start of FrontPage:", repr(frontpage[:50]), "..."
        print "End of FrontPage:", "...", repr(frontpage[-50:])
        print "Interface Version:", server.getRPCVersionSupported()
        print "Number of Pages:", len(server.getAllPages())
    except xmlrpclib.Error, v:
        print "ERROR", v