Пример #1
0
def get_modules():
    """Returns a list of all modules for the application.

  Returns:
    List of strings containing the names of modules associated with this
      application.  The 'default' module will be included if it exists, as will
      the name of the module that is associated with the instance that calls
      this function.
  """
    req = modules_service_pb.GetModulesRequest()
    resp = modules_service_pb.GetModulesResponse()
    apiproxy_stub_map.MakeSyncCall('modules', 'GetModules', req, resp)

    return list(resp.module_list())
Пример #2
0
def get_modules():
    """Returns a list of all modules for the application.

  Returns:
    List of strings containing the names of modules associated with this
      application.  The 'default' module will be included if it exists, as will
      the name of the module that is associated with the instance that calls
      this function.
  """
    def _ResultHook(rpc):
        _CheckAsyncResult(rpc, [], {})

        return list(rpc.response.module_list())

    request = modules_service_pb.GetModulesRequest()
    response = modules_service_pb.GetModulesResponse()
    return _MakeAsyncCall('GetModules', request, response,
                          _ResultHook).get_result()
Пример #3
0
def get_modules_async():
    """Returns a UserRPC whose result contains this application's module names.

  DEPRECATED. Please use get_modules instead.

  Returns:
    A UserRPC whose result contains a list of strings containing the names
    of modules associated with this application. The 'default' module will be
    included if it exists, as will the name of the module that is associated
    with the instance that calls this function.
  """
    logging.warning('The get_modules_async function is deprecated. Please '
                    'use get_modules instead.')

    def _ResultHook(rpc):
        _CheckAsyncResult(rpc, [], {})

        return list(rpc.response.module_list())

    request = modules_service_pb.GetModulesRequest()
    response = modules_service_pb.GetModulesResponse()
    return _MakeAsyncCall('GetModules', request, response, _ResultHook)