| 1 |
ajm |
1.1 |
#!/usr/bin/python |
| 2 |
|
|
# |
| 3 |
|
|
# Experiments with Pythons XML-RPM implementation |
| 4 |
|
|
# - the client |
| 5 |
|
|
# |
| 6 |
|
|
# $Id$ |
| 7 |
|
|
|
| 8 |
|
|
from xmlrpclib import ServerProxy |
| 9 |
|
|
|
| 10 |
|
|
def main(): |
| 11 |
|
|
print '--- i-scream.org XML-RPC test client ---' |
| 12 |
|
|
|
| 13 |
|
|
server = ServerProxy("http://localhost:8000") |
| 14 |
|
|
print 'connected to:', server |
| 15 |
|
|
print 'listing methods:' |
| 16 |
|
|
for method in server.system.listMethods(): |
| 17 |
|
|
print 'method -', method |
| 18 |
|
|
print server.system.methodHelp(method) |
| 19 |
|
|
print server.remoteprint('test') |
| 20 |
|
|
print server.system.multicall([{'methodName': 'remoteprint', 'params':['multicalltest1']}, \ |
| 21 |
|
|
{'methodName': 'remoteprint', 'params':['multicalltest2']}]) |
| 22 |
|
|
|
| 23 |
|
|
print server.die() |
| 24 |
|
|
|
| 25 |
|
|
if __name__=='__main__': |
| 26 |
|
|
main() |