1
0
Fork 0
gnuviechadmin-historic/frontend/common/xmlrpcclient.py
Jan Dittberner bca6369b41 SessionManager and client-server communication implemented
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@185 a67ec6bc-e5d5-0310-a910-815c51eb3124
2006-04-17 19:20:14 +00:00

29 lines
766 B
Python
Executable file

#!/usr/bin/python
# XML-RPC-Client
# (c) 2006 Jan Dittberner
# version: $Id$
#
from xmlrpclib import ServerProxy
import logging, sys
if __name__ == '__main__':
server = ServerProxy('http://localhost:8080')
logger = logging.getLogger()
logging.basicConfig()
sessionid = None
try:
sessionid = server.login('jan', 'heyyou97')
if sessionid:
print "Session %s" % sessionid
print server.listdomains(sessionid)
server.logout(sessionid)
else:
print "login failed"
except Exception, v:
logger.exception(v)
if sessionid is not None:
try:
server.logout(sessionid)
except Exception, vn:
logger.exception(vn)