View source on GitHub |
Class representing the contents of an included app.yaml
file.
Inherits From: Validated
, ValidatedBase
, expected_type
google.appengine.api.appinfo.AppInclude(
**attributes
)
This class is used for both builtins
and includes
directives.
Raises | |
---|---|
AttributeDefinitionError
|
When class instance is missing ATTRIBUTE
definition or when ATTRIBUTE is of the wrong type.
|
Methods
CheckInitialized
CheckInitialized()
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
Get(
key
)
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
GetUnnormalized(
key
)
Get a single value on the Validated
instance, without normalizing.
GetValidator
@classmethod
GetValidator( key )
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
GetWarnings()
Return all the warnings we've got, along with their associated fields.
Returns | |
---|---|
A list of tuples of (dotted_field, warning), both strings. |
MergeAppIncludes
@classmethod
MergeAppIncludes( appinclude_one, appinclude_two )
Merges the non-referential state of the provided AppInclude
.
That is, builtins
and includes
directives are not preserved, but any
static objects are copied into an aggregate AppInclude
object that
preserves the directives of both provided AppInclude
objects.
appinclude_one
is updated to be the merged result in this process.
Args | |
---|---|
appinclude_one
|
First AppInclude to merge.
|
appinclude_two
|
Second AppInclude to merge.
|
Returns | |
---|---|
AppInclude object that is the result of merging the static directives of
appinclude_one and appinclude_two . An updated version of
appinclude_one is returned.
|
MergeAppYamlAppInclude
@classmethod
MergeAppYamlAppInclude( appyaml, appinclude )
Merges an app.yaml
file with referenced builtins/includes.
Args | |
---|---|
appyaml
|
The app.yaml file that you want to update with appinclude .
|
appinclude
|
The includes that you want to merge into appyaml .
|
Returns | |
---|---|
An updated app.yaml file that includes the directives you specified in
appinclude .
|
MergeManualScaling
@classmethod
MergeManualScaling( appinclude_one, appinclude_two )
Takes the greater of <manual_scaling.instances>
from the arguments.
appinclude_one
is mutated to be the merged result in this process.
Also, this function must be updated if ManualScaling
gets additional
fields.
Args | |
---|---|
appinclude_one
|
The first object to merge. The object must have a
manual_scaling field that contains a ManualScaling() .
|
appinclude_two
|
The second object to merge. The object must have a
manual_scaling field that contains a ManualScaling() .
|
Returns | |
---|---|
An object that is the result of merging
appinclude_one.manual_scaling.instances and
appinclude_two.manual_scaling.instances ; this is returned as a revised
appinclude_one object after the mutations are complete.
|
MergeSkipFiles
@staticmethod
MergeSkipFiles( skip_files_one, skip_files_two )
Merges two skip_files
directives.
Args | |
---|---|
skip_files_one
|
The first skip_files element that you want to merge.
|
skip_files_two
|
The second skip_files element that you want to merge.
|
Returns | |
---|---|
A list of regular expressions that are merged. |
Set
Set(
key, value
)
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
SetMultiple(
attributes
)
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
ToDict()
Convert Validated object to a dictionary.
Recursively traverses all of its elements and converts everything to simplified collections.
Returns | |
---|---|
A dict of all attributes defined in this classes ATTRIBUTES mapped
to its value. This structure is recursive in that Validated objects
that are referenced by this object and in lists are also converted to
dicts.
|
ToYAML
ToYAML()
Print validated object as simplified YAML.
Returns | |
---|---|
Object as a simplified YAML string compatible with parsing using the
SafeLoader .
|
__eq__
__eq__(
other
)
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__
__ne__(
other
)
Inequality operator.