"""Code snippet to test the Java ServerProxy interface to the Pings server."""

import ServerProxy, ClientInfo

sp = ServerProxy('localhost', 6543)

if False:
    # Need to change permissions on ServerProxy Java class for this to work.
    print 'Calling doJsonRequest directly...'
    r = sp.doJsonRequest('/get_pings', None)
    print r

print
info = ClientInfo()
pings = sp.getPings(info)
print pings.token
print pings.addresses[0]
print pings.geoip_info[0]

# Fill in results.
for i in range(len(pings.addresses)):
    pings.results[i] = 'FOO %d' % i

print
print 'Submitting results'
sp.submitResults(info, pings)

@@ -386,24 +386,33 @@
 (info)%0Aprint
+ 'Token',
  pings.token
@@ -413,24 +413,41 @@
 .token%0Aprint
+ 'First address',
  pings.addre
@@ -464,27 +464,95 @@
 int 
-pings.geoip_info%5B0%5D
+'Geoip for first address', pings.geoip_info%5B0%5D%0Aprint 'Client Geoip', pings.client_geoip
 %0A%0A# 

Add display of client geoip info. And print description of what we are printing.