def describe_service(service_class):
 descriptor = ServiceDescriptor()
 descriptor.name = service_class.__name__
 methods = []
 remote_methods = service_class.all_remote_methods()
 for name in sorted(remote_methods.iterkeys()):
  if (name == 'get_descriptor'):
   continue
  method = remote_methods[name]
  methods.append(describe_method(method))
 if methods:
  descriptor.methods = methods
 return descriptor

def describe_service ( service_class ) : descriptor = ServiceDescriptor ( ) descriptor . name = service_class . __name__ methods = [ ] remote_methods = service_class . all_remote_methods ( ) for name in sorted ( remote_methods . iterkeys ( ) ) : if ( name == 'get_descriptor' ) : continue method = remote_methods [ name ] methods . append ( describe_method ( method ) ) if methods : descriptor . methods = methods return descriptor
build descriptor for service .