Python 2.7 has reached end of support and will be deprecated on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7 applications, even if your organization previously used an organization policy to re-enable deployments of legacy runtimes. Your existing Python 2.7 applications will continue to run and receive traffic after their deprecation date. We recommend that you migrate to the latest supported version of Python.

google.appengine.api.dispatchinfo module

Summary

Dispatch configuration tools.

Library for parsing dispatch.yaml files and working with these in memory.

Contents

class google.appengine.api.dispatchinfo.DispatchEntry(**attributes)source

Bases: google.appengine.api.validation.Validated

A Dispatch entry describes a mapping from a URL pattern to a module.

ATTRIBUTES = {u'url': <google.appengine.api.dispatchinfo.DispatchEntryURLValidator object>, u'service': <google.appengine.api.validation.Optional object>, u'module': <google.appengine.api.validation.Optional object>}
class google.appengine.api.dispatchinfo.DispatchEntryURLValidator(default=None)source

Bases: google.appengine.api.validation.Validator

Validater for URL patterns.

Validate(value, unused_key=None)source

Validates an URL pattern.

class google.appengine.api.dispatchinfo.DispatchInfoExternal(**attributes)source

Bases: google.appengine.api.validation.Validated

Describes the format of a dispatch.yaml file.

ATTRIBUTES = {u'application': <google.appengine.api.validation.Optional object>, u'dispatch': <google.appengine.api.validation.Optional object>}
exception google.appengine.api.dispatchinfo.Errorsource

Bases: exceptions.Exception

Base class for errors in this module.

google.appengine.api.dispatchinfo.LoadSingleDispatch(dispatch_info, open_fn=None)source

Load a dispatch.yaml file or string and return a DispatchInfoExternal.

Parameters
  • dispatch_info – The contents of a dispatch.yaml file as a string, or an open file object.

  • open_fn – Function for opening files. Unused here, needed to provide a polymorphic API used by appcfg.py yaml parsing.

Returns

A DispatchInfoExternal instance which represents the contents of the parsed

yaml file.

Raises
  • MalformedDispatchConfigurationError – The yaml file contains multiple dispatch sections or is missing a required value.

  • yaml_errors.EventError – An error occured while parsing the yaml file.

exception google.appengine.api.dispatchinfo.MalformedDispatchConfigurationErrorsource

Bases: google.appengine.api.dispatchinfo.Error

Configuration file for dispatch is malformed.

class google.appengine.api.dispatchinfo.ParsedURL(url_pattern)source

Bases: object

Dispath Entry URL holder class.

host_pattern

The host pattern component of the URL pattern.

host_exact

True if the host pattern does not start with a *.

host

host_pattern with any leading * removed.

path_pattern

The path pattern component of the URL pattern.

path_exact

True if the path_pattern does not end with a *.

path

path_pattern with any trailing * removed.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年06月16日 UTC.