google.appengine.api.appinfo.BuiltinHandler

Class representing built-in handler directives in application info.

Inherits From: Validated, ValidatedBase, expected_type

This class permits arbitrary keys, but their values must be described by the validation.Options object that is returned by ATTRIBUTES.

**attributes The attributes that you want to use.

Child Classes

class DynamicAttributes

Methods

CheckInitialized

View source

Checks for missing or conflicting attributes.

Subclasses should override this function and raise an exception for any errors. Always run this method when all assignments are complete.

Raises
ValidationError When there are missing or conflicting attributes.

Get

View source

Get a single value on Validated instance.

This method can only be used to retrieve validated attributes.

Args
key The name of the attributes

Raises
ValidationError when no validated attribute exists on class.

GetUnnormalized

View source

Get a single value on the Validated instance, without normalizing.

GetValidator

View source

Safely get the underlying attribute definition as a Validator.

Args
key Name of attribute to get.

Returns
Validator associated with key or attribute value wrapped in a validator.

Raises
ValidationError if no such attribute exists.

GetWarnings

View source

Return all the warnings we've got, along with their associated fields.

Returns
A list of tuples of (dotted_field, warning), both strings.

IsDefined

View source

Finds if a builtin is defined in a given list of builtin handler objects.

Args
builtins_list A list of BuiltinHandler objects, typically yaml.builtins.
builtin_name The name of the built-in that you want to determine whether it is defined.

Returns
True if builtin_name is defined by a member of builtins_list; all other results return False.

ListToTuples

View source

Converts a list of BuiltinHandler objects.

Args
builtins_list A list of BuildinHandler objects to convert to tuples.

Returns
A list of (name, status) that is derived from the BuiltinHandler objects.

Set

View source

Set a single value on Validated instance.

This method can only be used to assign validated attributes.

Args
key The name of the attributes
value The value to set

Raises
ValidationError when no validated attribute exists on class.

SetMultiple

View source

Set multiple values on Validated instance.

All attributes will be validated before being set.

Args
attributes A dict of attributes/items to set.

Raises
ValidationError When no validated attribute exists on class.

ToDict

View source

Converts a BuiltinHander object to a dictionary.

Returns
A dictionary in {builtin_handler_name: on/off} form

ToYAML

View source

Print validated object as simplified YAML.

Returns
Object as a simplified YAML string compatible with parsing using the SafeLoader.

Validate

View source

Verifies that all BuiltinHandler objects are valid and not repeated.

Args
builtins_list A list of BuiltinHandler objects to validate.
runtime If you specify this argument, warnings are generated for built-ins that have been deprecated in the given runtime.

Raises
InvalidBuiltinFormat If the name of a BuiltinHandler object cannot be determined.
DuplicateBuiltinsSpecified If a BuiltinHandler name is used more than once in the list.

__eq__

View source

Equality operator.

Comparison is done by comparing all attribute values to those in the other instance. Objects which are not of the same type are not equal.

Args
other Other object to compare against.

Returns
True if validated objects are equal, else False.

__ne__

View source

Inequality operator.

ATTRIBUTES

{

}