Package parpg :: Module dialogueparsers :: Class AbstractDialogueParser
[hide private]
[frames] | no frames]

Class AbstractDialogueParser

source code

object --+
         |
        AbstractDialogueParser

Abstract base class defining the interface for parsers responsible for constructing a Dialogue from its serialized representation.

Instance Methods [hide private]
 
load(self, stream)
Parse a stream and attempt to construct a new Dialogue instance from its serialized representation.
source code
 
dump(self, dialogue, stream)
Serialize a Dialogue instance and dump it to an open stream.
source code
 
validate(self, stream)
Parse a stream and verify that it contains a valid serialization of a Dialogue instance.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

load(self, stream)

source code 

Parse a stream and attempt to construct a new Dialogue instance from its serialized representation.

Parameters:
  • stream (BufferType) - open stream containing the serialized representation of a Dialogue.

dump(self, dialogue, stream)

source code 

Serialize a Dialogue instance and dump it to an open stream.

Parameters:
  • dialogue (Dialogue) - dialogue to serialize.
  • stream (BufferType) - open stream into which the serialized Dialogue should be dumped.

validate(self, stream)

source code 

Parse a stream and verify that it contains a valid serialization of a Dialogue instance.

Parameters:
  • stream (BufferType) - stream containing the serialized representation of a Dialogue