Module author: Sylvain Hellegouarch <sh@defuze.org>
Represents a set of stanzas loaded from cot scripts.
>>> m = CotManager()
>>> m.add_cot_script(path)
>>> for cot in m.stanzas:
>>> for (stanza_id, stanza_type) in cot[0]:
>>> for stanza in cot[0][(stanza_id, stanza_type)]
>>> # do something with the stanza
>>> # send the stanza
Loads a cot script given by path and returns the parsed stanzas as a list of dictionaries.
The dictionnaries have two numeric keys:
The values of the dictionnaries are also dictionaries with keys being tuples (stanza_id, stanza_type). For each key the associated value is a list of bridge.Element instances, each representing a stanza.
Handler sending stanzas parsed from a set of cot scripts.
The handler will register to tha main channel of the bus to:
stanzas have been validated otherwise times out that stanza and send the next one.
bus a cherrypy.lib.process.wspbus.Bus instance.
scripts a list of filenames to parse and read from
timeout duration before an expected sranza is considered to have timed out.
Keeps a reference to the client instance when its session has been created.
Subscribes to the main channel of the bus.