# DescriptorLibrary Functions - Google App Engine - Google Code

English ▼
Skip to page content Skip to main navigation
e.g. "templates" or "datastore"

# DescriptorLibrary Functions

#### Experimental!

ProtoRPC is an experimental, innovative, and rapidly changing new feature for App Engine. Unfortunately, being on the bleeding edge means that we may make backwards-incompatible changes to ProtoRPC. We will inform the community when this feature is no longer experimental.

A descriptor library is an object that contains known definitions. It contains a cache of descriptor objects mapped by definition name, and contains all types of descriptors except for file sets.

If the application provides a definition name that is not in the library, the application can include a descriptor loader that attempts to resolve the missing descriptor.

DescriptorLibrary is provided by the `protorpc.descriptor` module.

- lookup_descriptor()
- lookup_package()

## Functions

DescriptorLibrary provides the following functions:

lookup_descriptor(definition_name)

  Gets a descriptor from the library for the given definition name. If the descriptor is not found, attempts to find it using the descriptor loader.

  Arguments:

  definition_name
    The definition name for which to find a descriptor.

  Returns a descriptor describing the definition name.

  Raises a DefinitionNotFoundError error if no descriptor exists for the given definition name.

lookup_package(definition_name)

  Determines the package name that any definition name belongs to. May check the parent for the package name. Attempts to resolve missing descriptors if provided a descriptor loader.

  Arguments:

  definition_name
    The definition name for which to find a package.

  Returns a descriptor object describing the package name.