Module XMLAutomata :: Class CXMLAutomata :: Class __CXMLAutomataLogger
[hide private]
[frames] | no frames]

Class __CXMLAutomataLogger
source code

This Class has methods to write to an XML file the providen automata in the Supremica format.

Instance Methods [hide private]
  __init__(self, output, encoding, name, major, minor)
This constructor writes the header of the XML automata file.
  startAutomaton(self, name, type)
This method writes the header of an automaton in the current file.
  startGroup(self, type)
This method writes the beginning of a generic group in the current file.
  addItem(self, type, attributes)
This method writes a generic XML item in the current file.
  endGroup(self, type)
This method writes the end of a generic group in the current file.
  endAutomaton(self)
This method writes the end of an automaton in the current file.
  endAutomata(self)
This method writes the end tag of the current automata.

Method Details [hide private]

__init__(self, output, encoding, name, major, minor)
(Constructor)

source code 

This constructor writes the header of the XML automata file.

Set up a logger object, which takes SAX events and outputs an XML log file.
Parameters:
  • output (string) - the filename where to perform all the writing operations
  • encoding (string) - the used encoding format
  • name (string) - the name of the automata
  • major (string) - used in the XML Supremica format
  • minor (string) - used in the XML Supremica format
Returns:
void

startAutomaton(self, name, type)

source code 
This method writes the header of an automaton in the current file.
Parameters:
  • name (string) - the name of the automaton
  • type (string) - the type of the automaton. Plant, Specification and Supervisor are supported by Supremica.
Returns:
void

startGroup(self, type)

source code 
This method writes the beginning of a generic group in the current file.
Parameters:
  • type (string) - the type of the group. Events, States and Transitions are supported by Supremica.
Returns:
void

addItem(self, type, attributes)

source code 
This method writes a generic XML item in the current file.
Parameters:
  • type (string) - the type of the item. Events, States and Transitions are supported by Supremica.
  • attributes (dictionary of attributes) - this dictionary specifies the attributes of the item
    >>> #Example:
    >>> ['controllable']:'false'
Returns:
void

endGroup(self, type)

source code 
This method writes the end of a generic group in the current file.
Parameters:
  • type (string) - the type of the group. Events, States and Transitions are supported by Supremica.
Returns:
void

endAutomaton(self)

source code 
This method writes the end of an automaton in the current file.
Parameters:
  • name (string) - the name of the automaton
  • type (string) - the type of the automaton. Plant, Specification and Supervisor are supported by Supremica.
Returns:
void

endAutomata(self)

source code 
This method writes the end tag of the current automata. It closes moreover the logger document.
Returns:
void