|
|
Class_basexmpp
Class documentation for basexmpp
Introduction
xmlstream -> basexmpp
Class Methods
__init__(self) getNewId(self)
Returns a new Id for use in Iq requests.
getId(self)
Returns the current Id.
makeIq(self, id=0)
Build an Element for an iq request.
- id: The id to use for the request. If id == 0 a new id is generated.
makeIqGet(self, queryxmlns = None)
Build an Element for an iq request of type 'get'.
- queryxmlns: The XML namespace to query, if any.
makeIqResult(self, id)
Build an Element for an iq response.
- id: The request we are responding to.
makeIqSet(self, sub=None)
Build an Element for an iq request of type 'set'.
- sub: Element subtree to append.
makeIqQuery(self, iq, xmlns)
Build an Element for an iq query.
- iq: An iq Element.
- xmlns: The namespace of the query.
makeQueryRoster(self, iq=None)
Builds an Element for a roster query.
- iq: An iq to place the request under. Otherwise returns the query element.
add_event_handler(self, name, pointer, threaded=False, disposable=False)
Adds a handler for the named event.
- name: The name of the event. See Events for a list.
- pointer: A pointer to a function to call, it should accept 2 arguments.
- threaded: If True run the call in a new thread.
- disposable: If True the event handler is removed from the list of handlers after it is called for the first time.
event(self, name, eventdata = {})
Calls the event handlers for the named event.
- name: The name of the event.
- eventdata: A dictionary of information about the event. See Events.
makeMessage(self, mto, mbody, msubject=None, mtype=None)
Make a message Element.
- mto: The 'to' attribute.
- mbody: The body of the message.
- msubject: The message subject, if any.
- mtype: The message type. Defaults to 'chat'.
makePresence(self, pshow=None, pstatus=None, ppriority=None, pto=None, ptype=None)
Make a presence Element.
- pshow: How to show the status.
- pstatus: The status message.
- ppriority: The presence priority.
- pto: Sends a directed priority, the 'to' attribute.
- ptype: The 'type' attribute.
sendMessage(self, mto, mbody, msubject=None, mtype=None)
Makes and sends a message.
- mto: The 'to' attribute.
- mbody: The body of the message.
- msubject: The message subject, if any.
- mtype: The message type. Defaults to 'chat'.
sendPresence(self, pshow=None, pstatus=None, ppriority=None, pto=None)
Make and send a presence.
- pshow: How to show the status.
- pstatus: The status message.
- ppriority: The presence priority.
- pto: Sends a directed priority, the 'to' attribute.
- ptype: The 'type' attribute.
getjidresource(self, fulljid)
Returns the resource from fulljid.
getjidbare(self, fulljid)
Returns the non-resource part of fulljid
Sign in to add a comment
