#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

"""
yafnag_xmlrpc_client.py: an example of a minimalist XML-RPC client for
the yafnag name generator (at http://hamete.org/yafnag) using python 
standard lib "xmlrpclib".

Yafnag XML-RPC service address: 
    http://hamete.org/yafnag/rpc
    (use standard port 80) 
    
The XML-RPC server has only one method : "names", with 3 integers as 
input parameters (min length, max length, number of names
to generate). The result is a text string with a name per line.
"""

__version__="$Id: yafnag_xmlrpc_client.py 3284 2007-08-26 20:39:31Z svn $"

import xmlrpclib

proxy = xmlrpclib.ServerProxy("http://www.hamete.org/yafnag/rpc")

long_min = 4
long_max = 8
quantity = 10

result = proxy.names(long_min, long_max, quantity)

print result

