eGroupWare is a multi-user, web-based groupware suite developed on a custom set of PHP-based APIs. C

源代码在线查看: test.py

软件大小: 16557 K
上传用户: granite518
关键词: eGroupWare multi-user developed PHP-based
下载地址: 免注册下载 普通下载 VIP

相关代码

				#!/usr/bin/python								# $Id: test.py,v 1.3 2003/12/28 15:58:08 milosch Exp $								from xmlrpclib import *				import sys								server = Server("http://www.egroupware.org/egroupware/xmlrpc.php");								try:				    print "Listing methods:\n"				    r = server.system.listMethods();				    print r								    print "\nTrying to login:\n"				    up = {'domain': 'default', 'username': 'demo', 'password': 'guest'}				    l = server.system.login(up);				    print l								    print "\nTrying name/age struct/array test:\n"				    # name/age example. this exercises structs and arrays				    a = [ {'name': 'Dave', 'age': 35}, {'name': 'Edd', 'age': 45 },				          {'name': 'Fred', 'age': 23}, {'name': 'Barney', 'age': 36 }]				    r = server.examples.sortByAge(a)				    print r								    print "\nTrying base 64 test:\n"				    # test base 64				    b = Binary("Mary had a little lamb She tied it to a pylon")				    b.encode(sys.stdout)				    r = server.examples.decode64(b)				    print r				    				    print "\nTrying to logout:\n"				    sk = {'sessionid': l['sessionid'], 'kp3': l['kp3']}				    r = server.system.logout(sk);				    print r								except Error, v:				    print "XML-RPC Error:",v							

相关资源