Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
DescriptorLibrary 関数
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
記述子ライブラリとは、既知の定義を含むオブジェクトです。このライブラリには、定義名によってマッピングされた記述子オブジェクトのキャッシュと、ファイル セットを除くすべての種類の記述子が含まれます。
アプリケーションでライブラリにない定義名を提供する場合、見つからない記述子を解決するために、アプリケーションに記述子ローダーを含めることができます。
DescriptorLibrary は protorpc.descriptor
モジュールで提供されます。
関数
DescriptorLibrary には、次の関数があります:
- lookup_descriptor(definition_name)
-
ライブラリから指定された定義名の記述子を取得します。記述子が見つからない場合、記述子ローダーを使って検索を試みます。
引数
- definition_name
- 記述子を検索する定義名。
定義名を記述する記述子を返します。
指定された定義名の記述子が存在しない場合、DefinitionNotFoundError エラーを送出します。
- lookup_package(definition_name)
-
定義名が属するパッケージ名を判断します。パッケージ名の親を確認できます。記述子ローダーを指定した場合、見つからない記述子の解決を試みます。
引数
- definition_name
- パッケージを検索する定義名。
パッケージ名を記述する記述子オブジェクトを返します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eDescriptor libraries are objects that store known definitions, caching descriptor objects by their definition name and including all descriptor types except file sets.\u003c/p\u003e\n"],["\u003cp\u003eThey can utilize a descriptor loader to resolve definition names not initially found within the library.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elookup_descriptor\u003c/code\u003e function retrieves a descriptor by definition name, using the descriptor loader if needed, and raises a \u003ccode\u003eDefinitionNotFoundError\u003c/code\u003e if unsuccessful.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elookup_package\u003c/code\u003e function identifies the package a given definition name belongs to, possibly checking parent packages, and can employ a descriptor loader for missing definitions.\u003c/p\u003e\n"]]],[],null,["# DescriptorLibrary Functions\n\nA 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.\n\nIf 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.\n\nDescriptorLibrary is provided by the `protorpc.descriptor` module.\n\nFunctions\n---------\n\nDescriptorLibrary provides the following functions:\n\nlookup_descriptor(definition_name)\n\n: 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.\n\n **Arguments**\n\n definition_name\n : The definition name for which to find a descriptor.\n\n Returns a descriptor describing the definition name.\n\n Raises a [DefinitionNotFoundError](/appengine/docs/legacy/standard/python/tools/protorpc/messages/exceptions#DefinitionNotFoundError) error if no descriptor exists for the given definition name.\n\nlookup_package(definition_name)\n\n: 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.\n\n **Arguments**\n\n definition_name\n : The definition name for which to find a package.\n\n Returns a descriptor object describing the package name."]]