@command('registry', required=['host'], optional=['service-name', 'registry-path'])
def registry_command(options, host, service_name=None, registry_path='/protorpc'):
 dest_dir = os.path.expanduser(options.dest_dir)
 url = ('http://%s%s' % (host, registry_path))
 reg = registry.RegistryService.Stub(transport.HttpTransport(url))
 if (service_name is None):
  service_names = [service.name for service in reg.services().services]
 else:
  service_names = [service_name]
 file_set = reg.get_file_set(names=service_names).file_set
 for file_descriptor in file_set.files:
  generate_file_descriptor(dest_dir, file_descriptor=file_descriptor, force_overwrite=options.force)

@ command ( 'registry' , required = [ 'host' ] , optional = [ 'service-name' , 'registry-path' ] ) def registry_command ( options , host , service_name = None , registry_path = '/protorpc' ) : dest_dir = os . path . expanduser ( options . dest_dir ) url = ( 'http://%s%s' % ( host , registry_path ) ) reg = registry . RegistryService . Stub ( transport . HttpTransport ( url ) ) if ( service_name is None ) : service_names = [ service . name for service in reg . services ( ) . services ] else : service_names = [ service_name ] file_set = reg . get_file_set ( names = service_names ) . file_set for file_descriptor in file_set . files : generate_file_descriptor ( dest_dir , file_descriptor = file_descriptor , force_overwrite = options . force )
generate source directory structure from remote registry service .