| |
- Client
- Node
- NodeBuilder
- Server
- Stream
- error
class Client |
|
|
|
- DEBUG(self, txt)
- __init__(self, host, port, namespace, debug=1, log=None)
- _handle_data(self, data)
- XML Parser callback
- _unknown_endtag(self, tag)
- XML Parser callback
- _unknown_starttag(self, tag, attrs)
- XML Parser callback
- connect(self)
- Attempt to connect to specified host
- disconnect(self)
- Close the stream and socket
- disconnected(self)
- Called when a Network Error or disconnection occurs.
Designed to be overidden
- dispatch(self, nodes, depth=0)
- Overide with the method you want to called with
a node structure of a 'protocol element.
- getStreamID(self)
- Returns the streams ID
- log(self, data, inout='')
- Logs data to the specified filehandle. Data is time stamped
and prefixed with inout
- process(self, timeout)
- read(self)
- Reads incoming data. Called by process() so nonblocking
- write(self, data_out='')
- Writes raw outgoing data. blocks
|
class Node |
|
A simple XML DOM like class |
|
- __init__(self, tag='', parent=None, attrs=None)
- __str__(self)
- _xmlnode2str(self, parent=None)
- Returns an xml ( string ) representation of the node
and it children
- getAttr(self, key)
- Get a value for the nodes named attribute.
- getChildren(self)
- Returns a nodes children
- getData(self)
- Return the nodes textual data
- getName(self)
- Set the nodes tag name.
- getNamespace(self)
- Returns the nodes namespace.
- getParent(self)
- return the nodes parent node.
- getTag(self, name)
- Returns a child node with tag name name. Returns None
if not found.
- insertData(self, data)
- Set the nodes textual data
- insertNode(self, node)
- Add a child node to the node
- insertTag(self, name)
- Add a child tag of name 'name' to the node
- insertXML(self, xml_str)
- Add raw xml as a child of the node
- putAttr(self, key, val)
- Add a name/value attribute to the node.
- putData(self, data)
- Set the nodes textual data
- setName(self, val)
- Set the nodes tag name.
- setNamespace(self, namespace)
- Set the nodes namespace.
- setParent(self, node)
- Set the nodes parent node.
|
|