App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.api.yaml_builder.BuilderHandler Class Reference
Inheritance diagram for google.appengine.api.yaml_builder.BuilderHandler:
google.appengine.api.yaml_listener.EventHandler

Public Member Functions

def __init__
 
def StreamStart
 
def StreamEnd
 
def DocumentStart
 
def DocumentEnd
 
def Alias
 
def Scalar
 
def SequenceStart
 
def SequenceEnd
 
def MappingStart
 
def MappingEnd
 
def GetResults
 
- Public Member Functions inherited from google.appengine.api.yaml_listener.EventHandler
def StreamStart
 
def StreamEnd
 
def DocumentStart
 
def DocumentEnd
 
def Alias
 
def Scalar
 
def SequenceStart
 
def SequenceEnd
 
def MappingStart
 
def MappingEnd
 

Detailed Description

PyYAML event handler used to build objects.

Maintains state information as it receives parse events so that object
nesting is maintained.  Uses provided builder object to construct and
assemble objects as it goes.

As it receives events from the YAML parser, it builds a stack of data
representing structural tokens.  As the scope of documents, mappings
and sequences end, those token, value pairs are popped from the top of
the stack so that the original scope can resume processing.

A special case is made for the _KEY token.  It represents a temporary
value which only occurs inside mappings.  It is immediately popped off
the stack when it's associated value is encountered in the parse stream.
It is necessary to do this because the YAML parser does not combine
key and value information in to a single event.

Constructor & Destructor Documentation

def google.appengine.api.yaml_builder.BuilderHandler.__init__ (   self,
  builder 
)
PyYAML event handler used to build objects.

Maintains state information as it receives parse events so that object
nesting is maintained.  Uses provided builder object to construct and
assemble objects as it goes.

As it receives events from the YAML parser, it builds a stack of data
representing structural tokens.  As the scope of documents, mappings
and sequences end, those token, value pairs are popped from the top of
the stack so that the original scope can resume processing.

A special case is made for the _KEY token.  It represents a temporary
value which only occurs inside mappings.  It is immediately popped off
the stack when it's associated value is encountered in the parse stream.
It is necessary to do this because the YAML parser does not combine
key and value information in to a single event.
Initialization for builder handler.

Args:
  builder: Instance of Builder class.

Raises:
  ListenerConfigurationError when builder is not a Builder class.

Member Function Documentation

def google.appengine.api.yaml_builder.BuilderHandler.Alias (   self,
  event,
  loader 
)
Not implemented yet.

Args:
  event: Ignored.
def google.appengine.api.yaml_builder.BuilderHandler.DocumentEnd (   self,
  event,
  loader 
)
End of document.

Args:
  event: Ignored.
def google.appengine.api.yaml_builder.BuilderHandler.DocumentStart (   self,
  event,
  loader 
)
Build new document.

Pushes new document on to stack.

Args:
  event: Ignored.
def google.appengine.api.yaml_builder.BuilderHandler.GetResults (   self)
Get results of document stream processing.

This method can be invoked after fully parsing the entire YAML file
to retrieve constructed contents of YAML file.  Called after EndStream.

Returns:
  A tuple of all document objects that were parsed from YAML stream.

Raises:
  InternalError if the builder stack is not empty by the end of parsing.
def google.appengine.api.yaml_builder.BuilderHandler.MappingEnd (   self,
  event,
  loader 
)
End of mapping

Args:
  event: Ignored.
  loader: Ignored.
def google.appengine.api.yaml_builder.BuilderHandler.MappingStart (   self,
  event,
  loader 
)
Start of mapping scope.

Create a mapping from builder and then handle in the context of its
parent.

Args:
  event: MappingStartEvent generated by loader.
  loader: Loader that generated event.
def google.appengine.api.yaml_builder.BuilderHandler.Scalar (   self,
  event,
  loader 
)
Handle scalar value

Since scalars are simple values that are passed directly in by the
parser, handle like any value with no additional processing.

Of course, key values will be handles specially.  A key value is recognized
when the top token is _TOKEN_MAPPING.

Args:
  event: Event containing scalar value.
def google.appengine.api.yaml_builder.BuilderHandler.SequenceEnd (   self,
  event,
  loader 
)
End of sequence.

Args:
  event: Ignored
  loader: Ignored.
def google.appengine.api.yaml_builder.BuilderHandler.SequenceStart (   self,
  event,
  loader 
)
Start of sequence scope

Create a new sequence from the builder and then handle in the context
of its parent.

Args:
  event: SequenceStartEvent generated by loader.
  loader: Loader that generated event.
def google.appengine.api.yaml_builder.BuilderHandler.StreamEnd (   self,
  event,
  loader 
)
Cleans up internal state of handler after parsing

Args:
  event: Ignored.
def google.appengine.api.yaml_builder.BuilderHandler.StreamStart (   self,
  event,
  loader 
)
Initializes internal state of handler

Args:
  event: Ignored.

The documentation for this class was generated from the following file: