xmpppy-0.4.1/0002755000175000000500000000000010731032124011677 5ustar normansrcxmpppy-0.4.1/doc/0002755000175000000500000000000010731037546012461 5ustar normansrcxmpppy-0.4.1/doc/xmpppy-guide/0002755000175000000500000000000010512362040015074 5ustar normansrcxmpppy-0.4.1/doc/xmpppy-guide/index.html0000644000175000000500000006407710512361202017104 0ustar normansrc xmpppy: a practical guide

xmpppy: a practical guide

Sebastian Moors

07.10.2006


Version 0.02b





http://xmpppy-guide.berlios.de/


Contents

Introduction

Motivation

This tutorial was started because there was a need for a small xmpppy-tutorial fitting the gap between the small examples and the bare api specs. The small examples distributed with it are fine, but when you're building you're own bot and fiddling around with things like rostermanagement, you wish that there's something between the bare API-Specs and the small examples. So i decided to write down my experiences and publish them..
This paper should help you to get started and covers the basic issues of programming with xmpppy. If you want to programm a bot, you will find some hints in the last chapters. I assume that you have already python knowledge, python basics are not covered by this tutorial.

Furthermore no Jabber specific terms (such as "jid") will be explained here. Please use google to clarify this things.

This tutorial was written for a linux audience. I don't know if xmpppy works on Windows or *nix, so you've got to solve os-dependend problems by yourself.

If you like to contribute to this document or found a bug feel free to contact me.

Mail: smoors@users.berlios.de

What's so cool about jabber ?

Jabber/xmpp is an Open Source instant messaging protocol. It is described in the RFCs 3920 - 3923 and is based on XML. A lot of Open Source and even commercial servers, clients and libraries are available. It has several advanced features such as encryption and conferences. Jabber beats ICQ and other protocols because the closed protocols are changing often and the libraries have to deal with that fact. Informations about these protocols are often the result of reverse engineering. This work has to be done every time the protocol changes. As you might know, this is a great problem for small software projects..

Why xmpppy ?

I used xmpppy because it was available as a debian package and it's small. The design of xmpppy was exactly the thing i was looking for. There are high level functions for sending messages, but you can also build your messages as xml-strings if you wish to or if you need special features.
xmpppy is the inofficial successor of jabber.py, which i used before. The jabber.py project is dead now, so i migrated to xmpppy, which inherited some code from jabber.py and has a similar API.
If you're interested in other libraries, have a look at http://www.jabber.org.

Existing documentation

Before you start with this tutorial you should gather informations about xmpppy and jabber. You will need the API-Overview which is available at the project homepage. There are also some example programs available. The examples in this book are mainly based on these online examples.

Spend some time on the jabber.org or ask the wikipedia. If you're not new to this things, skip this..

For the best available documentation on jabber in general you should take a look at the RFCs. They're easier to read than you might expect and contain a lot of useful informations.

If you look for a concrete implementation of something, have a look at the projects using xmpppy under "Resources".

If you want to get in contact with the xmpppy developers or just want to keep track of the current development, join the xmpppy-devel mailing list at https://lists.sourceforge.net/lists/listinfo/xmpppy-devel.

License

This work is licensed under the creative commons license Attribution-NonCommercial 2.5. You can obtain it at http://creativecommons.org/licenses/by-nc/2.5/

Examples

All example scripts used in this tutorial can be obtained from the projects homepage ( http://xmpppy-guide.berlios.de).

If you copy and paste code from the tutorial, remember that the line numbers are not used in python and are only used for referencing.

Installation

Use the package-management tool of your distribution to determine if a xmpppy package exists. If there are no adequate packages or if you want the newest version, you have to build the software from the sources.
Get the newest tarball from the download page at the project's homepage (http://xmpppy.sourceforge.net) and extract it (The filenames and URLs are examples)

wget http://optusnet.dl.sourceforge.net/sourceforge/xmpppy/xmpppy-0.3.1.tar.gz
tar xzf xmpppy-0.3.1.tar.gz
cd xmpppy-0.3.1
python setup.py install
If you need more informations, have a look at the README file distributed with xmpppy.

Prerequisites

Before we start with coding, you should check some preconditions. An important thing is the right jabber client. I would therefore recommend the use of psi. Psi is a feature-rich jabber-only client. It supports service browsing and it implements the most features as described in the RFC. Especially the group chat support is better implemented than in the most other clients.
Of course you can use a mutliprotocol client like Gaim or kopete too, but they implement some things on a different way.. For example gaim makes no difference between the multiple message types (chat, message..).

If you want to develop something with groupchat, you may want to setup your own jabber server. This may be recommended if you're new to xmpppy and you don't know exactly what you're doing. Think about the possibility of disturbing other people or - in the worst case - killing a server. If your bot gets out of control and sends every 10ms a message to the server, the server admin might be a little bit disgusted of your public beta testing. So keep in mind that there are other people (and of course bots) out there while your bot uses a public server.

Furthermore i assume that you have already registered a jabber account.

If you're completely new to jabber, you should read something about the underlying techniques such as XML-Streams. A good starting point is the xmpp-core RFC.

Basic concepts

Sending messages

And now for something completely different. Every tutorial on programming starts with a tiny "Hello World" program, so why break with this tradition. Our program connects to a jabber server, authenticates itself with a username/password combination and sends a "Hello World!" message to a specified jid. It doesn't make much sense, but its a good start. Maybe you can use it in shell scripts or something..

01  #!/usr/bin/python
02  import sys,os,xmpp
03  
04  msg="Hello World!"
05  jid="user@domain.tld"
06  pwd="secret"
07  
08  recipient="destination@domain.tld"
09  
10  jid=xmpp.protocol.JID(jid)
11  
12  cl=xmpp.Client(jid.getDomain(),debug=[])
13  	
14  cl.connect()
15  
16  cl.auth(jid.getNode(),pwd)
17  
18  cl.send(xmpp.protocol.Message(recipient,msg))
19  
20  cl.disconnect()

Connecting to the server

The first thing to do in every jabber session is to connect to your jabber server. Line 11 shows you how to do this. xmpp.Client() returns a Client instance, which is our basic object. You can think of the client-object as your connection to the server. If your server uses an unusual port, you can pass it to the xmpp.Client constructor. Its signature is: xmpp.Client(server,port,debug).

The most work happens in Line 13 and 15. We're connecting to the server and trying to authenticate. That means the server just checks if our password is correct. jid.getNode() returns everything before the "@" in your jid.

Line 17 finally does the magic: It sends a message (with content msg) to recipient. After that, we should disconnect from the server to make a gracefull exit.

Messages and message types

You may have noticed that message you received from that script was shown to you on a different way than normal chat messages. If you use a pure jabber client like psi, which is very near to the jabber standart, the message might be shown like an email or something. That is because the xmpp protocol defines multiple message types. Less xmpp-compliant messengers like kopete make no difference between them.

RFC 3921 2.1.1 defines 5 message types: chat,error,groupchat,headline and normal. For detailed informations see http://www.apps.ietf.org/rfc/rfc3921.html.
At this time we want to focus on 'chat' and 'normal'. In our example above, we did not define any message type, so psi interprets this as "normal". "normal" is described as a single message, without history. I suppose you want to change that behaviour to 'chat' messages, so we have to set the type explicitly. Now switch to the API and look after the methods of xmpp.Protocol. You'll discover a method called setType. That sounds suitable, eh? Change line 17 to:

cl.send(xmpp.protocol.Message(recipient,msg,"chat"))

Receiving messages

Receiving messages is a little bit more complicated than sending messages. You need an event loop and an handler to do this.
Message handlers are a basic concept for acting on events. This means that you have to tell the xmpp.Client Object which method it should call if a message arrives. But first of all explanations, have a look at the code:

01  #!/usr/bin/python
02  import sys
03  import xmpp
04  import os
05  import signal
06  import time
07  
08  def messageCB(conn,msg):
09  	print "Sender: " + str(msg.getFrom())
10  	print "Content: " + str(msg.getBody())
11  	print msg
12  
13  
14  def StepOn(conn):
15  	try:
16          	conn.Process(1)
17  	except KeyboardInterrupt:
18  		return 0
19  	return 1
20  
21  def GoOn(conn):
22  	while StepOn(conn):
23  		pass
24  
25  def main():
26  
27  	jid="user@domain.tld"
28  	pwd="secret"
29  
30  	jid=xmpp.protocol.JID(jid)
31  
32  	cl = xmpp.Client(jid.getDomain(), debug=[])
33  
34  	cl.connect()
35  
36  	cl.auth(jid,pwd)
37  
38  	cl.RegisterHandler('message', messageCB)
39  
40  	#cl.sendInitPresence()
41  
42  	GoOn(cl)
43  
44  main()
We should focus on the main() method to understand how everything works. The most code should appear familiar to you. Line 37 holds one new method:
	RegisterHandler('message', messageCB)
As you may have already guessed, the method "messageCB" is registered as a callback handler for incoming messages. So if you want to react an incoming messages, write a method called "messageCB" (as in line 8) and place your message-handling code here. Be sure that your method takes 2 parameters. The first parameter is the connection.The second parameter an x.protocol.Message instance. It is printed on your terminal if a message arrives. Search the API-Docs for it and experiment with the given methods gather experience. Maybe you could combine it with the example from Chapter 1 to react on certain messages.

If this example doesn't work for you, uncomment line 38. cl.sendInitPresence() tells our server that we're online. Some servers (for example Google's gtalk service) won't send messages to you if you're not marked as 'online'. A detailed look on presence handling is given in the next chapter.

Setting the resource

The resource of a jid is a nice jabber feature. With the use of different resources, a jid can be logged into a server server several times. This means you can be online with more then one client at the same time. Setting the jid is a very simple thing: A third argument has to be passed to the auth() method. So the authentication step may look like this:

cl.auth(jid.getNode(),pwd,"laptop")

Handling presence events

Simple presence handling

Presence events are those messages which contain informations about your status and subscription. You may have wondered why our bot from example 2 wasn't shown as "online" in your contact list. This was because we didn't notify the server that the bot is online. This could be done by "sendInitPresence()". Go back to example 2 and uncomment the appropriate line. If the bot is in your roster, he will be marked as "online".

The next thing about presence covers subscription. "subscription" in generally means: "Allow somebody to see if you're online and allow him to add you to his roster". To handle this events, we have to register a presence handler. This is done on the same way as the message handler in example 2.

01  #!/usr/bin/python
02  import sys
03  import xmpp
04  import os
05  import signal
06  import time
07  
08  def presenceCB(conn,msg):
09  	print str(msg)
10  	prs_type=msg.getType()
11  	who=msg.getFrom()
12  	if prs_type == "subscribe":
13  		conn.send(xmpp.Presence(to=who, typ = 'subscribed'))
14  		conn.send(xmpp.Presence(to=who, typ = 'subscribe'))
15  
16  
17  def StepOn(conn):
18      try:
19          conn.Process(1)
20      except KeyboardInterrupt:
21  	    return 0
22      return 1
23  
24  def GoOn(conn):
25      while StepOn(conn):
26  	    pass
27  
28  
29  def main():
30  	jid="user@domain.tld"
31  	pwd="sectret"
32  
33  	jid=xmpp.protocol.JID(jid)
34  
35  	cl = xmpp.Client(jid.getDomain(), debug=[])
36  
37  	cl.connect()
38  
39  	cl.auth(jid.getNode(),pwd)
40  
41  
42  	cl.RegisterHandler('presence', presenceCB)
43  	cl.sendInitPresence()
44  
45  	GoOn(cl)
46  
47  main()
This is the most simple presence handler. When you receive a message containing "subscribe", return a "subscribed" answer and ask him for subscription. That means subscribing everyone who asks. You can imagine that this is not the right thing for real world applications. I prefer limits like a maximal roster size and a policy to add users to the roster. This may differ for your bot..
Think about who should be able to use your bot and block everyone else.

Retrieving the status

Many applications need the status of an user. They want to know if he's online or offline or maybe only away. This is not as easy as it seems. There's no direct way to get the Status of a given jid. You have to analyse the presence messages the oponnents send. If a user gets online or if you go online, everyone who has subscribed to you will send a presence message. Of course this works only if the user is online. If a user logs out, he sends you a presence message with the Status "Logged out". Everytime he changes his status, you will receive a corresponding status message. My workaround for the problem: keep track of the actual status with a dictionary. Take the jid as the key and set their value if you receive a presence message for the jid.

If you know a better way to do this, please contact me !

Roster management

The roster is the jabber synonym for the better known term "contact list". You can easily fetch, add or remove entries. In the most cases you won't have to deal with this, because the most actions are done automatically. For example if you subscribe to someones presence, he will be added to your roster. A common example for a manual use of roster functions is to retrieve the jids contained in your roster.

Therefore xmpppy offers you a higher level class to operate on rosters: x.roster.Roster
The class should be self-explanatory if you have a look at
http://xmpppy.sourceforge.net/apidocs/public/x.roster.Roster-class.html.

Disconnect handling

A lot of applications are acting on disconnects. This could happen if your jabber server crashes or if you have lost your internet connection. The action may differ, but a possible action would be displaying a message and reconnect.. To act on disconnects, add a disconnect-handler. This is done analogical to the known event handlers. Write a function DisconnectHandler(self) and register it via RegisterDisconnectHandler(self, DisconnectHandler).

Advanced concepts

Groupchat

I suppose most of you have experiences with many-to-many chats like IRC. Jabber has its own many-to-many chat which is implement by two protocols: groupchat 1.0 and multi user chat (MUC). The MUC protocol is based on groupchat and allows a lot of advanced features like user privileges and passwort-protected rooms. Because of the simple implementation groupchat will focused here. If you need MUC, have a look at http://www.jabber.org/jeps/jep-0045.html.

Using groupchat 1.0 is very easy because it is based on presence messages. First we have to think about what we want to do. Let's imagine that we want to join the room "castle_anthrax" with the nickname "zoot". The server is called "conference.holy-gra.il". To enter a room, the only thing to do is sending a presence message with the room and your nickname to your conference server.
To speak in python:

room = "castle_anthrax@conference.holy-gra.il/zoot"
cl.send(xmpp.Presence(to=room))
Of course it could happen that someone in this room has already chosen the nickname "zoot". This will cause an error 409 ("Conflict") and we have to try another nickname.
If nobody named "zoot" is in there, we'll receive a presence message from everybody in that room (including yourself). The "from" attribut of the message looks like this: castle_anthrax@conference.holy-gra.il/galahad, which means that somebody named galahad is already in this room.This might be interesting for you if you write a jabber client and you have to keep track of the nicks in the room.
Receiving messages is divided in 2 parts. If someone sends a public message, you'll receive a message with the type "groupchat".This message will be sent to every user in that room.A private message is send as a chat type message.
Sending message is as easy as receiving messages. Just send a groupchat message to the room-jid or send a chat message to a room-member, if you like some private chit-chat..

The following example is based on recv.py, the script used in chapter 2: receiving messages.

01  #!/usr/bin/python
02  import sys
03  import xmpp
04  import os
05  import signal
06  import time
07  
08  def messageCB(conn,msg):
09  	if msg.getType() == "groupchat":
10  		print str(msg.getFrom()) +": "+  str(msg.getBody())
11  	if msg.getType() == "chat":
12  		print "private: " + str(msg.getFrom()) +  ":" +str(msg.getBody())
13  
14  def presenceCB(conn,msg):
15  	print msg
16  
17  
18  
19  
20  def StepOn(conn):
21      try:
22          conn.Process(1)
23      except KeyboardInterrupt:
24  	    return 0
25      return 1
26  
27  def GoOn(conn):
28      while StepOn(conn):
29  	    pass
30  
31  
32  def main():
33  
34  	jid="user@domain.tld"
35  	pwd="secret"
36  
37  	jid=xmpp.protocol.JID(jid)
38  
39  	cl = xmpp.Client(jid.getDomain(), debug=[])
40  
41  	cl.connect()
42  
43  	cl.auth(jid.getNode(),pwd)
44  
45  
46  	cl.sendInitPresence()
47  
48  	cl.RegisterHandler('message', messageCB)
49  
50  	room = "castle_anthrax@conference.holy-gra.il/zoot"
51  	print "Joining " + room
52  
53  	cl.send(xmpp.Presence(to=room))
54  
55  
56  	GoOn(cl)
57  
58  main()
59  
60  
61

Something about Knigge

If you don't know Knigge, see http://en.wikipedia.org/wiki/Knigge.
His main work is a book called "Ueber den Umgang mit Menschen" ("On Human Relations").
As it appears clear that there are (social) rules for human relation, not everybody knows that there a rules for bot communication too.

As i already noted in chapter 3, developing bots is more than a technical thing. You should consider that you are responsible for your bot. Imagine you got something wrong and your bot is crashing his server by sending messages every millisecond. That's not a great deal if you use a dedicated server for testing, but that's unusual.

The following hints are loosely based on the rules given by
http://web.swissjabber.chindex.php/Regeln_zum_Betrieb_von_Bots_und_Robots. As a result of abuse by out-of-control bots, some server admins ban every bot which is not written with the following rules in mind:

Resources

Websites

xmpppy homepage: http://xmpppy.sourceforge.net
Jabber foundation: http://jabber.org

RFC 3920: xmpp core http://www.ietf.org/rfc/rfc3920.txt
RFC 3921: IM and presence http://www.ietf.org/rfc/rfc3921.txt
RFC 3922: CPIM http://www.ietf.org/rfc/rfc3922.txt
RFC 3923: End2End signing and Object Encryption http://www.ietf.org/rfc/rfc3923.txt

Python central: http://python.org
psi client: http://psi-im.org/

Books

Adams,DJ: Programming jabber http://www.oreilly.com/catalog/jabber/

Projects using xmpppy

Gajim http://www.gajim.org/

xmpppy-0.4.1/doc/xmpppy-guide/README0000644000175000000500000000126010512362040015751 0ustar normansrcThis document was imported with from http://developer.berlios.de/projects/xmpppy-guide/ Very minor changes were applied after converting it with latex2html Author is Sebastian Moors License is unknown but Sebastian Moors explicitly allowed me to include this document into 0.4 release: ======================================== From: Sebastian Moors sebastian dot moors at googlemail dot com To: xmpppy-devel at lists dot sourceforge dot net Date: Wed, 4 Oct 2006 09:39:12 +0200 > BTW - can we include this document into upcoming 0.4 release of xmpppy? I.e. > put it into tarball? Of course, that would be great. ======================================== -- Alexey Nezhdanov 2006.10.09 xmpppy-0.4.1/doc/advanced.html0000644000175000000500000001175510163471171015116 0ustar normansrc Xmpppy usage - advanced.

Introduction

To write a programs using XMPP technology you must understand the basic principles of it. Xmpppy uses it's own implementation of XML handling procedures - so you should get used to it. Though it is simple enough I hope.

Node class
prototype
Node.__init__(name='', attrs={}, payload=[], parent=None, node=None)
Note that 'name' argument really consists of namespace and node name, space separated. Example:
node=Node('jabber:client message', attrs={'to':'target@jid.com'},payload=[Node('body',payload=['Hello target!'])])
or
node=Node('jabber:client message')
node['to']='target@jid.com'
node.NT.body='Hello target!'
NT stands for 'New Tag' and explicitly adds new child to the current node. Also the T can be used. That means "find Tag" but if tag exists it acts just like NT otherwise.
Protocol class
Uses similar syntax. We will use 'node' attribute now:
prototype
Protocol.__init__(name=None, to=None, typ=None, frm=None, attrs={}, payload=[], timestamp=None, xmlns='jabber:client', node=None)
example
p=Protocol(node=node)
or
proto=Protocol('message',to='target@jid.com',payload=[Node('body',payload=['Hello target!'])])
or
proto=Protocol('message',to='target@jid.com')
proto.NT.body='Hello target!'
Message class
Similar syntax:
prototype
Message.__init__(to=None, body=None, typ=None, subject=None, attrs={}, frm=None, payload=[], timestamp=None, xmlns='jabber:client', node=None)
example
m=Message(node=proto)
or
m=Message('target@jid.com','Hello target!')
Iq class
Similar syntax:
prototype
Iq.__init__(typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns='jabber:client', node=None)
example
iq=Iq('set',NS_AUTH,payload=[Node('username',payload=['user']),Node('password',payload=['secret'])])
or
iq=Iq('set',NS_AUTH)
iq.T.query.NT.username='user'
iq.T.query.NT.password='secret'
or
iq=Iq('set',NS_AUTH)
iq.T.query.T.username='user'
iq.T.query.T.password='secret'
As I already noted - 'T' acts just like 'NT' if tag doesn't exists.
Presence class
Similar syntax:
prototype
Presence.__init__(to=None, typ=None, priority=None, show=None, status=None, attrs={}, frm=None, timestamp=None, payload=[], xmlns='jabber:client', node=None)
example
pres=Presence(priority=5, show='xa',status="I'm away from my computer")
or
pres=Presence()
pres.setPriority(5) pres.setShow('xa') pres.setStatus("I'm away from my computer") pres.setTimestamp() or
pres=Presence()
pres.T.priority=5 pres.T.show='xa' pres.T.status="I'm away from my computer" pres.setTimestamp()
xmpppy-0.4.1/doc/basic.html0000644000175000000500000001051410163471172014423 0ustar normansrc Xmpppy usage - basics.

Preface.

English is not my native language. If you see any bugs in this text, please, let me know.

Basic

Introduction.

This documents topic is for people who want to quickly try xmpppy for a simple task, like writing a command-line script for sending a single message.

Writing a simple script

This example demonstrates a simple script that sends message to one recipient. Example:

xsend test@jabber.org Hello there!

You don't have a similar tool in your toolkit? Using the xmpppy library it can be created easily.
What? Already have one? Hmm. Maybe you want to simplify things a bit, or just curious how to do it one more way? Anyway - let's start now!
First - we declare ourself as a python script and importing needed modules:

#!/usr/bin/python
import sys,os,xmpp

After it we have to check if we have enough arguments on the command-line:

if len(sys.argv) < 2:
    print "Syntax: xsend JID text"
    sys.exit(0)

After it we must decode arguments. Omitting all checks to simplify our script:

tojid=sys.argv[1]
text=' '.join(sys.argv[2:])

One more non-jabber step: We have to to get our Jabber ID and login details. Presuming that all info stored in ~/.xsend file:

jidparams={}
if os.access(os.environ['HOME']+'/.xsend',os.R_OK):
    for ln in open(os.environ['HOME']+'/.xsend').readlines():
        key,val=ln.strip().split('=',1)
        jidparams[key.lower()]=val
for mandatory in ['jid','password']:
    if mandatory not in jidparams.keys():
        open(os.environ['HOME']+'/.xsend','w').write('#JID=romeo@montague.net\n#PASSWORD=juliet\n')
        print 'Please ensure the ~/.xsend file has valid JID for sending messages.'
        sys.exit(0)

Phew! The most complex (non-jabber ;) ) part is finished. From now on we have to:

Let's start:
0. To connect we must have a client instance. Calculating our server name and creating Client class instance for it:

jid=xmpp.protocol.JID(jidparams['jid'])
cl=xmpp.Client(jid.getDomain(),debug=[])

1. Connect and authenticate with credentials from the config file.

cl.connect()
cl.auth(jid.getNode(),jidparams['password'])

2. We can go online now (by sending the inital presence) but will not do that, as it is not nessessary for sending a message. So we send a message now!

#cl.sendInitialPresence()
cl.send(xmpp.protocol.Message(tojid,text))

We're done! The session must now be closed but since we have not registered disconnect handler we will just leave it to python and TCP/IP layer. All jabber servers that I know handle such disconnects correctly.
You can download this script here.

What now?

If you were impressed of how the things were done with xmpppy, you may be interested in more thorough examination of xmpppy library. The "advanced" and "expert" parts of this document are here to help you.
"Advanced" (isn't writed yet) part is much like another tutorial and describing common principles of XMPP usage via xmpppy prism. It describes ideas that are the foundation of XML handling with the simplexml library, the essence of dispatcher's work and how messages are processed, and some guidelines to write more complex programs and uses of the library.
"Expert" part is full library API description documentation. This is epydoc generated output - all info is taken from the xmpppy code so you can re-generate it at any time.

xmpppy-0.4.1/doc/apidocs/0002755000175000000500000000000010731034076014076 5ustar normansrcxmpppy-0.4.1/doc/apidocs/epydoc.css0000644000175000000500000003643010731034035016072 0ustar normansrc /* Epydoc CSS Stylesheet * * This stylesheet can be used to customize the appearance of epydoc's * HTML output. * */ /* Default Colors & Styles * - Set the default foreground & background color with 'body'; and * link colors with 'a:link' and 'a:visited'. * - Use bold for decision list terms. * - The heading styles defined here are used for headings *within* * docstring descriptions. All headings used by epydoc itself use * either class='epydoc' or class='toc' (CSS styles for both * defined below). */ body { background: #ffffff; color: #000000; } a:link { color: #0000ff; } a:visited { color: #204080; } dt { font-weight: bold; } h1 { font-size: +140%; font-style: italic; font-weight: bold; } h2 { font-size: +125%; font-style: italic; font-weight: bold; } h3 { font-size: +110%; font-style: italic; font-weight: normal; } code { font-size: 100%; } /* Page Header & Footer * - The standard page header consists of a navigation bar (with * pointers to standard pages such as 'home' and 'trees'); a * breadcrumbs list, which can be used to navigate to containing * classes or modules; options links, to show/hide private * variables and to show/hide frames; and a page title (using *

). The page title may be followed by a link to the * corresponding source code (using 'span.codelink'). * - The footer consists of a navigation bar, a timestamp, and a * pointer to epydoc's homepage. */ h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; } h2.epydoc { font-size: +130%; font-weight: bold; } h3.epydoc { font-size: +115%; font-weight: bold; } td h3.epydoc { font-size: +115%; font-weight: bold; margin-bottom: 0; } table.navbar { background: #a0c0ff; color: #000000; border: 2px groove #c0d0d0; } table.navbar table { color: #000000; } th.navbar-select { background: #70b0ff; color: #000000; } table.navbar a { text-decoration: none; } table.navbar a:link { color: #0000ff; } table.navbar a:visited { color: #204080; } span.breadcrumbs { font-size: 85%; font-weight: bold; } span.options { font-size: 70%; } span.codelink { font-size: 85%; } td.footer { font-size: 85%; } /* Table Headers * - Each summary table and details section begins with a 'header' * row. This row contains a section title (marked by * 'span.table-header') as well as a show/hide private link * (marked by 'span.options', defined above). * - Summary tables that contain user-defined groups mark those * groups using 'group header' rows. */ td.table-header { background: #70b0ff; color: #000000; border: 1px solid #608090; } td.table-header table { color: #000000; } td.table-header table a:link { color: #0000ff; } td.table-header table a:visited { color: #204080; } span.table-header { font-size: 120%; font-weight: bold; } th.group-header { background: #c0e0f8; color: #000000; text-align: left; font-style: italic; font-size: 115%; border: 1px solid #608090; } /* Summary Tables (functions, variables, etc) * - Each object is described by a single row of the table with * two cells. The left cell gives the object's type, and is * marked with 'code.summary-type'. The right cell gives the * object's name and a summary description. * - CSS styles for the table's header and group headers are * defined above, under 'Table Headers' */ table.summary { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; margin-bottom: 0.5em; } td.summary { border: 1px solid #608090; } code.summary-type { font-size: 85%; } table.summary a:link { color: #0000ff; } table.summary a:visited { color: #204080; } /* Details Tables (functions, variables, etc) * - Each object is described in its own div. * - A single-row summary table w/ table-header is used as * a header for each details section (CSS style for table-header * is defined above, under 'Table Headers'). */ table.details { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; margin: .2em 0 0 0; } table.details table { color: #000000; } table.details a:link { color: #0000ff; } table.details a:visited { color: #204080; } /* Fields */ dl.fields { margin-left: 2em; margin-top: 1em; margin-bottom: 1em; } dl.fields dd ul { margin-left: 0em; padding-left: 0em; } div.fields { margin-left: 2em; } div.fields p { margin-bottom: 0.5em; } /* Index tables (identifier index, term index, etc) * - link-index is used for indices containing lists of links * (namely, the identifier index & term index). * - index-where is used in link indices for the text indicating * the container/source for each link. * - metadata-index is used for indices containing metadata * extracted from fields (namely, the bug index & todo index). */ table.link-index { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; } td.link-index { border-width: 0px; } table.link-index a:link { color: #0000ff; } table.link-index a:visited { color: #204080; } span.index-where { font-size: 70%; } table.metadata-index { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; margin: .2em 0 0 0; } td.metadata-index { border-width: 1px; border-style: solid; } table.metadata-index a:link { color: #0000ff; } table.metadata-index a:visited { color: #204080; } /* Function signatures * - sig* is used for the signature in the details section. * - .summary-sig* is used for the signature in the summary * table, and when listing property accessor functions. * */ .sig-name { color: #006080; } .sig-arg { color: #008060; } .sig-default { color: #602000; } .summary-sig { font-family: monospace; } .summary-sig-name { color: #006080; font-weight: bold; } table.summary a.summary-sig-name:link { color: #006080; font-weight: bold; } table.summary a.summary-sig-name:visited { color: #006080; font-weight: bold; } .summary-sig-arg { color: #006040; } .summary-sig-default { color: #501800; } /* To render variables, classes etc. like functions */ table.summary .summary-name { color: #006080; font-weight: bold; font-family: monospace; } table.summary a.summary-name:link { color: #006080; font-weight: bold; font-family: monospace; } table.summary a.summary-name:visited { color: #006080; font-weight: bold; font-family: monospace; } /* Variable values * - In the 'variable details' sections, each varaible's value is * listed in a 'pre.variable' box. The width of this box is * restricted to 80 chars; if the value's repr is longer than * this it will be wrapped, using a backslash marked with * class 'variable-linewrap'. If the value's repr is longer * than 3 lines, the rest will be ellided; and an ellipsis * marker ('...' marked with 'variable-ellipsis') will be used. * - If the value is a string, its quote marks will be marked * with 'variable-quote'. * - If the variable is a regexp, it is syntax-highlighted using * the re* CSS classes. */ pre.variable { padding: .5em; margin: 0; background: #dce4ec; color: #000000; border: 1px solid #708890; } .variable-linewrap { color: #604000; font-weight: bold; } .variable-ellipsis { color: #604000; font-weight: bold; } .variable-quote { color: #604000; font-weight: bold; } .variable-group { color: #008000; font-weight: bold; } .variable-op { color: #604000; font-weight: bold; } .variable-string { color: #006030; } .variable-unknown { color: #a00000; font-weight: bold; } .re { color: #000000; } .re-char { color: #006030; } .re-op { color: #600000; } .re-group { color: #003060; } .re-ref { color: #404040; } /* Base tree * - Used by class pages to display the base class hierarchy. */ pre.base-tree { font-size: 80%; margin: 0; } /* Frames-based table of contents headers * - Consists of two frames: one for selecting modules; and * the other listing the contents of the selected module. * - h1.toc is used for each frame's heading * - h2.toc is used for subheadings within each frame. */ h1.toc { text-align: center; font-size: 105%; margin: 0; font-weight: bold; padding: 0; } h2.toc { font-size: 100%; font-weight: bold; margin: 0.5em 0 0 -0.3em; } /* Syntax Highlighting for Source Code * - doctest examples are displayed in a 'pre.py-doctest' block. * If the example is in a details table entry, then it will use * the colors specified by the 'table pre.py-doctest' line. * - Source code listings are displayed in a 'pre.py-src' block. * Each line is marked with 'span.py-line' (used to draw a line * down the left margin, separating the code from the line * numbers). Line numbers are displayed with 'span.py-lineno'. * The expand/collapse block toggle button is displayed with * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not * modify the font size of the text.) * - If a source code page is opened with an anchor, then the * corresponding code block will be highlighted. The code * block's header is highlighted with 'py-highlight-hdr'; and * the code block's body is highlighted with 'py-highlight'. * - The remaining py-* classes are used to perform syntax * highlighting (py-string for string literals, py-name for names, * etc.) */ pre.py-doctest { padding: .5em; margin: 1em; background: #e8f0f8; color: #000000; border: 1px solid #708890; } table pre.py-doctest { background: #dce4ec; color: #000000; } pre.py-src { border: 2px solid #000000; background: #f0f0f0; color: #000000; } .py-line { border-left: 2px solid #000000; margin-left: .2em; padding-left: .4em; } .py-lineno { font-style: italic; font-size: 90%; padding-left: .5em; } a.py-toggle { text-decoration: none; } div.py-highlight-hdr { border-top: 2px solid #000000; border-bottom: 2px solid #000000; background: #d8e8e8; } div.py-highlight { border-bottom: 2px solid #000000; background: #d0e0e0; } .py-prompt { color: #005050; font-weight: bold;} .py-more { color: #005050; font-weight: bold;} .py-string { color: #006030; } .py-comment { color: #003060; } .py-keyword { color: #600000; } .py-output { color: #404040; } .py-name { color: #000050; } .py-name:link { color: #000050 !important; } .py-name:visited { color: #000050 !important; } .py-number { color: #005000; } .py-defname { color: #000060; font-weight: bold; } .py-def-name { color: #000060; font-weight: bold; } .py-base-class { color: #000060; } .py-param { color: #000060; } .py-docstring { color: #006030; } .py-decorator { color: #804020; } /* Use this if you don't want links to names underlined: */ /*a.py-name { text-decoration: none; }*/ /* Graphs & Diagrams * - These CSS styles are used for graphs & diagrams generated using * Graphviz dot. 'img.graph-without-title' is used for bare * diagrams (to remove the border created by making the image * clickable). */ img.graph-without-title { border: none; } img.graph-with-title { border: 1px solid #000000; } span.graph-title { font-weight: bold; } span.graph-caption { } /* General-purpose classes * - 'p.indent-wrapped-lines' defines a paragraph whose first line * is not indented, but whose subsequent lines are. * - The 'nomargin-top' class is used to remove the top margin (e.g. * from lists). The 'nomargin' class is used to remove both the * top and bottom margin (but not the left or right margin -- * for lists, that would cause the bullets to disappear.) */ p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; margin: 0; } .nomargin-top { margin-top: 0; } .nomargin { margin-top: 0; margin-bottom: 0; } /* HTML Log */ div.log-block { padding: 0; margin: .5em 0 .5em 0; background: #e8f0f8; color: #000000; border: 1px solid #000000; } div.log-error { padding: .1em .3em .1em .3em; margin: 4px; background: #ffb0b0; color: #000000; border: 1px solid #000000; } div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; background: #ffffb0; color: #000000; border: 1px solid #000000; } div.log-info { padding: .1em .3em .1em .3em; margin: 4px; background: #b0ffb0; color: #000000; border: 1px solid #000000; } h2.log-hdr { background: #70b0ff; color: #000000; margin: 0; padding: 0em 0.5em 0em 0.5em; border-bottom: 1px solid #000000; font-size: 110%; } p.log { font-weight: bold; margin: .5em 0 .5em 0; } tr.opt-changed { color: #000000; font-weight: bold; } tr.opt-default { color: #606060; } pre.log { margin: 0; padding: 0; padding-left: 1em; } xmpppy-0.4.1/doc/apidocs/epydoc.js0000644000175000000500000002360210731034035015713 0ustar normansrcfunction toggle_private() { // Search for any private/public links on this page. Store // their old text in "cmd," so we will know what action to // take; and change their text to the opposite action. var cmd = "?"; var elts = document.getElementsByTagName("a"); for(var i=0; i...
"; elt.innerHTML = s; } } function toggle(id) { elt = document.getElementById(id+"-toggle"); if (elt.innerHTML == "-") collapse(id); else expand(id); return false; } function highlight(id) { var elt = document.getElementById(id+"-def"); if (elt) elt.className = "py-highlight-hdr"; var elt = document.getElementById(id+"-expanded"); if (elt) elt.className = "py-highlight"; var elt = document.getElementById(id+"-collapsed"); if (elt) elt.className = "py-highlight"; } function num_lines(s) { var n = 1; var pos = s.indexOf("\n"); while ( pos > 0) { n += 1; pos = s.indexOf("\n", pos+1); } return n; } // Collapse all blocks that mave more than `min_lines` lines. function collapse_all(min_lines) { var elts = document.getElementsByTagName("div"); for (var i=0; i 0) if (elt.id.substring(split, elt.id.length) == "-expanded") if (num_lines(elt.innerHTML) > min_lines) collapse(elt.id.substring(0, split)); } } function expandto(href) { var start = href.indexOf("#")+1; if (start != 0 && start != href.length) { if (href.substring(start, href.length) != "-") { collapse_all(4); pos = href.indexOf(".", start); while (pos != -1) { var id = href.substring(start, pos); expand(id); pos = href.indexOf(".", pos+1); } var id = href.substring(start, href.length); expand(id); highlight(id); } } } function kill_doclink(id) { var parent = document.getElementById(id); parent.removeChild(parent.childNodes.item(0)); } function auto_kill_doclink(ev) { if (!ev) var ev = window.event; if (!this.contains(ev.toElement)) { var parent = document.getElementById(this.parentID); parent.removeChild(parent.childNodes.item(0)); } } function doclink(id, name, targets_id) { var elt = document.getElementById(id); // If we already opened the box, then destroy it. // (This case should never occur, but leave it in just in case.) if (elt.childNodes.length > 1) { elt.removeChild(elt.childNodes.item(0)); } else { // The outer box: relative + inline positioning. var box1 = document.createElement("div"); box1.style.position = "relative"; box1.style.display = "inline"; box1.style.top = 0; box1.style.left = 0; // A shadow for fun var shadow = document.createElement("div"); shadow.style.position = "absolute"; shadow.style.left = "-1.3em"; shadow.style.top = "-1.3em"; shadow.style.background = "#404040"; // The inner box: absolute positioning. var box2 = document.createElement("div"); box2.style.position = "relative"; box2.style.border = "1px solid #a0a0a0"; box2.style.left = "-.2em"; box2.style.top = "-.2em"; box2.style.background = "white"; box2.style.padding = ".3em .4em .3em .4em"; box2.style.fontStyle = "normal"; box2.onmouseout=auto_kill_doclink; box2.parentID = id; // Get the targets var targets_elt = document.getElementById(targets_id); var targets = targets_elt.getAttribute("targets"); var links = ""; target_list = targets.split(","); for (var i=0; i" + target[0] + ""; } // Put it all together. elt.insertBefore(box1, elt.childNodes.item(0)); //box1.appendChild(box2); box1.appendChild(shadow); shadow.appendChild(box2); box2.innerHTML = "Which "+name+" do you want to see documentation for?" + ""; } return false; } function get_anchor() { var href = location.href; var start = href.indexOf("#")+1; if ((start != 0) && (start != href.length)) return href.substring(start, href.length); } function redirect_url(dottedName) { // Scan through each element of the "pages" list, and check // if "name" matches with any of them. for (var i=0; i-m" or "-c"; // extract the portion & compare it to dottedName. var pagename = pages[i].substring(0, pages[i].length-2); if (pagename == dottedName.substring(0,pagename.length)) { // We've found a page that matches `dottedName`; // construct its URL, using leftover `dottedName` // content to form an anchor. var pagetype = pages[i].charAt(pages[i].length-1); var url = pagename + ((pagetype=="m")?"-module.html": "-class.html"); if (dottedName.length > pagename.length) url += "#" + dottedName.substring(pagename.length+1, dottedName.length); return url; } } } xmpppy-0.4.1/doc/apidocs/crarr.png0000644000175000000500000000052410731034035015707 0ustar normansrc┴PNG  IHDR e╒E░,tEXtCreation TimeTue 22 Aug 2006 00:43:10 -0500` XtIMEж)с}ж pHYsббnпu>gAMA╠▐ ЭaEPLTEЪЪЪмц╟вою─f4sW Ашп┼rD`@bCэухИДэ√│X{`,╞÷─lN┤o@УСП╙≥xdEПМХ·┼dпф╢■~TжwеvtRNS@ФьfMIDATxзc`@╪Л╪0&+ ≈┼┬╟╩(▓┬─═;; /ПEXЫь▒?п n ┐╙├≈ b;'╙+≤≤Yп#°(r<ё"IEND╝B`┌xmpppy-0.4.1/doc/apidocs/identifier-index.html0000644000175000000500000104366110731034040020213 0ustar normansrc Identifier Index
 
[hide private]
[frames] | no frames]

Identifier Index

[ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ ]

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

R

S

T

U

W

X

_



xmpppy-0.4.1/doc/apidocs/module-tree.html0000644000175000000500000001427210731034040017201 0ustar normansrc Module Hierarchy
 
[hide private]
[frames] | no frames]
[ Module Hierarchy | Class Hierarchy ]

Module Hierarchy

  • xmpp: All features of xmpppy library contained within separate modules.
    • xmpp.auth: Provides library with all Non-SASL and SASL authentication mechanisms.
    • xmpp.browser: Browser module provides DISCO server framework for your application.
    • xmpp.client: Provides PlugIn class functionality to develop extentions for xmpppy.
    • xmpp.commands: This module is a ad-hoc command processor for xmpppy.
    • xmpp.debug
    • xmpp.dispatcher: Main xmpppy mechanism.
    • xmpp.features: This module contains variable stuff that is not worth splitting into separate modules.
    • xmpp.filetransfer: This module contains IBB class that is the simple implementation of JEP-0047.
    • xmpp.jep0106: This file is the XEP-0106 commands.
    • xmpp.protocol: Protocol module contains tools that is needed for processing of xmpp-related data structures.
    • xmpp.roster: Simple roster implementation.
    • xmpp.session
    • xmpp.simplexml: Simplexml module provides xmpppy library with all needed tools to handle XML nodes and XML streams.
    • xmpp.transports: This module contains the low-level implementations of xmpppy connect methods or (in other words) transports for xmpp-stanzas.
xmpppy-0.4.1/doc/apidocs/class-tree.html0000644000175000000500000003502510731034040017020 0ustar normansrc Class Hierarchy
 
[hide private]
[frames] | no frames]
[ Module Hierarchy | Class Hierarchy ]

Class Hierarchy

xmpppy-0.4.1/doc/apidocs/help.html0000644000175000000500000002467410731034040015716 0ustar normansrc Help
 
[hide private]
[frames] | no frames]

API Documentation

This document contains the API (Application Programming Interface) documentation for this project. Documentation for the Python objects defined by the project is divided into separate pages for each package, module, and class. The API documentation also includes two pages containing information about the project as a whole: a trees page, and an index page.

Object Documentation

Each Package Documentation page contains:

  • A description of the package.
  • A list of the modules and sub-packages contained by the package.
  • A summary of the classes defined by the package.
  • A summary of the functions defined by the package.
  • A summary of the variables defined by the package.
  • A detailed description of each function defined by the package.
  • A detailed description of each variable defined by the package.

Each Module Documentation page contains:

  • A description of the module.
  • A summary of the classes defined by the module.
  • A summary of the functions defined by the module.
  • A summary of the variables defined by the module.
  • A detailed description of each function defined by the module.
  • A detailed description of each variable defined by the module.

Each Class Documentation page contains:

  • A class inheritance diagram.
  • A list of known subclasses.
  • A description of the class.
  • A summary of the methods defined by the class.
  • A summary of the instance variables defined by the class.
  • A summary of the class (static) variables defined by the class.
  • A detailed description of each method defined by the class.
  • A detailed description of each instance variable defined by the class.
  • A detailed description of each class (static) variable defined by the class.

Project Documentation

The Trees page contains the module and class hierarchies:

  • The module hierarchy lists every package and module, with modules grouped into packages. At the top level, and within each package, modules and sub-packages are listed alphabetically.
  • The class hierarchy lists every class, grouped by base class. If a class has more than one base class, then it will be listed under each base class. At the top level, and under each base class, classes are listed alphabetically.

The Index page contains indices of terms and identifiers:

  • The term index lists every term indexed by any object's documentation. For each term, the index provides links to each place where the term is indexed.
  • The identifier index lists the (short) name of every package, module, class, method, function, variable, and parameter. For each identifier, the index provides a short description, and a link to its documentation.

The Table of Contents

The table of contents occupies the two frames on the left side of the window. The upper-left frame displays the project contents, and the lower-left frame displays the module contents:

Project
Contents
...
API
Documentation
Frame


Module
Contents
 
...
 

The project contents frame contains a list of all packages and modules that are defined by the project. Clicking on an entry will display its contents in the module contents frame. Clicking on a special entry, labeled "Everything," will display the contents of the entire project.

The module contents frame contains a list of every submodule, class, type, exception, function, and variable defined by a module or package. Clicking on an entry will display its documentation in the API documentation frame. Clicking on the name of the module, at the top of the frame, will display the documentation for the module itself.

The "frames" and "no frames" buttons below the top navigation bar can be used to control whether the table of contents is displayed or not.

The Navigation Bar

A navigation bar is located at the top and bottom of every page. It indicates what type of page you are currently viewing, and allows you to go to related pages. The following table describes the labels on the navigation bar. Note that not some labels (such as [Parent]) are not displayed on all pages.

Label Highlighted when... Links to...
[Parent] (never highlighted) the parent of the current package
[Package] viewing a package the package containing the current object
[Module] viewing a module the module containing the current object
[Class] viewing a class the class containing the current object
[Trees] viewing the trees page the trees page
[Index] viewing the index page the index page
[Help] viewing the help page the help page

The "show private" and "hide private" buttons below the top navigation bar can be used to control whether documentation for private objects is displayed. Private objects are usually defined as objects whose (short) names begin with a single underscore, but do not end with an underscore. For example, "_x", "__pprint", and "epydoc.epytext._tokenize" are private objects; but "re.sub", "__init__", and "type_" are not. However, if a module defines the "__all__" variable, then its contents are used to decide which objects are private.

A timestamp below the bottom navigation bar indicates when each page was last updated.

xmpppy-0.4.1/doc/apidocs/frames.html0000644000175000000500000000111210731034040016221 0ustar normansrc API Documentation xmpppy-0.4.1/doc/apidocs/toc.html0000644000175000000500000000722310731034040015542 0ustar normansrc Table of Contents

Table of Contents


Everything

Modules

xmpp
xmpp.auth
xmpp.browser
xmpp.client
xmpp.commands
xmpp.debug
xmpp.dispatcher
xmpp.features
xmpp.filetransfer
xmpp.jep0106
xmpp.protocol
xmpp.roster
xmpp.session
xmpp.simplexml
xmpp.transports

[hide private] xmpppy-0.4.1/doc/apidocs/toc-everything.html0000644000175000000500000032331510731034041017730 0ustar normansrc Everything

Everything


All Classes

xmpp.auth.Bind
xmpp.auth.ComponentBind
xmpp.auth.NonSASL
xmpp.auth.SASL
xmpp.browser.Browser
xmpp.client.Client
xmpp.client.CommonClient
xmpp.client.Component
xmpp.client.PlugIn
xmpp.commands.Command_Handler_Prototype
xmpp.commands.Commands
xmpp.commands.TestCommand
xmpp.debug.Debug
xmpp.debug.NoDebug
xmpp.dispatcher.Dispatcher
xmpp.filetransfer.IBB
xmpp.protocol.BadFormat
xmpp.protocol.BadNamespacePrefix
xmpp.protocol.Conflict
xmpp.protocol.ConnectionTimeout
xmpp.protocol.DataField
xmpp.protocol.DataForm
xmpp.protocol.Error
xmpp.protocol.ErrorNode
xmpp.protocol.HostGone
xmpp.protocol.HostUnknown
xmpp.protocol.ImproperAddressing
xmpp.protocol.InternalServerError
xmpp.protocol.InvalidFrom
xmpp.protocol.InvalidID
xmpp.protocol.InvalidNamespace
xmpp.protocol.InvalidXML
xmpp.protocol.Iq
xmpp.protocol.JID
xmpp.protocol.Message
xmpp.protocol.NodeProcessed
xmpp.protocol.NotAuthorized
xmpp.protocol.PolicyViolation
xmpp.protocol.Presence
xmpp.protocol.Protocol
xmpp.protocol.RemoteConnectionFailed
xmpp.protocol.ResourceConstraint
xmpp.protocol.RestrictedXML
xmpp.protocol.SeeOtherHost
xmpp.protocol.StreamError
xmpp.protocol.SystemShutdown
xmpp.protocol.UndefinedCondition
xmpp.protocol.UnsupportedEncoding
xmpp.protocol.UnsupportedStanzaType
xmpp.protocol.UnsupportedVersion
xmpp.protocol.XMLNotWellFormed
xmpp.roster.Roster
xmpp.session.Session
xmpp.simplexml.NT
xmpp.simplexml.Node
xmpp.simplexml.NodeBuilder
xmpp.simplexml.T
xmpp.transports.HTTPPROXYsocket
xmpp.transports.TCPsocket
xmpp.transports.TLS
xmpp.transports.error

All Functions

xmpp.auth.C
xmpp.auth.H
xmpp.auth.HH
xmpp.features.changePasswordTo
xmpp.features.delPrivacyList
xmpp.features.discoverInfo
xmpp.features.discoverItems
xmpp.features.getPrivacyList
xmpp.features.getPrivacyLists
xmpp.features.getRegInfo
xmpp.features.register
xmpp.features.setActivePrivacyList
xmpp.features.setDefaultPrivacyList
xmpp.features.setPrivacyList
xmpp.features.unregister
xmpp.jep0106.JIDDecode
xmpp.jep0106.JIDEncode
xmpp.protocol.isErrorNode
xmpp.protocol.isResultNode
xmpp.simplexml.BadXML2Node
xmpp.simplexml.XML2Node
xmpp.simplexml.XMLescape
xmpp.simplexml.ustr

All Variables

xmpp.ERRORS
xmpp.ERR_BAD_REQUEST
xmpp.ERR_CONFLICT
xmpp.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.ERR_FORBIDDEN
xmpp.ERR_GONE
xmpp.ERR_INTERNAL_SERVER_ERROR
xmpp.ERR_ITEM_NOT_FOUND
xmpp.ERR_JID_MALFORMED
xmpp.ERR_NOT_ACCEPTABLE
xmpp.ERR_NOT_ALLOWED
xmpp.ERR_NOT_AUTHORIZED
xmpp.ERR_PAYMENT_REQUIRED
xmpp.ERR_RECIPIENT_UNAVAILABLE
xmpp.ERR_REDIRECT
xmpp.ERR_REGISTRATION_REQUIRED
xmpp.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.ERR_REMOTE_SERVER_TIMEOUT
xmpp.ERR_RESOURCE_CONSTRAINT
xmpp.ERR_SERVICE_UNAVAILABLE
xmpp.ERR_SUBSCRIPTION_REQUIRED
xmpp.ERR_UNDEFINED_CONDITION
xmpp.ERR_UNEXPECTED_REQUEST
xmpp.SASL_ABORTED
xmpp.SASL_INCORRECT_ENCODING
xmpp.SASL_INVALID_AUTHZID
xmpp.SASL_INVALID_MECHANISM
xmpp.SASL_MECHANISM_TOO_WEAK
xmpp.SASL_NOT_AUTHORIZED
xmpp.SASL_TEMPORARY_AUTH_FAILURE
xmpp.STREAM_BAD_FORMAT
xmpp.STREAM_BAD_NAMESPACE_PREFIX
xmpp.STREAM_CONFLICT
xmpp.STREAM_CONNECTION_TIMEOUT
xmpp.STREAM_HOST_GONE
xmpp.STREAM_HOST_UNKNOWN
xmpp.STREAM_IMPROPER_ADDRESSING
xmpp.STREAM_INTERNAL_SERVER_ERROR
xmpp.STREAM_INVALID_FROM
xmpp.STREAM_INVALID_ID
xmpp.STREAM_INVALID_NAMESPACE
xmpp.STREAM_INVALID_XML
xmpp.STREAM_NOT_AUTHORIZED
xmpp.STREAM_POLICY_VIOLATION
xmpp.STREAM_REMOTE_CONNECTION_FAILED
xmpp.STREAM_RESOURCE_CONSTRAINT
xmpp.STREAM_RESTRICTED_XML
xmpp.STREAM_SEE_OTHER_HOST
xmpp.STREAM_SYSTEM_SHUTDOWN
xmpp.STREAM_UNDEFINED_CONDITION
xmpp.STREAM_UNSUPPORTED_ENCODING
xmpp.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.STREAM_UNSUPPORTED_VERSION
xmpp.STREAM_XML_NOT_WELL_FORMED
xmpp.auth.ERRORS
xmpp.auth.ERR_BAD_REQUEST
xmpp.auth.ERR_CONFLICT
xmpp.auth.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.auth.ERR_FORBIDDEN
xmpp.auth.ERR_GONE
xmpp.auth.ERR_INTERNAL_SERVER_ERROR
xmpp.auth.ERR_ITEM_NOT_FOUND
xmpp.auth.ERR_JID_MALFORMED
xmpp.auth.ERR_NOT_ACCEPTABLE
xmpp.auth.ERR_NOT_ALLOWED
xmpp.auth.ERR_NOT_AUTHORIZED
xmpp.auth.ERR_PAYMENT_REQUIRED
xmpp.auth.ERR_RECIPIENT_UNAVAILABLE
xmpp.auth.ERR_REDIRECT
xmpp.auth.ERR_REGISTRATION_REQUIRED
xmpp.auth.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.auth.ERR_REMOTE_SERVER_TIMEOUT
xmpp.auth.ERR_RESOURCE_CONSTRAINT
xmpp.auth.ERR_SERVICE_UNAVAILABLE
xmpp.auth.ERR_SUBSCRIPTION_REQUIRED
xmpp.auth.ERR_UNDEFINED_CONDITION
xmpp.auth.ERR_UNEXPECTED_REQUEST
xmpp.auth.SASL_ABORTED
xmpp.auth.SASL_INCORRECT_ENCODING
xmpp.auth.SASL_INVALID_AUTHZID
xmpp.auth.SASL_INVALID_MECHANISM
xmpp.auth.SASL_MECHANISM_TOO_WEAK
xmpp.auth.SASL_NOT_AUTHORIZED
xmpp.auth.SASL_TEMPORARY_AUTH_FAILURE
xmpp.auth.STREAM_BAD_FORMAT
xmpp.auth.STREAM_BAD_NAMESPACE_PREFIX
xmpp.auth.STREAM_CONFLICT
xmpp.auth.STREAM_CONNECTION_TIMEOUT
xmpp.auth.STREAM_HOST_GONE
xmpp.auth.STREAM_HOST_UNKNOWN
xmpp.auth.STREAM_IMPROPER_ADDRESSING
xmpp.auth.STREAM_INTERNAL_SERVER_ERROR
xmpp.auth.STREAM_INVALID_FROM
xmpp.auth.STREAM_INVALID_ID
xmpp.auth.STREAM_INVALID_NAMESPACE
xmpp.auth.STREAM_INVALID_XML
xmpp.auth.STREAM_NOT_AUTHORIZED
xmpp.auth.STREAM_POLICY_VIOLATION
xmpp.auth.STREAM_REMOTE_CONNECTION_FAILED
xmpp.auth.STREAM_RESOURCE_CONSTRAINT
xmpp.auth.STREAM_RESTRICTED_XML
xmpp.auth.STREAM_SEE_OTHER_HOST
xmpp.auth.STREAM_SYSTEM_SHUTDOWN
xmpp.auth.STREAM_UNDEFINED_CONDITION
xmpp.auth.STREAM_UNSUPPORTED_ENCODING
xmpp.auth.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.auth.STREAM_UNSUPPORTED_VERSION
xmpp.auth.STREAM_XML_NOT_WELL_FORMED
xmpp.auth.name
xmpp.browser.ERRORS
xmpp.browser.ERR_BAD_REQUEST
xmpp.browser.ERR_CONFLICT
xmpp.browser.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.browser.ERR_FORBIDDEN
xmpp.browser.ERR_GONE
xmpp.browser.ERR_INTERNAL_SERVER_ERROR
xmpp.browser.ERR_ITEM_NOT_FOUND
xmpp.browser.ERR_JID_MALFORMED
xmpp.browser.ERR_NOT_ACCEPTABLE
xmpp.browser.ERR_NOT_ALLOWED
xmpp.browser.ERR_NOT_AUTHORIZED
xmpp.browser.ERR_PAYMENT_REQUIRED
xmpp.browser.ERR_RECIPIENT_UNAVAILABLE
xmpp.browser.ERR_REDIRECT
xmpp.browser.ERR_REGISTRATION_REQUIRED
xmpp.browser.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.browser.ERR_REMOTE_SERVER_TIMEOUT
xmpp.browser.ERR_RESOURCE_CONSTRAINT
xmpp.browser.ERR_SERVICE_UNAVAILABLE
xmpp.browser.ERR_SUBSCRIPTION_REQUIRED
xmpp.browser.ERR_UNDEFINED_CONDITION
xmpp.browser.ERR_UNEXPECTED_REQUEST
xmpp.browser.SASL_ABORTED
xmpp.browser.SASL_INCORRECT_ENCODING
xmpp.browser.SASL_INVALID_AUTHZID
xmpp.browser.SASL_INVALID_MECHANISM
xmpp.browser.SASL_MECHANISM_TOO_WEAK
xmpp.browser.SASL_NOT_AUTHORIZED
xmpp.browser.SASL_TEMPORARY_AUTH_FAILURE
xmpp.browser.STREAM_BAD_FORMAT
xmpp.browser.STREAM_BAD_NAMESPACE_PREFIX
xmpp.browser.STREAM_CONFLICT
xmpp.browser.STREAM_CONNECTION_TIMEOUT
xmpp.browser.STREAM_HOST_GONE
xmpp.browser.STREAM_HOST_UNKNOWN
xmpp.browser.STREAM_IMPROPER_ADDRESSING
xmpp.browser.STREAM_INTERNAL_SERVER_ERROR
xmpp.browser.STREAM_INVALID_FROM
xmpp.browser.STREAM_INVALID_ID
xmpp.browser.STREAM_INVALID_NAMESPACE
xmpp.browser.STREAM_INVALID_XML
xmpp.browser.STREAM_NOT_AUTHORIZED
xmpp.browser.STREAM_POLICY_VIOLATION
xmpp.browser.STREAM_REMOTE_CONNECTION_FAILED
xmpp.browser.STREAM_RESOURCE_CONSTRAINT
xmpp.browser.STREAM_RESTRICTED_XML
xmpp.browser.STREAM_SEE_OTHER_HOST
xmpp.browser.STREAM_SYSTEM_SHUTDOWN
xmpp.browser.STREAM_UNDEFINED_CONDITION
xmpp.browser.STREAM_UNSUPPORTED_ENCODING
xmpp.browser.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.browser.STREAM_UNSUPPORTED_VERSION
xmpp.browser.STREAM_XML_NOT_WELL_FORMED
xmpp.browser.name
xmpp.client.DBG_CLIENT
xmpp.client.DBG_COMPONENT
xmpp.commands.ERRORS
xmpp.commands.ERR_BAD_REQUEST
xmpp.commands.ERR_CONFLICT
xmpp.commands.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.commands.ERR_FORBIDDEN
xmpp.commands.ERR_GONE
xmpp.commands.ERR_INTERNAL_SERVER_ERROR
xmpp.commands.ERR_ITEM_NOT_FOUND
xmpp.commands.ERR_JID_MALFORMED
xmpp.commands.ERR_NOT_ACCEPTABLE
xmpp.commands.ERR_NOT_ALLOWED
xmpp.commands.ERR_NOT_AUTHORIZED
xmpp.commands.ERR_PAYMENT_REQUIRED
xmpp.commands.ERR_RECIPIENT_UNAVAILABLE
xmpp.commands.ERR_REDIRECT
xmpp.commands.ERR_REGISTRATION_REQUIRED
xmpp.commands.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.commands.ERR_REMOTE_SERVER_TIMEOUT
xmpp.commands.ERR_RESOURCE_CONSTRAINT
xmpp.commands.ERR_SERVICE_UNAVAILABLE
xmpp.commands.ERR_SUBSCRIPTION_REQUIRED
xmpp.commands.ERR_UNDEFINED_CONDITION
xmpp.commands.ERR_UNEXPECTED_REQUEST
xmpp.commands.SASL_ABORTED
xmpp.commands.SASL_INCORRECT_ENCODING
xmpp.commands.SASL_INVALID_AUTHZID
xmpp.commands.SASL_INVALID_MECHANISM
xmpp.commands.SASL_MECHANISM_TOO_WEAK
xmpp.commands.SASL_NOT_AUTHORIZED
xmpp.commands.SASL_TEMPORARY_AUTH_FAILURE
xmpp.commands.STREAM_BAD_FORMAT
xmpp.commands.STREAM_BAD_NAMESPACE_PREFIX
xmpp.commands.STREAM_CONFLICT
xmpp.commands.STREAM_CONNECTION_TIMEOUT
xmpp.commands.STREAM_HOST_GONE
xmpp.commands.STREAM_HOST_UNKNOWN
xmpp.commands.STREAM_IMPROPER_ADDRESSING
xmpp.commands.STREAM_INTERNAL_SERVER_ERROR
xmpp.commands.STREAM_INVALID_FROM
xmpp.commands.STREAM_INVALID_ID
xmpp.commands.STREAM_INVALID_NAMESPACE
xmpp.commands.STREAM_INVALID_XML
xmpp.commands.STREAM_NOT_AUTHORIZED
xmpp.commands.STREAM_POLICY_VIOLATION
xmpp.commands.STREAM_REMOTE_CONNECTION_FAILED
xmpp.commands.STREAM_RESOURCE_CONSTRAINT
xmpp.commands.STREAM_RESTRICTED_XML
xmpp.commands.STREAM_SEE_OTHER_HOST
xmpp.commands.STREAM_SYSTEM_SHUTDOWN
xmpp.commands.STREAM_UNDEFINED_CONDITION
xmpp.commands.STREAM_UNSUPPORTED_ENCODING
xmpp.commands.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.commands.STREAM_UNSUPPORTED_VERSION
xmpp.commands.STREAM_XML_NOT_WELL_FORMED
xmpp.commands.name
xmpp.debug.DBG_ALWAYS
xmpp.debug.DEBUGGING_IS_ON
xmpp.debug.LINE_FEED
xmpp.debug._version_
xmpp.debug.color_black
xmpp.debug.color_blue
xmpp.debug.color_bright_blue
xmpp.debug.color_bright_cyan
xmpp.debug.color_bright_green
xmpp.debug.color_bright_red
xmpp.debug.color_brown
xmpp.debug.color_cyan
xmpp.debug.color_dark_gray
xmpp.debug.color_green
xmpp.debug.color_light_gray
xmpp.debug.color_magenta
xmpp.debug.color_none
xmpp.debug.color_purple
xmpp.debug.color_red
xmpp.debug.color_white
xmpp.debug.color_yellow
xmpp.debug.colors_enabled
xmpp.dispatcher.DefaultTimeout
xmpp.dispatcher.ERRORS
xmpp.dispatcher.ERR_BAD_REQUEST
xmpp.dispatcher.ERR_CONFLICT
xmpp.dispatcher.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.dispatcher.ERR_FORBIDDEN
xmpp.dispatcher.ERR_GONE
xmpp.dispatcher.ERR_INTERNAL_SERVER_ERROR
xmpp.dispatcher.ERR_ITEM_NOT_FOUND
xmpp.dispatcher.ERR_JID_MALFORMED
xmpp.dispatcher.ERR_NOT_ACCEPTABLE
xmpp.dispatcher.ERR_NOT_ALLOWED
xmpp.dispatcher.ERR_NOT_AUTHORIZED
xmpp.dispatcher.ERR_PAYMENT_REQUIRED
xmpp.dispatcher.ERR_RECIPIENT_UNAVAILABLE
xmpp.dispatcher.ERR_REDIRECT
xmpp.dispatcher.ERR_REGISTRATION_REQUIRED
xmpp.dispatcher.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.dispatcher.ERR_REMOTE_SERVER_TIMEOUT
xmpp.dispatcher.ERR_RESOURCE_CONSTRAINT
xmpp.dispatcher.ERR_SERVICE_UNAVAILABLE
xmpp.dispatcher.ERR_SUBSCRIPTION_REQUIRED
xmpp.dispatcher.ERR_UNDEFINED_CONDITION
xmpp.dispatcher.ERR_UNEXPECTED_REQUEST
xmpp.dispatcher.ID
xmpp.dispatcher.SASL_ABORTED
xmpp.dispatcher.SASL_INCORRECT_ENCODING
xmpp.dispatcher.SASL_INVALID_AUTHZID
xmpp.dispatcher.SASL_INVALID_MECHANISM
xmpp.dispatcher.SASL_MECHANISM_TOO_WEAK
xmpp.dispatcher.SASL_NOT_AUTHORIZED
xmpp.dispatcher.SASL_TEMPORARY_AUTH_FAILURE
xmpp.dispatcher.STREAM_BAD_FORMAT
xmpp.dispatcher.STREAM_BAD_NAMESPACE_PREFIX
xmpp.dispatcher.STREAM_CONFLICT
xmpp.dispatcher.STREAM_CONNECTION_TIMEOUT
xmpp.dispatcher.STREAM_HOST_GONE
xmpp.dispatcher.STREAM_HOST_UNKNOWN
xmpp.dispatcher.STREAM_IMPROPER_ADDRESSING
xmpp.dispatcher.STREAM_INTERNAL_SERVER_ERROR
xmpp.dispatcher.STREAM_INVALID_FROM
xmpp.dispatcher.STREAM_INVALID_ID
xmpp.dispatcher.STREAM_INVALID_NAMESPACE
xmpp.dispatcher.STREAM_INVALID_XML
xmpp.dispatcher.STREAM_NOT_AUTHORIZED
xmpp.dispatcher.STREAM_POLICY_VIOLATION
xmpp.dispatcher.STREAM_REMOTE_CONNECTION_FAILED
xmpp.dispatcher.STREAM_RESOURCE_CONSTRAINT
xmpp.dispatcher.STREAM_RESTRICTED_XML
xmpp.dispatcher.STREAM_SEE_OTHER_HOST
xmpp.dispatcher.STREAM_SYSTEM_SHUTDOWN
xmpp.dispatcher.STREAM_UNDEFINED_CONDITION
xmpp.dispatcher.STREAM_UNSUPPORTED_ENCODING
xmpp.dispatcher.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.dispatcher.STREAM_UNSUPPORTED_VERSION
xmpp.dispatcher.STREAM_XML_NOT_WELL_FORMED
xmpp.dispatcher.name
xmpp.features.ERRORS
xmpp.features.ERR_BAD_REQUEST
xmpp.features.ERR_CONFLICT
xmpp.features.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.features.ERR_FORBIDDEN
xmpp.features.ERR_GONE
xmpp.features.ERR_INTERNAL_SERVER_ERROR
xmpp.features.ERR_ITEM_NOT_FOUND
xmpp.features.ERR_JID_MALFORMED
xmpp.features.ERR_NOT_ACCEPTABLE
xmpp.features.ERR_NOT_ALLOWED
xmpp.features.ERR_NOT_AUTHORIZED
xmpp.features.ERR_PAYMENT_REQUIRED
xmpp.features.ERR_RECIPIENT_UNAVAILABLE
xmpp.features.ERR_REDIRECT
xmpp.features.ERR_REGISTRATION_REQUIRED
xmpp.features.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.features.ERR_REMOTE_SERVER_TIMEOUT
xmpp.features.ERR_RESOURCE_CONSTRAINT
xmpp.features.ERR_SERVICE_UNAVAILABLE
xmpp.features.ERR_SUBSCRIPTION_REQUIRED
xmpp.features.ERR_UNDEFINED_CONDITION
xmpp.features.ERR_UNEXPECTED_REQUEST
xmpp.features.REGISTER_DATA_RECEIVED
xmpp.features.SASL_ABORTED
xmpp.features.SASL_INCORRECT_ENCODING
xmpp.features.SASL_INVALID_AUTHZID
xmpp.features.SASL_INVALID_MECHANISM
xmpp.features.SASL_MECHANISM_TOO_WEAK
xmpp.features.SASL_NOT_AUTHORIZED
xmpp.features.SASL_TEMPORARY_AUTH_FAILURE
xmpp.features.STREAM_BAD_FORMAT
xmpp.features.STREAM_BAD_NAMESPACE_PREFIX
xmpp.features.STREAM_CONFLICT
xmpp.features.STREAM_CONNECTION_TIMEOUT
xmpp.features.STREAM_HOST_GONE
xmpp.features.STREAM_HOST_UNKNOWN
xmpp.features.STREAM_IMPROPER_ADDRESSING
xmpp.features.STREAM_INTERNAL_SERVER_ERROR
xmpp.features.STREAM_INVALID_FROM
xmpp.features.STREAM_INVALID_ID
xmpp.features.STREAM_INVALID_NAMESPACE
xmpp.features.STREAM_INVALID_XML
xmpp.features.STREAM_NOT_AUTHORIZED
xmpp.features.STREAM_POLICY_VIOLATION
xmpp.features.STREAM_REMOTE_CONNECTION_FAILED
xmpp.features.STREAM_RESOURCE_CONSTRAINT
xmpp.features.STREAM_RESTRICTED_XML
xmpp.features.STREAM_SEE_OTHER_HOST
xmpp.features.STREAM_SYSTEM_SHUTDOWN
xmpp.features.STREAM_UNDEFINED_CONDITION
xmpp.features.STREAM_UNSUPPORTED_ENCODING
xmpp.features.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.features.STREAM_UNSUPPORTED_VERSION
xmpp.features.STREAM_XML_NOT_WELL_FORMED
xmpp.features.name
xmpp.filetransfer.ERRORS
xmpp.filetransfer.ERR_BAD_REQUEST
xmpp.filetransfer.ERR_CONFLICT
xmpp.filetransfer.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.filetransfer.ERR_FORBIDDEN
xmpp.filetransfer.ERR_GONE
xmpp.filetransfer.ERR_INTERNAL_SERVER_ERROR
xmpp.filetransfer.ERR_ITEM_NOT_FOUND
xmpp.filetransfer.ERR_JID_MALFORMED
xmpp.filetransfer.ERR_NOT_ACCEPTABLE
xmpp.filetransfer.ERR_NOT_ALLOWED
xmpp.filetransfer.ERR_NOT_AUTHORIZED
xmpp.filetransfer.ERR_PAYMENT_REQUIRED
xmpp.filetransfer.ERR_RECIPIENT_UNAVAILABLE
xmpp.filetransfer.ERR_REDIRECT
xmpp.filetransfer.ERR_REGISTRATION_REQUIRED
xmpp.filetransfer.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.filetransfer.ERR_REMOTE_SERVER_TIMEOUT
xmpp.filetransfer.ERR_RESOURCE_CONSTRAINT
xmpp.filetransfer.ERR_SERVICE_UNAVAILABLE
xmpp.filetransfer.ERR_SUBSCRIPTION_REQUIRED
xmpp.filetransfer.ERR_UNDEFINED_CONDITION
xmpp.filetransfer.ERR_UNEXPECTED_REQUEST
xmpp.filetransfer.SASL_ABORTED
xmpp.filetransfer.SASL_INCORRECT_ENCODING
xmpp.filetransfer.SASL_INVALID_AUTHZID
xmpp.filetransfer.SASL_INVALID_MECHANISM
xmpp.filetransfer.SASL_MECHANISM_TOO_WEAK
xmpp.filetransfer.SASL_NOT_AUTHORIZED
xmpp.filetransfer.SASL_TEMPORARY_AUTH_FAILURE
xmpp.filetransfer.STREAM_BAD_FORMAT
xmpp.filetransfer.STREAM_BAD_NAMESPACE_PREFIX
xmpp.filetransfer.STREAM_CONFLICT
xmpp.filetransfer.STREAM_CONNECTION_TIMEOUT
xmpp.filetransfer.STREAM_HOST_GONE
xmpp.filetransfer.STREAM_HOST_UNKNOWN
xmpp.filetransfer.STREAM_IMPROPER_ADDRESSING
xmpp.filetransfer.STREAM_INTERNAL_SERVER_ERROR
xmpp.filetransfer.STREAM_INVALID_FROM
xmpp.filetransfer.STREAM_INVALID_ID
xmpp.filetransfer.STREAM_INVALID_NAMESPACE
xmpp.filetransfer.STREAM_INVALID_XML
xmpp.filetransfer.STREAM_NOT_AUTHORIZED
xmpp.filetransfer.STREAM_POLICY_VIOLATION
xmpp.filetransfer.STREAM_REMOTE_CONNECTION_FAILED
xmpp.filetransfer.STREAM_RESOURCE_CONSTRAINT
xmpp.filetransfer.STREAM_RESTRICTED_XML
xmpp.filetransfer.STREAM_SEE_OTHER_HOST
xmpp.filetransfer.STREAM_SYSTEM_SHUTDOWN
xmpp.filetransfer.STREAM_UNDEFINED_CONDITION
xmpp.filetransfer.STREAM_UNSUPPORTED_ENCODING
xmpp.filetransfer.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.filetransfer.STREAM_UNSUPPORTED_VERSION
xmpp.filetransfer.STREAM_XML_NOT_WELL_FORMED
xmpp.filetransfer.name
xmpp.jep0106.xep0106mapping
xmpp.name
xmpp.protocol.ERRORS
xmpp.protocol.ERR_BAD_REQUEST
xmpp.protocol.ERR_CONFLICT
xmpp.protocol.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.protocol.ERR_FORBIDDEN
xmpp.protocol.ERR_GONE
xmpp.protocol.ERR_INTERNAL_SERVER_ERROR
xmpp.protocol.ERR_ITEM_NOT_FOUND
xmpp.protocol.ERR_JID_MALFORMED
xmpp.protocol.ERR_NOT_ACCEPTABLE
xmpp.protocol.ERR_NOT_ALLOWED
xmpp.protocol.ERR_NOT_AUTHORIZED
xmpp.protocol.ERR_PAYMENT_REQUIRED
xmpp.protocol.ERR_RECIPIENT_UNAVAILABLE
xmpp.protocol.ERR_REDIRECT
xmpp.protocol.ERR_REGISTRATION_REQUIRED
xmpp.protocol.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.protocol.ERR_REMOTE_SERVER_TIMEOUT
xmpp.protocol.ERR_RESOURCE_CONSTRAINT
xmpp.protocol.ERR_SERVICE_UNAVAILABLE
xmpp.protocol.ERR_SUBSCRIPTION_REQUIRED
xmpp.protocol.ERR_UNDEFINED_CONDITION
xmpp.protocol.ERR_UNEXPECTED_REQUEST
xmpp.protocol.NS_ACTIVITY
xmpp.protocol.NS_ADDRESS
xmpp.protocol.NS_ADMIN
xmpp.protocol.NS_ADMIN_ACTIVE_USERS_LIST
xmpp.protocol.NS_ADMIN_ACTIVE_USERS_NUM
xmpp.protocol.NS_ADMIN_ADD_USER
xmpp.protocol.NS_ADMIN_ANNOUNCE
xmpp.protocol.NS_ADMIN_CHANGE_USER_PASSWORD
xmpp.protocol.NS_ADMIN_DELETE_MOTD
xmpp.protocol.NS_ADMIN_DELETE_USER
xmpp.protocol.NS_ADMIN_DELETE_WELCOME
xmpp.protocol.NS_ADMIN_DISABLED_USERS_LIST
xmpp.protocol.NS_ADMIN_DISABLED_USERS_NUM
xmpp.protocol.NS_ADMIN_DISABLE_USER
xmpp.protocol.NS_ADMIN_EDIT_ADMIN
xmpp.protocol.NS_ADMIN_EDIT_BLACKLIST
xmpp.protocol.NS_ADMIN_EDIT_MOTD
xmpp.protocol.NS_ADMIN_EDIT_WHITELIST
xmpp.protocol.NS_ADMIN_END_USER_SESSION
xmpp.protocol.NS_ADMIN_GET_USER_LASTLOGIN
xmpp.protocol.NS_ADMIN_GET_USER_PASSWORD
xmpp.protocol.NS_ADMIN_GET_USER_ROSTER
xmpp.protocol.NS_ADMIN_IDLE_USERS_LIST
xmpp.protocol.NS_ADMIN_IDLE_USERS_NUM
xmpp.protocol.NS_ADMIN_ONLINE_USERS_LIST
xmpp.protocol.NS_ADMIN_ONLINE_USERS_NUM
xmpp.protocol.NS_ADMIN_REENABLE_USER
xmpp.protocol.NS_ADMIN_REGISTERED_USERS_LIST
xmpp.protocol.NS_ADMIN_REGISTERED_USERS_NUM
xmpp.protocol.NS_ADMIN_RESTART
xmpp.protocol.NS_ADMIN_SET_MOTD
xmpp.protocol.NS_ADMIN_SET_WELCOME
xmpp.protocol.NS_ADMIN_SHUTDOWN
xmpp.protocol.NS_ADMIN_USER_STATS
xmpp.protocol.NS_AGENTS
xmpp.protocol.NS_AMP
xmpp.protocol.NS_AMP_ERRORS
xmpp.protocol.NS_AUTH
xmpp.protocol.NS_AVATAR
xmpp.protocol.NS_BIND
xmpp.protocol.NS_BROWSE
xmpp.protocol.NS_BYTESTREAM
xmpp.protocol.NS_CAPS
xmpp.protocol.NS_CHATSTATES
xmpp.protocol.NS_CLIENT
xmpp.protocol.NS_COMMANDS
xmpp.protocol.NS_COMPONENT_1
xmpp.protocol.NS_COMPONENT_ACCEPT
xmpp.protocol.NS_COMPRESS
xmpp.protocol.NS_DATA
xmpp.protocol.NS_DATA_LAYOUT
xmpp.protocol.NS_DATA_VALIDATE
xmpp.protocol.NS_DELAY
xmpp.protocol.NS_DIALBACK
xmpp.protocol.NS_DISCO
xmpp.protocol.NS_DISCO_INFO
xmpp.protocol.NS_DISCO_ITEMS
xmpp.protocol.NS_ENCRYPTED
xmpp.protocol.NS_EVENT
xmpp.protocol.NS_FEATURE
xmpp.protocol.NS_FILE
xmpp.protocol.NS_GATEWAY
xmpp.protocol.NS_GEOLOC
xmpp.protocol.NS_GROUPCHAT
xmpp.protocol.NS_HTTP_BIND
xmpp.protocol.NS_IBB
xmpp.protocol.NS_INVISIBLE
xmpp.protocol.NS_IQ
xmpp.protocol.NS_LAST
xmpp.protocol.NS_MESSAGE
xmpp.protocol.NS_MOOD
xmpp.protocol.NS_MUC
xmpp.protocol.NS_MUC_ADMIN
xmpp.protocol.NS_MUC_OWNER
xmpp.protocol.NS_MUC_REGISTER
xmpp.protocol.NS_MUC_REQUEST
xmpp.protocol.NS_MUC_ROOMCONFIG
xmpp.protocol.NS_MUC_ROOMINFO
xmpp.protocol.NS_MUC_ROOMS
xmpp.protocol.NS_MUC_TRAFIC
xmpp.protocol.NS_MUC_UNIQUE
xmpp.protocol.NS_MUC_USER
xmpp.protocol.NS_OFFLINE
xmpp.protocol.NS_PHYSLOC
xmpp.protocol.NS_PRESENCE
xmpp.protocol.NS_PRIVACY
xmpp.protocol.NS_PRIVATE
xmpp.protocol.NS_PUBSUB
xmpp.protocol.NS_REGISTER
xmpp.protocol.NS_ROSTER
xmpp.protocol.NS_ROSTERX
xmpp.protocol.NS_RPC
xmpp.protocol.NS_SASL
xmpp.protocol.NS_SEARCH
xmpp.protocol.NS_SERVER
xmpp.protocol.NS_SESSION
xmpp.protocol.NS_SI
xmpp.protocol.NS_SIGNED
xmpp.protocol.NS_SI_PUB
xmpp.protocol.NS_STANZAS
xmpp.protocol.NS_STREAMS
xmpp.protocol.NS_TIME
xmpp.protocol.NS_TLS
xmpp.protocol.NS_VACATION
xmpp.protocol.NS_VCARD
xmpp.protocol.NS_VERSION
xmpp.protocol.NS_WAITINGLIST
xmpp.protocol.NS_XHTML_IM
xmpp.protocol.NS_XMPP_STREAMS
xmpp.protocol.SASL_ABORTED
xmpp.protocol.SASL_INCORRECT_ENCODING
xmpp.protocol.SASL_INVALID_AUTHZID
xmpp.protocol.SASL_INVALID_MECHANISM
xmpp.protocol.SASL_MECHANISM_TOO_WEAK
xmpp.protocol.SASL_NOT_AUTHORIZED
xmpp.protocol.SASL_TEMPORARY_AUTH_FAILURE
xmpp.protocol.STREAM_BAD_FORMAT
xmpp.protocol.STREAM_BAD_NAMESPACE_PREFIX
xmpp.protocol.STREAM_CONFLICT
xmpp.protocol.STREAM_CONNECTION_TIMEOUT
xmpp.protocol.STREAM_HOST_GONE
xmpp.protocol.STREAM_HOST_UNKNOWN
xmpp.protocol.STREAM_IMPROPER_ADDRESSING
xmpp.protocol.STREAM_INTERNAL_SERVER_ERROR
xmpp.protocol.STREAM_INVALID_FROM
xmpp.protocol.STREAM_INVALID_ID
xmpp.protocol.STREAM_INVALID_NAMESPACE
xmpp.protocol.STREAM_INVALID_XML
xmpp.protocol.STREAM_NOT_AUTHORIZED
xmpp.protocol.STREAM_POLICY_VIOLATION
xmpp.protocol.STREAM_REMOTE_CONNECTION_FAILED
xmpp.protocol.STREAM_RESOURCE_CONSTRAINT
xmpp.protocol.STREAM_RESTRICTED_XML
xmpp.protocol.STREAM_SEE_OTHER_HOST
xmpp.protocol.STREAM_SYSTEM_SHUTDOWN
xmpp.protocol.STREAM_UNDEFINED_CONDITION
xmpp.protocol.STREAM_UNSUPPORTED_ENCODING
xmpp.protocol.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.protocol.STREAM_UNSUPPORTED_VERSION
xmpp.protocol.STREAM_XML_NOT_WELL_FORMED
xmpp.protocol.name
xmpp.protocol.sasl_error_conditions
xmpp.protocol.stream_exceptions
xmpp.protocol.xmpp_stanza_error_conditions
xmpp.protocol.xmpp_stream_error_conditions
xmpp.roster.ERRORS
xmpp.roster.ERR_BAD_REQUEST
xmpp.roster.ERR_CONFLICT
xmpp.roster.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.roster.ERR_FORBIDDEN
xmpp.roster.ERR_GONE
xmpp.roster.ERR_INTERNAL_SERVER_ERROR
xmpp.roster.ERR_ITEM_NOT_FOUND
xmpp.roster.ERR_JID_MALFORMED
xmpp.roster.ERR_NOT_ACCEPTABLE
xmpp.roster.ERR_NOT_ALLOWED
xmpp.roster.ERR_NOT_AUTHORIZED
xmpp.roster.ERR_PAYMENT_REQUIRED
xmpp.roster.ERR_RECIPIENT_UNAVAILABLE
xmpp.roster.ERR_REDIRECT
xmpp.roster.ERR_REGISTRATION_REQUIRED
xmpp.roster.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.roster.ERR_REMOTE_SERVER_TIMEOUT
xmpp.roster.ERR_RESOURCE_CONSTRAINT
xmpp.roster.ERR_SERVICE_UNAVAILABLE
xmpp.roster.ERR_SUBSCRIPTION_REQUIRED
xmpp.roster.ERR_UNDEFINED_CONDITION
xmpp.roster.ERR_UNEXPECTED_REQUEST
xmpp.roster.SASL_ABORTED
xmpp.roster.SASL_INCORRECT_ENCODING
xmpp.roster.SASL_INVALID_AUTHZID
xmpp.roster.SASL_INVALID_MECHANISM
xmpp.roster.SASL_MECHANISM_TOO_WEAK
xmpp.roster.SASL_NOT_AUTHORIZED
xmpp.roster.SASL_TEMPORARY_AUTH_FAILURE
xmpp.roster.STREAM_BAD_FORMAT
xmpp.roster.STREAM_BAD_NAMESPACE_PREFIX
xmpp.roster.STREAM_CONFLICT
xmpp.roster.STREAM_CONNECTION_TIMEOUT
xmpp.roster.STREAM_HOST_GONE
xmpp.roster.STREAM_HOST_UNKNOWN
xmpp.roster.STREAM_IMPROPER_ADDRESSING
xmpp.roster.STREAM_INTERNAL_SERVER_ERROR
xmpp.roster.STREAM_INVALID_FROM
xmpp.roster.STREAM_INVALID_ID
xmpp.roster.STREAM_INVALID_NAMESPACE
xmpp.roster.STREAM_INVALID_XML
xmpp.roster.STREAM_NOT_AUTHORIZED
xmpp.roster.STREAM_POLICY_VIOLATION
xmpp.roster.STREAM_REMOTE_CONNECTION_FAILED
xmpp.roster.STREAM_RESOURCE_CONSTRAINT
xmpp.roster.STREAM_RESTRICTED_XML
xmpp.roster.STREAM_SEE_OTHER_HOST
xmpp.roster.STREAM_SYSTEM_SHUTDOWN
xmpp.roster.STREAM_UNDEFINED_CONDITION
xmpp.roster.STREAM_UNSUPPORTED_ENCODING
xmpp.roster.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.roster.STREAM_UNSUPPORTED_VERSION
xmpp.roster.STREAM_XML_NOT_WELL_FORMED
xmpp.roster.name
xmpp.session.ERRORS
xmpp.session.ERR_BAD_REQUEST
xmpp.session.ERR_CONFLICT
xmpp.session.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.session.ERR_FORBIDDEN
xmpp.session.ERR_GONE
xmpp.session.ERR_INTERNAL_SERVER_ERROR
xmpp.session.ERR_ITEM_NOT_FOUND
xmpp.session.ERR_JID_MALFORMED
xmpp.session.ERR_NOT_ACCEPTABLE
xmpp.session.ERR_NOT_ALLOWED
xmpp.session.ERR_NOT_AUTHORIZED
xmpp.session.ERR_PAYMENT_REQUIRED
xmpp.session.ERR_RECIPIENT_UNAVAILABLE
xmpp.session.ERR_REDIRECT
xmpp.session.ERR_REGISTRATION_REQUIRED
xmpp.session.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.session.ERR_REMOTE_SERVER_TIMEOUT
xmpp.session.ERR_RESOURCE_CONSTRAINT
xmpp.session.ERR_SERVICE_UNAVAILABLE
xmpp.session.ERR_SUBSCRIPTION_REQUIRED
xmpp.session.ERR_UNDEFINED_CONDITION
xmpp.session.ERR_UNEXPECTED_REQUEST
xmpp.session.SASL_ABORTED
xmpp.session.SASL_INCORRECT_ENCODING
xmpp.session.SASL_INVALID_AUTHZID
xmpp.session.SASL_INVALID_MECHANISM
xmpp.session.SASL_MECHANISM_TOO_WEAK
xmpp.session.SASL_NOT_AUTHORIZED
xmpp.session.SASL_TEMPORARY_AUTH_FAILURE
xmpp.session.SESSION_AUTHED
xmpp.session.SESSION_BOUND
xmpp.session.SESSION_CLOSED
xmpp.session.SESSION_NOT_AUTHED
xmpp.session.SESSION_OPENED
xmpp.session.SOCKET_ALIVE
xmpp.session.SOCKET_DEAD
xmpp.session.SOCKET_UNCONNECTED
xmpp.session.STREAM_BAD_FORMAT
xmpp.session.STREAM_BAD_NAMESPACE_PREFIX
xmpp.session.STREAM_CONFLICT
xmpp.session.STREAM_CONNECTION_TIMEOUT
xmpp.session.STREAM_HOST_GONE
xmpp.session.STREAM_HOST_UNKNOWN
xmpp.session.STREAM_IMPROPER_ADDRESSING
xmpp.session.STREAM_INTERNAL_SERVER_ERROR
xmpp.session.STREAM_INVALID_FROM
xmpp.session.STREAM_INVALID_ID
xmpp.session.STREAM_INVALID_NAMESPACE
xmpp.session.STREAM_INVALID_XML
xmpp.session.STREAM_NOT_AUTHORIZED
xmpp.session.STREAM_POLICY_VIOLATION
xmpp.session.STREAM_REMOTE_CONNECTION_FAILED
xmpp.session.STREAM_RESOURCE_CONSTRAINT
xmpp.session.STREAM_RESTRICTED_XML
xmpp.session.STREAM_SEE_OTHER_HOST
xmpp.session.STREAM_SYSTEM_SHUTDOWN
xmpp.session.STREAM_UNDEFINED_CONDITION
xmpp.session.STREAM_UNSUPPORTED_ENCODING
xmpp.session.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.session.STREAM_UNSUPPORTED_VERSION
xmpp.session.STREAM_XML_NOT_WELL_FORMED
xmpp.session.STREAM__CLOSED
xmpp.session.STREAM__CLOSING
xmpp.session.STREAM__NOT_OPENED
xmpp.session.STREAM__OPENED
xmpp.session.__version__
xmpp.session.name
xmpp.simplexml.DBG_NODEBUILDER
xmpp.simplexml.ENCODING
xmpp.transports.BUFLEN
xmpp.transports.DATA_RECEIVED
xmpp.transports.DATA_SENT
xmpp.transports.DBG_CONNECT_PROXY
xmpp.transports.ERRORS
xmpp.transports.ERR_BAD_REQUEST
xmpp.transports.ERR_CONFLICT
xmpp.transports.ERR_FEATURE_NOT_IMPLEMENTED
xmpp.transports.ERR_FORBIDDEN
xmpp.transports.ERR_GONE
xmpp.transports.ERR_INTERNAL_SERVER_ERROR
xmpp.transports.ERR_ITEM_NOT_FOUND
xmpp.transports.ERR_JID_MALFORMED
xmpp.transports.ERR_NOT_ACCEPTABLE
xmpp.transports.ERR_NOT_ALLOWED
xmpp.transports.ERR_NOT_AUTHORIZED
xmpp.transports.ERR_PAYMENT_REQUIRED
xmpp.transports.ERR_RECIPIENT_UNAVAILABLE
xmpp.transports.ERR_REDIRECT
xmpp.transports.ERR_REGISTRATION_REQUIRED
xmpp.transports.ERR_REMOTE_SERVER_NOT_FOUND
xmpp.transports.ERR_REMOTE_SERVER_TIMEOUT
xmpp.transports.ERR_RESOURCE_CONSTRAINT
xmpp.transports.ERR_SERVICE_UNAVAILABLE
xmpp.transports.ERR_SUBSCRIPTION_REQUIRED
xmpp.transports.ERR_UNDEFINED_CONDITION
xmpp.transports.ERR_UNEXPECTED_REQUEST
xmpp.transports.HAVE_DNSPYTHON
xmpp.transports.HAVE_PYDNS
xmpp.transports.SASL_ABORTED
xmpp.transports.SASL_INCORRECT_ENCODING
xmpp.transports.SASL_INVALID_AUTHZID
xmpp.transports.SASL_INVALID_MECHANISM
xmpp.transports.SASL_MECHANISM_TOO_WEAK
xmpp.transports.SASL_NOT_AUTHORIZED
xmpp.transports.SASL_TEMPORARY_AUTH_FAILURE
xmpp.transports.STREAM_BAD_FORMAT
xmpp.transports.STREAM_BAD_NAMESPACE_PREFIX
xmpp.transports.STREAM_CONFLICT
xmpp.transports.STREAM_CONNECTION_TIMEOUT
xmpp.transports.STREAM_HOST_GONE
xmpp.transports.STREAM_HOST_UNKNOWN
xmpp.transports.STREAM_IMPROPER_ADDRESSING
xmpp.transports.STREAM_INTERNAL_SERVER_ERROR
xmpp.transports.STREAM_INVALID_FROM
xmpp.transports.STREAM_INVALID_ID
xmpp.transports.STREAM_INVALID_NAMESPACE
xmpp.transports.STREAM_INVALID_XML
xmpp.transports.STREAM_NOT_AUTHORIZED
xmpp.transports.STREAM_POLICY_VIOLATION
xmpp.transports.STREAM_REMOTE_CONNECTION_FAILED
xmpp.transports.STREAM_RESOURCE_CONSTRAINT
xmpp.transports.STREAM_RESTRICTED_XML
xmpp.transports.STREAM_SEE_OTHER_HOST
xmpp.transports.STREAM_SYSTEM_SHUTDOWN
xmpp.transports.STREAM_UNDEFINED_CONDITION
xmpp.transports.STREAM_UNSUPPORTED_ENCODING
xmpp.transports.STREAM_UNSUPPORTED_STANZA_TYPE
xmpp.transports.STREAM_UNSUPPORTED_VERSION
xmpp.transports.STREAM_XML_NOT_WELL_FORMED
xmpp.transports.name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp-module.html0000644000175000000500000001546710731034041020021 0ustar normansrc xmpp

Module xmpp


Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.auth-module.html0000644000175000000500000001727610731034041020761 0ustar normansrc auth

Module auth


Classes

Bind
ComponentBind
NonSASL
SASL

Functions

C
H
HH

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.browser-module.html0000644000175000000500000001655410731034041021501 0ustar normansrc browser

Module browser


Classes

Browser

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.client-module.html0000644000175000000500000000305710731034041021266 0ustar normansrc client

Module client


Classes

Client
CommonClient
Component
PlugIn

Variables

DBG_CLIENT
DBG_COMPONENT

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.commands-module.html0000644000175000000500000001720610731034041021612 0ustar normansrc commands

Module commands


Classes

Command_Handler_Prototype
Commands
TestCommand

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.debug-module.html0000644000175000000500000000643310731034041021077 0ustar normansrc debug

Module debug


Classes

Debug
NoDebug

Variables

DBG_ALWAYS
DEBUGGING_IS_ON
LINE_FEED
_version_
color_black
color_blue
color_bright_blue
color_bright_cyan
color_bright_green
color_bright_red
color_brown
color_cyan
color_dark_gray
color_green
color_light_gray
color_magenta
color_none
color_purple
color_red
color_white
color_yellow
colors_enabled

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.dispatcher-module.html0000644000175000000500000001733410731034041022141 0ustar normansrc dispatcher

Module dispatcher


Classes

Dispatcher

Variables

DefaultTimeout
ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
ID
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.features-module.html0000644000175000000500000002166110731034042021630 0ustar normansrc features

Module features


Functions

changePasswordTo
delPrivacyList
discoverInfo
discoverItems
getPrivacyList
getPrivacyLists
getRegInfo
register
setActivePrivacyList
setDefaultPrivacyList
setPrivacyList
unregister

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
REGISTER_DATA_RECEIVED
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.filetransfer-module.html0000644000175000000500000001720610731034042022476 0ustar normansrc filetransfer

Module filetransfer


Classes

IBB

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.jep0106-module.html0000644000175000000500000000245410731034042021076 0ustar normansrc jep0106

Module jep0106


Functions

JIDDecode
JIDEncode

Variables

xep0106mapping

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.protocol-module.html0000644000175000000500000005515410731034042021657 0ustar normansrc protocol

Module protocol


Classes

BadFormat
BadNamespacePrefix
Conflict
ConnectionTimeout
DataField
DataForm
Error
ErrorNode
HostGone
HostUnknown
ImproperAddressing
InternalServerError
InvalidFrom
InvalidID
InvalidNamespace
InvalidXML
Iq
JID
Message
NodeProcessed
NotAuthorized
PolicyViolation
Presence
Protocol
RemoteConnectionFailed
ResourceConstraint
RestrictedXML
SeeOtherHost
StreamError
SystemShutdown
UndefinedCondition
UnsupportedEncoding
UnsupportedStanzaType
UnsupportedVersion
XMLNotWellFormed

Functions

isErrorNode
isResultNode

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
NS_ACTIVITY
NS_ADDRESS
NS_ADMIN
NS_ADMIN_ACTIVE_USERS_LIST
NS_ADMIN_ACTIVE_USERS_NUM
NS_ADMIN_ADD_USER
NS_ADMIN_ANNOUNCE
NS_ADMIN_CHANGE_USER_PASSWORD
NS_ADMIN_DELETE_MOTD
NS_ADMIN_DELETE_USER
NS_ADMIN_DELETE_WELCOME
NS_ADMIN_DISABLED_USERS_LIST
NS_ADMIN_DISABLED_USERS_NUM
NS_ADMIN_DISABLE_USER
NS_ADMIN_EDIT_ADMIN
NS_ADMIN_EDIT_BLACKLIST
NS_ADMIN_EDIT_MOTD
NS_ADMIN_EDIT_WHITELIST
NS_ADMIN_END_USER_SESSION
NS_ADMIN_GET_USER_LASTLOGIN
NS_ADMIN_GET_USER_PASSWORD
NS_ADMIN_GET_USER_ROSTER
NS_ADMIN_IDLE_USERS_LIST
NS_ADMIN_IDLE_USERS_NUM
NS_ADMIN_ONLINE_USERS_LIST
NS_ADMIN_ONLINE_USERS_NUM
NS_ADMIN_REENABLE_USER
NS_ADMIN_REGISTERED_USERS_LIST
NS_ADMIN_REGISTERED_USERS_NUM
NS_ADMIN_RESTART
NS_ADMIN_SET_MOTD
NS_ADMIN_SET_WELCOME
NS_ADMIN_SHUTDOWN
NS_ADMIN_USER_STATS
NS_AGENTS
NS_AMP
NS_AMP_ERRORS
NS_AUTH
NS_AVATAR
NS_BIND
NS_BROWSE
NS_BYTESTREAM
NS_CAPS
NS_CHATSTATES
NS_CLIENT
NS_COMMANDS
NS_COMPONENT_1
NS_COMPONENT_ACCEPT
NS_COMPRESS
NS_DATA
NS_DATA_LAYOUT
NS_DATA_VALIDATE
NS_DELAY
NS_DIALBACK
NS_DISCO
NS_DISCO_INFO
NS_DISCO_ITEMS
NS_ENCRYPTED
NS_EVENT
NS_FEATURE
NS_FILE
NS_GATEWAY
NS_GEOLOC
NS_GROUPCHAT
NS_HTTP_BIND
NS_IBB
NS_INVISIBLE
NS_IQ
NS_LAST
NS_MESSAGE
NS_MOOD
NS_MUC
NS_MUC_ADMIN
NS_MUC_OWNER
NS_MUC_REGISTER
NS_MUC_REQUEST
NS_MUC_ROOMCONFIG
NS_MUC_ROOMINFO
NS_MUC_ROOMS
NS_MUC_TRAFIC
NS_MUC_UNIQUE
NS_MUC_USER
NS_OFFLINE
NS_PHYSLOC
NS_PRESENCE
NS_PRIVACY
NS_PRIVATE
NS_PUBSUB
NS_REGISTER
NS_ROSTER
NS_ROSTERX
NS_RPC
NS_SASL
NS_SEARCH
NS_SERVER
NS_SESSION
NS_SI
NS_SIGNED
NS_SI_PUB
NS_STANZAS
NS_STREAMS
NS_TIME
NS_TLS
NS_VACATION
NS_VCARD
NS_VERSION
NS_WAITINGLIST
NS_XHTML_IM
NS_XMPP_STREAMS
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name
sasl_error_conditions
stream_exceptions
xmpp_stanza_error_conditions
xmpp_stream_error_conditions

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.roster-module.html0000644000175000000500000001646010731034042021331 0ustar normansrc roster

Module roster


Classes

Roster

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.session-module.html0000644000175000000500000002125710731034042021476 0ustar normansrc session

Module session


Classes

Session

Variables

ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
SESSION_AUTHED
SESSION_BOUND
SESSION_CLOSED
SESSION_NOT_AUTHED
SESSION_OPENED
SOCKET_ALIVE
SOCKET_DEAD
SOCKET_UNCONNECTED
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
STREAM__CLOSED
STREAM__CLOSING
STREAM__NOT_OPENED
STREAM__OPENED
__version__
name

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.simplexml-module.html0000644000175000000500000000367610731034042022032 0ustar normansrc simplexml

Module simplexml


Classes

NT
Node
NodeBuilder
T

Functions

BadXML2Node
XML2Node
XMLescape
ustr

Variables

DBG_NODEBUILDER
ENCODING

[hide private] xmpppy-0.4.1/doc/apidocs/toc-xmpp.transports-module.html0000644000175000000500000002062110731034042022224 0ustar normansrc transports

Module transports


Classes

HTTPPROXYsocket
TCPsocket
TLS
error

Variables

BUFLEN
DATA_RECEIVED
DATA_SENT
DBG_CONNECT_PROXY
ERRORS
ERR_BAD_REQUEST
ERR_CONFLICT
ERR_FEATURE_NOT_IMPLEMENTED
ERR_FORBIDDEN
ERR_GONE
ERR_INTERNAL_SERVER_ERROR
ERR_ITEM_NOT_FOUND
ERR_JID_MALFORMED
ERR_NOT_ACCEPTABLE
ERR_NOT_ALLOWED
ERR_NOT_AUTHORIZED
ERR_PAYMENT_REQUIRED
ERR_RECIPIENT_UNAVAILABLE
ERR_REDIRECT
ERR_REGISTRATION_REQUIRED
ERR_REMOTE_SERVER_NOT_FOUND
ERR_REMOTE_SERVER_TIMEOUT
ERR_RESOURCE_CONSTRAINT
ERR_SERVICE_UNAVAILABLE
ERR_SUBSCRIPTION_REQUIRED
ERR_UNDEFINED_CONDITION
ERR_UNEXPECTED_REQUEST
HAVE_DNSPYTHON
HAVE_PYDNS
SASL_ABORTED
SASL_INCORRECT_ENCODING
SASL_INVALID_AUTHZID
SASL_INVALID_MECHANISM
SASL_MECHANISM_TOO_WEAK
SASL_NOT_AUTHORIZED
SASL_TEMPORARY_AUTH_FAILURE
STREAM_BAD_FORMAT
STREAM_BAD_NAMESPACE_PREFIX
STREAM_CONFLICT
STREAM_CONNECTION_TIMEOUT
STREAM_HOST_GONE
STREAM_HOST_UNKNOWN
STREAM_IMPROPER_ADDRESSING
STREAM_INTERNAL_SERVER_ERROR
STREAM_INVALID_FROM
STREAM_INVALID_ID
STREAM_INVALID_NAMESPACE
STREAM_INVALID_XML
STREAM_NOT_AUTHORIZED
STREAM_POLICY_VIOLATION
STREAM_REMOTE_CONNECTION_FAILED
STREAM_RESOURCE_CONSTRAINT
STREAM_RESTRICTED_XML
STREAM_SEE_OTHER_HOST
STREAM_SYSTEM_SHUTDOWN
STREAM_UNDEFINED_CONDITION
STREAM_UNSUPPORTED_ENCODING
STREAM_UNSUPPORTED_STANZA_TYPE
STREAM_UNSUPPORTED_VERSION
STREAM_XML_NOT_WELL_FORMED
name

[hide private] xmpppy-0.4.1/doc/apidocs/xmpp-module.html0000644000175000000500000020244510731034043017232 0ustar normansrc xmpp
Package xmpp
[hide private]
[frames] | no frames]

Package xmpp

source code

All features of xmpppy library contained within separate modules. At present there are modules: simplexml - XML handling routines protocol - jabber-objects (I.e. JID and different stanzas and sub-stanzas) handling routines. debug - Jacob Lundquist's debugging module. Very handy if you like colored debug. auth - Non-SASL and SASL stuff. You will need it to auth as a client or transport. transports - low level connection handling. TCP and TLS currently. HTTP support planned. roster - simple roster for use in clients. dispatcher - decision-making logic. Handles all hooks. The first who takes control over fresh stanzas. features - different stuff that didn't worths separating into modules browser - DISCO server framework. Allows to build dynamic disco tree. filetransfer - Currently contains only IBB stuff. Can be used for bot-to-bot transfers.

Most of the classes that is defined in all these modules is an ancestors of class PlugIn so they share a single set of methods allowing you to compile a featured XMPP client. For every instance of PlugIn class the 'owner' is the class in what the plug was plugged. While plugging in such instance usually sets some methods of owner to it's own ones for easy access. All session specific info stored either in instance of PlugIn or in owner's instance. This is considered unhandy and there are plans to port 'Session' class from xmppd.py project for storing all session-related info. Though if you are not accessing instances variables directly and use only methods for access all values you should not have any problems.

Submodules [hide private]
  • xmpp.auth: Provides library with all Non-SASL and SASL authentication mechanisms.
  • xmpp.browser: Browser module provides DISCO server framework for your application.
  • xmpp.client: Provides PlugIn class functionality to develop extentions for xmpppy.
  • xmpp.commands: This module is a ad-hoc command processor for xmpppy.
  • xmpp.debug
  • xmpp.dispatcher: Main xmpppy mechanism.
  • xmpp.features: This module contains variable stuff that is not worth splitting into separate modules.
  • xmpp.filetransfer: This module contains IBB class that is the simple implementation of JEP-0047.
  • xmpp.jep0106: This file is the XEP-0106 commands.
  • xmpp.protocol: Protocol module contains tools that is needed for processing of xmpp-related data structures.
  • xmpp.roster: Simple roster implementation.
  • xmpp.session
  • xmpp.simplexml: Simplexml module provides xmpppy library with all needed tools to handle XML nodes and XML streams.
  • xmpp.transports: This module contains the low-level implementations of xmpppy connect methods or (in other words) transports for xmpp-stanzas.

Variables [hide private]
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.auth-module.html0000644000175000000500000020221510731034043020165 0ustar normansrc xmpp.auth
Package xmpp :: Module auth
[hide private]
[frames] | no frames]

Module auth

source code

Provides library with all Non-SASL and SASL authentication mechanisms. Can be used both for client and transport authentication.

Classes [hide private]
  NonSASL
Implements old Non-SASL (JEP-0078) authentication used in jabberd1.4 and transport authentication.
  SASL
Implements SASL authentication.
  Bind
Bind some JID to the current connection to allow router know of our location.
  ComponentBind
ComponentBind some JID to the current connection to allow router know of our location.
Functions [hide private]
 
HH(some) source code
 
H(some) source code
 
C(some) source code
Variables [hide private]
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.browser-module.html0000644000175000000500000017427210731034044020723 0ustar normansrc xmpp.browser
Package xmpp :: Module browser
[hide private]
[frames] | no frames]

Module browser

source code

Browser module provides DISCO server framework for your application. This functionality can be used for very different purposes - from publishing software version and supported features to building of "jabber site" that users can navigate with their disco browsers and interact with active content.

Such functionality is achieved via registering "DISCO handlers" that are automatically called when user requests some node of your disco tree.

Classes [hide private]
  Browser
WARNING! This class is for components only.
Variables [hide private]
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.client-module.html0000644000175000000500000001605210731034044020505 0ustar normansrc xmpp.client
Package xmpp :: Module client
[hide private]
[frames] | no frames]

Module client

source code

Provides PlugIn class functionality to develop extentions for xmpppy. Also provides Client and Component classes implementations as the examples of xmpppy structures usage. These classes can be used for simple applications "AS IS" though.

Classes [hide private]
  PlugIn
Common xmpppy plugins infrastructure: plugging in/out, debugging.
  CommonClient
Base for Client and Component classes.
  Client
Example client class, based on CommonClient.
  Component
Component class.
Variables [hide private]
  DBG_CLIENT = 'client'
  DBG_COMPONENT = 'component'
xmpppy-0.4.1/doc/apidocs/xmpp.commands-module.html0000644000175000000500000017661210731034044021041 0ustar normansrc xmpp.commands
Package xmpp :: Module commands
[hide private]
[frames] | no frames]

Module commands

source code

This module is a ad-hoc command processor for xmpppy. It uses the plug-in mechanism like most of the core library. It depends on a DISCO browser manager.

There are 3 classes here, a command processor Commands like the Browser, and a command template plugin Command, and an example command.

To use this module:
    
    Instansiate the module with the parent transport and disco browser manager as parameters.
    'Plug in' commands using the command template.
    The command feature must be added to existing disco replies where neccessary.
    
What it supplies:
    
    Automatic command registration with the disco browser manager.
    Automatic listing of commands in the public command list.
    A means of handling requests, by redirection though the command manager.



Classes [hide private]
  Commands
Commands is an ancestor of PlugIn and can be attached to any session.
  Command_Handler_Prototype
This is a prototype command handler, as each command uses a disco method and execute method you can implement it any way you like, however this is my first attempt at making a generic handler that you can hang process stages on too.
  TestCommand
Example class.
Variables [hide private]
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.debug-module.html0000644000175000000500000004217010731034044020315 0ustar normansrc xmpp.debug
Package xmpp :: Module debug
[hide private]
[frames] | no frames]

Module debug

source code

Classes [hide private]
  NoDebug
  Debug
Variables [hide private]
  _version_ = '1.4.0'
Generic debug class
  colors_enabled = True
  color_none = '\x1b[0m'
  color_black = '\x1b[30m'
  color_red = '\x1b[31m'
  color_green = '\x1b[32m'
  color_brown = '\x1b[33m'
  color_blue = '\x1b[34m'
  color_magenta = '\x1b[35m'
  color_cyan = '\x1b[36m'
  color_light_gray = '\x1b[37m'
  color_dark_gray = '\x1b[30;1m'
  color_bright_red = '\x1b[31;1m'
  color_bright_green = '\x1b[32;1m'
  color_yellow = '\x1b[33;1m'
  color_bright_blue = '\x1b[34;1m'
  color_purple = '\x1b[35;1m'
  color_bright_cyan = '\x1b[36;1m'
  color_white = '\x1b[37;1m'
Define your flags in yor modules like this:...
  LINE_FEED = '\n'
  DBG_ALWAYS = 'always'
  DEBUGGING_IS_ON = 1
Variables Details [hide private]

_version_

Generic debug class

Other modules can always define extra debug flags for local usage, as long as they make sure they append them to debug_flags

Also its always a good thing to prefix local flags with something, to reduce risk of coliding flags. Nothing breaks if two flags would be identical, but it might activate unintended debugging.

flags can be numeric, but that makes analysing harder, on creation its not obvious what is activated, and when flag_show is given, output isnt really meaningfull.

This Debug class can either be initialized and used on app level, or used independantly by the individual classes.

For samples of usage, see samples subdir in distro source, and selftest in this code
Value:
'1.4.0'

color_white


Define your flags in yor modules like this:

from debug import *

DBG_INIT = 'init'                ; debug_flags.append( DBG_INIT )
DBG_CONNECTION = 'connection'    ; debug_flags.append( DBG_CONNECTION )

 The reason for having a double statement wis so we can validate params
 and catch all undefined debug flags
 
 This gives us control over all used flags, and makes it easier to allow
 global debugging in your code, just do something like
 
 foo = Debug( debug_flags )
 
 group flags, that is a flag in it self containing multiple flags should be
 defined without the debug_flags.append() sequence, since the parts are already
 in the list, also they must of course be defined after the flags they depend on ;)
 example:

DBG_MULTI = [ DBG_INIT, DBG_CONNECTION ]



  NoDebug
  -------
  To speed code up, typically for product releases or such
  use this class instead if you globaly want to disable debugging

Value:
'\x1b[37;1m'

xmpppy-0.4.1/doc/apidocs/xmpp.dispatcher-module.html0000644000175000000500000017525110731034045021365 0ustar normansrc xmpp.dispatcher
Package xmpp :: Module dispatcher
[hide private]
[frames] | no frames]

Module dispatcher

source code

Main xmpppy mechanism. Provides library with methods to assign different handlers to different XMPP stanzas. Contains one tunable attribute: DefaultTimeout (25 seconds by default). It defines time that Dispatcher.SendAndWaitForResponce method will wait for reply stanza before giving up.

Classes [hide private]
  Dispatcher
Ancestor of PlugIn class.
Variables [hide private]
  DefaultTimeout = 25
  ID = 0
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.features-module.html0000644000175000000500000025344110731034045021053 0ustar normansrc xmpp.features
Package xmpp :: Module features
[hide private]
[frames] | no frames]

Module features

source code


This module contains variable stuff that is not worth splitting into separate modules.
Here is:
    DISCO client and agents-to-DISCO and browse-to-DISCO emulators.
    IBR and password manager.
    jabber:iq:privacy methods
All these methods takes 'disp' first argument that should be already connected
(and in most cases already authorised) dispatcher instance.



Functions [hide private]
 
_discover(disp, ns, jid, node=None, fb2b=0, fb2a=1)
Try to obtain info from the remote object.
source code
 
discoverItems(disp, jid, node=None)
Query remote object about any items that it contains.
source code
 
discoverInfo(disp, jid, node=None)
Query remote object about info that it publishes.
source code
 
getRegInfo(disp, host, info={}, sync=True)
Gets registration form from remote host.
source code
 
_ReceivedRegInfo(con, resp, agent) source code
 
register(disp, host, info)
Perform registration on remote server with provided info.
source code
 
unregister(disp, host)
Unregisters with host (permanently removes account).
source code
 
changePasswordTo(disp, newpassword, host=None)
Changes password on specified or current (if not specified) server.
source code
 
getPrivacyLists(disp)
Requests privacy lists from connected server.
source code
 
getPrivacyList(disp, listname)
Requests specific privacy list listname.
source code
 
setActivePrivacyList(disp, listname=None, typ='active')
Switches privacy list 'listname' to specified type.
source code
 
setDefaultPrivacyList(disp, listname=None)
Sets the default privacy list as 'listname'.
source code
 
setPrivacyList(disp, list)
Set the ruleset.
source code
 
delPrivacyList(disp, listname)
Deletes privacy list 'listname'.
source code
Variables [hide private]
  REGISTER_DATA_RECEIVED = 'REGISTER DATA RECEIVED'
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Function Details [hide private]

_discover(disp, ns, jid, node=None, fb2b=0, fb2a=1)

source code 
Try to obtain info from the remote object. If remote object doesn't support disco fall back to browse (if fb2b is true) and if it doesnt support browse (or fb2b is not true) fall back to agents protocol (if gb2a is true). Returns obtained info. Used internally.

discoverItems(disp, jid, node=None)

source code 
Query remote object about any items that it contains. Return items list.

discoverInfo(disp, jid, node=None)

source code 
Query remote object about info that it publishes. Returns identities and features lists.

getRegInfo(disp, host, info={}, sync=True)

source code 
Gets registration form from remote host. You can pre-fill the info dictionary. F.e. if you are requesting info on registering user joey than specify info as {'username':'joey'}. See JEP-0077 for details. 'disp' must be connected dispatcher instance.

register(disp, host, info)

source code 
Perform registration on remote server with provided info. disp must be connected dispatcher instance. Returns true or false depending on registration result. If registration fails you can get additional info from the dispatcher's owner attributes lastErrNode, lastErr and lastErrCode.

unregister(disp, host)

source code 
Unregisters with host (permanently removes account). disp must be connected and authorized dispatcher instance. Returns true on success.

changePasswordTo(disp, newpassword, host=None)

source code 
Changes password on specified or current (if not specified) server. disp must be connected and authorized dispatcher instance. Returns true on success.

getPrivacyLists(disp)

source code 
Requests privacy lists from connected server. Returns dictionary of existing lists on success.

getPrivacyList(disp, listname)

source code 
Requests specific privacy list listname. Returns list of XML nodes (rules) taken from the server responce.

setActivePrivacyList(disp, listname=None, typ='active')

source code 
Switches privacy list 'listname' to specified type. By default the type is 'active'. Returns true on success.

setDefaultPrivacyList(disp, listname=None)

source code 
Sets the default privacy list as 'listname'. Returns true on success.

setPrivacyList(disp, list)

source code 
Set the ruleset. 'list' should be the simpleXML node formatted according to RFC 3921 (XMPP-IM) (I.e. Node('list',{'name':listname},payload=[...]) ) Returns true on success.

delPrivacyList(disp, listname)

source code 
Deletes privacy list 'listname'. Returns true on success.

Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.filetransfer-module.html0000644000175000000500000017440310731034046021722 0ustar normansrc xmpp.filetransfer
Package xmpp :: Module filetransfer
[hide private]
[frames] | no frames]

Module filetransfer

source code

This module contains IBB class that is the simple implementation of JEP-0047. Note that this is just a transport for data. You have to negotiate data transfer before (via StreamInitiation most probably). Unfortunately SI is not implemented yet.

Classes [hide private]
  IBB
IBB used to transfer small-sized data chunk over estabilished xmpp connection.
Variables [hide private]
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.jep0106-module.html0000644000175000000500000003000710731034046020312 0ustar normansrc xmpp.jep0106
Package xmpp :: Module jep0106
[hide private]
[frames] | no frames]

Module jep0106

source code

This file is the XEP-0106 commands.

Implemented commands as follows:

4.2 Encode : Encoding Transformation 4.3 Decode : Decoding Transformation

Functions [hide private]
 
JIDEncode(str) source code
 
JIDDecode(str) source code
Variables [hide private]
  xep0106mapping = [[' ', '20'], ['"', '22'], ['&', '26'], ['\''...
Variables Details [hide private]

xep0106mapping

Value:
[[' ', '20'],
 ['"', '22'],
 ['&', '26'],
 ['\'', '27'],
 ['/', '2f'],
 [':', '3a'],
 ['<', '3c'],
 ['>', '3e'],
...

xmpppy-0.4.1/doc/apidocs/xmpp.protocol-module.html0000644000175000000500000045262110731034050021073 0ustar normansrc xmpp.protocol
Package xmpp :: Module protocol
[hide private]
[frames] | no frames]

Module protocol

source code

Protocol module contains tools that is needed for processing of xmpp-related data structures.

Classes [hide private]
  NodeProcessed
Exception that should be raised by handler when the handling should be stopped.
  StreamError
Base exception class for stream errors.
  BadFormat
  BadNamespacePrefix
  Conflict
  ConnectionTimeout
  HostGone
  HostUnknown
  ImproperAddressing
  InternalServerError
  InvalidFrom
  InvalidID
  InvalidNamespace
  InvalidXML
  NotAuthorized
  PolicyViolation
  RemoteConnectionFailed
  ResourceConstraint
  RestrictedXML
  SeeOtherHost
  SystemShutdown
  UndefinedCondition
  UnsupportedEncoding
  UnsupportedStanzaType
  UnsupportedVersion
  XMLNotWellFormed
  JID
JID object.
  Protocol
A "stanza" object class.
  Message
XMPP Message stanza - "push" mechanism.
  Presence
XMPP Presence object.
  Iq
XMPP Iq object - get/set dialog mechanism.
  ErrorNode
XMPP-style error element.
  Error
Used to quickly transform received stanza into error reply.
  DataField
This class is used in the DataForm class to describe the single data item.
  DataForm
DataForm class.
Functions [hide private]
 
isResultNode(node)
Returns true if the node is a positive reply.
source code
 
isErrorNode(node)
Returns true if the node is a negative reply.
source code
Variables [hide private]
  NS_ACTIVITY = 'http://jabber.org/protocol/activity'
  NS_ADDRESS = 'http://jabber.org/protocol/address'
  NS_ADMIN = 'http://jabber.org/protocol/admin'
  NS_ADMIN_ADD_USER = 'http://jabber.org/protocol/admin#add-user'
  NS_ADMIN_DELETE_USER = 'http://jabber.org/protocol/admin#delet...
  NS_ADMIN_DISABLE_USER = 'http://jabber.org/protocol/admin#disa...
  NS_ADMIN_REENABLE_USER = 'http://jabber.org/protocol/admin#ree...
  NS_ADMIN_END_USER_SESSION = 'http://jabber.org/protocol/admin#...
  NS_ADMIN_GET_USER_PASSWORD = 'http://jabber.org/protocol/admin...
  NS_ADMIN_CHANGE_USER_PASSWORD = 'http://jabber.org/protocol/ad...
  NS_ADMIN_GET_USER_ROSTER = 'http://jabber.org/protocol/admin#g...
  NS_ADMIN_GET_USER_LASTLOGIN = 'http://jabber.org/protocol/admi...
  NS_ADMIN_USER_STATS = 'http://jabber.org/protocol/admin#user-s...
  NS_ADMIN_EDIT_BLACKLIST = 'http://jabber.org/protocol/admin#ed...
  NS_ADMIN_EDIT_WHITELIST = 'http://jabber.org/protocol/admin#ed...
  NS_ADMIN_REGISTERED_USERS_NUM = 'http://jabber.org/protocol/ad...
  NS_ADMIN_DISABLED_USERS_NUM = 'http://jabber.org/protocol/admi...
  NS_ADMIN_ONLINE_USERS_NUM = 'http://jabber.org/protocol/admin#...
  NS_ADMIN_ACTIVE_USERS_NUM = 'http://jabber.org/protocol/admin#...
  NS_ADMIN_IDLE_USERS_NUM = 'http://jabber.org/protocol/admin#ge...
  NS_ADMIN_REGISTERED_USERS_LIST = 'http://jabber.org/protocol/a...
  NS_ADMIN_DISABLED_USERS_LIST = 'http://jabber.org/protocol/adm...
  NS_ADMIN_ONLINE_USERS_LIST = 'http://jabber.org/protocol/admin...
  NS_ADMIN_ACTIVE_USERS_LIST = 'http://jabber.org/protocol/admin...
  NS_ADMIN_IDLE_USERS_LIST = 'http://jabber.org/protocol/admin#g...
  NS_ADMIN_ANNOUNCE = 'http://jabber.org/protocol/admin#announce'
  NS_ADMIN_SET_MOTD = 'http://jabber.org/protocol/admin#set-motd'
  NS_ADMIN_EDIT_MOTD = 'http://jabber.org/protocol/admin#edit-motd'
  NS_ADMIN_DELETE_MOTD = 'http://jabber.org/protocol/admin#delet...
  NS_ADMIN_SET_WELCOME = 'http://jabber.org/protocol/admin#set-w...
  NS_ADMIN_DELETE_WELCOME = 'http://jabber.org/protocol/admin#de...
  NS_ADMIN_EDIT_ADMIN = 'http://jabber.org/protocol/admin#edit-a...
  NS_ADMIN_RESTART = 'http://jabber.org/protocol/admin#restart'
  NS_ADMIN_SHUTDOWN = 'http://jabber.org/protocol/admin#shutdown'
  NS_AGENTS = 'jabber:iq:agents'
  NS_AMP = 'http://jabber.org/protocol/amp'
  NS_AMP_ERRORS = 'http://jabber.org/protocol/amp#errors'
  NS_AUTH = 'jabber:iq:auth'
  NS_AVATAR = 'jabber:iq:avatar'
  NS_BIND = 'urn:ietf:params:xml:ns:xmpp-bind'
  NS_BROWSE = 'jabber:iq:browse'
  NS_BYTESTREAM = 'http://jabber.org/protocol/bytestreams'
  NS_CAPS = 'http://jabber.org/protocol/caps'
  NS_CHATSTATES = 'http://jabber.org/protocol/chatstates'
  NS_CLIENT = 'jabber:client'
  NS_COMMANDS = 'http://jabber.org/protocol/commands'
  NS_COMPONENT_ACCEPT = 'jabber:component:accept'
  NS_COMPONENT_1 = 'http://jabberd.jabberstudio.org/ns/component...
  NS_COMPRESS = 'http://jabber.org/protocol/compress'
  NS_DATA = 'jabber:x:data'
  NS_DELAY = 'jabber:x:delay'
  NS_DIALBACK = 'jabber:server:dialback'
  NS_DISCO = 'http://jabber.org/protocol/disco'
  NS_DISCO_INFO = 'http://jabber.org/protocol/disco#info'
  NS_DISCO_ITEMS = 'http://jabber.org/protocol/disco#items'
  NS_ENCRYPTED = 'jabber:x:encrypted'
  NS_EVENT = 'jabber:x:event'
  NS_FEATURE = 'http://jabber.org/protocol/feature-neg'
  NS_FILE = 'http://jabber.org/protocol/si/profile/file-transfer'
  NS_GATEWAY = 'jabber:iq:gateway'
  NS_GEOLOC = 'http://jabber.org/protocol/geoloc'
  NS_GROUPCHAT = 'gc-1.0'
  NS_HTTP_BIND = 'http://jabber.org/protocol/httpbind'
  NS_IBB = 'http://jabber.org/protocol/ibb'
  NS_INVISIBLE = 'presence-invisible'
  NS_IQ = 'iq'
  NS_LAST = 'jabber:iq:last'
  NS_MESSAGE = 'message'
  NS_MOOD = 'http://jabber.org/protocol/mood'
  NS_MUC = 'http://jabber.org/protocol/muc'
  NS_MUC_ADMIN = 'http://jabber.org/protocol/muc#admin'
  NS_MUC_OWNER = 'http://jabber.org/protocol/muc#owner'
  NS_MUC_UNIQUE = 'http://jabber.org/protocol/muc#unique'
  NS_MUC_USER = 'http://jabber.org/protocol/muc#user'
  NS_MUC_REGISTER = 'http://jabber.org/protocol/muc#register'
  NS_MUC_REQUEST = 'http://jabber.org/protocol/muc#request'
  NS_MUC_ROOMCONFIG = 'http://jabber.org/protocol/muc#roomconfig'
  NS_MUC_ROOMINFO = 'http://jabber.org/protocol/muc#roominfo'
  NS_MUC_ROOMS = 'http://jabber.org/protocol/muc#rooms'
  NS_MUC_TRAFIC = 'http://jabber.org/protocol/muc#traffic'
  NS_OFFLINE = 'http://jabber.org/protocol/offline'
  NS_PHYSLOC = 'http://jabber.org/protocol/physloc'
  NS_PRESENCE = 'presence'
  NS_PRIVACY = 'jabber:iq:privacy'
  NS_PRIVATE = 'jabber:iq:private'
  NS_PUBSUB = 'http://jabber.org/protocol/pubsub'
  NS_REGISTER = 'jabber:iq:register'
  NS_ROSTER = 'jabber:iq:roster'
  NS_ROSTERX = 'http://jabber.org/protocol/rosterx'
  NS_RPC = 'jabber:iq:rpc'
  NS_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl'
  NS_SEARCH = 'jabber:iq:search'
  NS_SERVER = 'jabber:server'
  NS_SESSION = 'urn:ietf:params:xml:ns:xmpp-session'
  NS_SI = 'http://jabber.org/protocol/si'
  NS_SI_PUB = 'http://jabber.org/protocol/sipub'
  NS_SIGNED = 'jabber:x:signed'
  NS_STANZAS = 'urn:ietf:params:xml:ns:xmpp-stanzas'
  NS_STREAMS = 'http://etherx.jabber.org/streams'
  NS_TIME = 'jabber:iq:time'
  NS_TLS = 'urn:ietf:params:xml:ns:xmpp-tls'
  NS_VACATION = 'http://jabber.org/protocol/vacation'
  NS_VCARD = 'vcard-temp'
  NS_VERSION = 'jabber:iq:version'
  NS_WAITINGLIST = 'http://jabber.org/protocol/waitinglist'
  NS_XHTML_IM = 'http://jabber.org/protocol/xhtml-im'
  NS_DATA_LAYOUT = 'http://jabber.org/protocol/xdata-layout'
  NS_DATA_VALIDATE = 'http://jabber.org/protocol/xdata-validate'
  NS_XMPP_STREAMS = 'urn:ietf:params:xml:ns:xmpp-streams'
  xmpp_stream_error_conditions = '\nbad-format -- -- -- The en...
  xmpp_stanza_error_conditions = '\nbad-request -- 400 -- modify...
  sasl_error_conditions = '\naborted -- -- -- The receiving en...
  stream_exceptions = {'bad-format': <class xmpp.protocol.BadFor...
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  _errorcodes = {'302': 'redirect', '400': 'unexpected-request',...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

NS_ADMIN_DELETE_USER

Value:
'http://jabber.org/protocol/admin#delete-user'

NS_ADMIN_DISABLE_USER

Value:
'http://jabber.org/protocol/admin#disable-user'

NS_ADMIN_REENABLE_USER

Value:
'http://jabber.org/protocol/admin#reenable-user'

NS_ADMIN_END_USER_SESSION

Value:
'http://jabber.org/protocol/admin#end-user-session'

NS_ADMIN_GET_USER_PASSWORD

Value:
'http://jabber.org/protocol/admin#get-user-password'

NS_ADMIN_CHANGE_USER_PASSWORD

Value:
'http://jabber.org/protocol/admin#change-user-password'

NS_ADMIN_GET_USER_ROSTER

Value:
'http://jabber.org/protocol/admin#get-user-roster'

NS_ADMIN_GET_USER_LASTLOGIN

Value:
'http://jabber.org/protocol/admin#get-user-lastlogin'

NS_ADMIN_USER_STATS

Value:
'http://jabber.org/protocol/admin#user-stats'

NS_ADMIN_EDIT_BLACKLIST

Value:
'http://jabber.org/protocol/admin#edit-blacklist'

NS_ADMIN_EDIT_WHITELIST

Value:
'http://jabber.org/protocol/admin#edit-whitelist'

NS_ADMIN_REGISTERED_USERS_NUM

Value:
'http://jabber.org/protocol/admin#get-registered-users-num'

NS_ADMIN_DISABLED_USERS_NUM

Value:
'http://jabber.org/protocol/admin#get-disabled-users-num'

NS_ADMIN_ONLINE_USERS_NUM

Value:
'http://jabber.org/protocol/admin#get-online-users-num'

NS_ADMIN_ACTIVE_USERS_NUM

Value:
'http://jabber.org/protocol/admin#get-active-users-num'

NS_ADMIN_IDLE_USERS_NUM

Value:
'http://jabber.org/protocol/admin#get-idle-users-num'

NS_ADMIN_REGISTERED_USERS_LIST

Value:
'http://jabber.org/protocol/admin#get-registered-users-list'

NS_ADMIN_DISABLED_USERS_LIST

Value:
'http://jabber.org/protocol/admin#get-disabled-users-list'

NS_ADMIN_ONLINE_USERS_LIST

Value:
'http://jabber.org/protocol/admin#get-online-users-list'

NS_ADMIN_ACTIVE_USERS_LIST

Value:
'http://jabber.org/protocol/admin#get-active-users-list'

NS_ADMIN_IDLE_USERS_LIST

Value:
'http://jabber.org/protocol/admin#get-idle-users-list'

NS_ADMIN_DELETE_MOTD

Value:
'http://jabber.org/protocol/admin#delete-motd'

NS_ADMIN_SET_WELCOME

Value:
'http://jabber.org/protocol/admin#set-welcome'

NS_ADMIN_DELETE_WELCOME

Value:
'http://jabber.org/protocol/admin#delete-welcome'

NS_ADMIN_EDIT_ADMIN

Value:
'http://jabber.org/protocol/admin#edit-admin'

NS_COMPONENT_1

Value:
'http://jabberd.jabberstudio.org/ns/component/1.0'

xmpp_stream_error_conditions

Value:
'''
bad-format --  --  -- The entity has sent XML that cannot be processed\
.
bad-namespace-prefix --  --  -- The entity has sent a namespace prefix\
 that is unsupported, or has sent no namespace prefix on an element th\
at requires such a prefix.
conflict --  --  -- The server is closing the active stream for this e\
ntity because a new stream has been initiated that conflicts with the \
...

xmpp_stanza_error_conditions

Value:
'''
bad-request -- 400 -- modify -- The sender has sent XML that is malfor\
med or that cannot be processed.
conflict -- 409 -- cancel -- Access cannot be granted because an exist\
ing resource or session exists with the same name or address.
feature-not-implemented -- 501 -- cancel -- The feature requested is n\
ot implemented by the recipient or server and therefore cannot be proc\
essed.
...

sasl_error_conditions

Value:
'''
aborted --  --  -- The receiving entity acknowledges an <abort/> eleme\
nt sent by the initiating entity; sent in reply to the <abort/> elemen\
t.
incorrect-encoding --  --  -- The data provided by the initiating enti\
ty could not be processed because the [BASE64]Josefsson, S., The Base1\
6, Base32, and Base64 Data Encodings, July 2003. encoding is incorrect\
 (e.g., because the encoding does not adhere to the definition in Sect\
...

stream_exceptions

Value:
{'bad-format': BadFormat, 'bad-namespace-prefix': BadNamespacePrefix, \
'conflict': Conflict, 'connection-timeout': ConnectionTimeout, 'host-g\
one': HostGone, 'host-unknown': HostUnknown, 'improper-addressing': Im\
properAddressing, 'internal-server-error': InternalServerError, 'inval\
id-from': InvalidFrom, 'invalid-id': InvalidID, 'invalid-namespace': I\
nvalidNamespace, 'invalid-xml': InvalidXML, 'not-authorized': NotAutho\
rized, 'policy-violation': PolicyViolation, 'remote-connection-failed'\
: RemoteConnectionFailed, 'resource-constraint': ResourceConstraint, '\
...

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

_errorcodes

Value:
{'302': 'redirect',
 '400': 'unexpected-request',
 '401': 'not-authorized',
 '402': 'payment-required',
 '403': 'forbidden',
 '404': 'remote-server-not-found',
 '405': 'not-allowed',
 '406': 'not-acceptable',
...

xmpppy-0.4.1/doc/apidocs/xmpp.roster-module.html0000644000175000000500000017344210731034050020551 0ustar normansrc xmpp.roster
Package xmpp :: Module roster
[hide private]
[frames] | no frames]

Module roster

source code

Simple roster implementation. Can be used though for different tasks like mass-renaming of contacts.

Classes [hide private]
  Roster
Defines a plenty of methods that will allow you to manage roster.
Variables [hide private]
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.session-module.html0000644000175000000500000020470010731034050020706 0ustar normansrc xmpp.session
Package xmpp :: Module session
[hide private]
[frames] | no frames]

Module session

source code

Classes [hide private]
  Session
The Session class instance is used for storing all session-related info like credentials, socket/xml stream/session state flags, roster items (in case of client type connection) etc.
Variables [hide private]
  __version__ = '$Id'
When your handler is called it is getting the session instance as the first argument.
  SOCKET_UNCONNECTED = 0
  SOCKET_ALIVE = 1
  SOCKET_DEAD = 2
  STREAM__NOT_OPENED = 1
  STREAM__OPENED = 2
  STREAM__CLOSING = 3
  STREAM__CLOSED = 4
  SESSION_NOT_AUTHED = 1
  SESSION_AUTHED = 2
  SESSION_BOUND = 3
  SESSION_OPENED = 4
  SESSION_CLOSED = 5
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

__version__

When your handler is called it is getting the session instance as the first argument. This is the difference from xmpppy 0.1 where you got the "Client" instance. With Session class you can have "multi-session" client instead of having one client for each connection. Is is specifically important when you are writing the server.
Value:
'$Id'

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.simplexml-module.html0000644000175000000500000003164610731034051021245 0ustar normansrc xmpp.simplexml
Package xmpp :: Module simplexml
[hide private]
[frames] | no frames]

Module simplexml

source code

Simplexml module provides xmpppy library with all needed tools to handle XML nodes and XML streams. I'm personally using it in many other separate projects. It is designed to be as standalone as possible.

Classes [hide private]
  Node
Node class describes syntax of separate XML Node.
  T
Auxiliary class used to quick access to node's child nodes.
  NT
Auxiliary class used to quick create node's child nodes.
  NodeBuilder
Builds a Node class minidom from data parsed to it.
Functions [hide private]
 
XMLescape(txt)
Returns provided string with symbols & < > " replaced by their respective XML entities.
source code
 
ustr(what)
Converts object "what" to unicode string using it's own __str__ method if accessible or unicode method otherwise.
source code
 
XML2Node(xml)
Converts supplied textual string into XML node.
source code
 
BadXML2Node(xml)
Converts supplied textual string into XML node.
source code
Variables [hide private]
  ENCODING = 'utf-8'
  DBG_NODEBUILDER = 'nodebuilder'
Function Details [hide private]

XML2Node(xml)

source code 
Converts supplied textual string into XML node. Handy f.e. for reading configuration file. Raises xml.parser.expat.parsererror if provided string is not well-formed XML.

BadXML2Node(xml)

source code 
Converts supplied textual string into XML node. Survives if xml data is cutted half way round. I.e. "<html>some text <br>some more text". Will raise xml.parser.expat.parsererror on misplaced tags though. F.e. "<b>some text <br>some more text</b>" will not work.

xmpppy-0.4.1/doc/apidocs/xmpp.transports-module.html0000644000175000000500000020262710731034051021451 0ustar normansrc xmpp.transports
Package xmpp :: Module transports
[hide private]
[frames] | no frames]

Module transports

source code

This module contains the low-level implementations of xmpppy connect methods or (in other words) transports for xmpp-stanzas. Currently here is three transports: direct TCP connect - TCPsocket class proxied TCP connect - HTTPPROXYsocket class (CONNECT proxies) TLS connection - TLS class. Can be used for SSL connections also.

Transports are stackable so you - f.e. TLS use HTPPROXYsocket or TCPsocket as more low-level transport.

Also exception 'error' is defined to allow capture of this module specific exceptions.

Classes [hide private]
  error
An exception to be raised in case of low-level errors in methods of 'transports' module.
  TCPsocket
This class defines direct TCP connection method.
  HTTPPROXYsocket
HTTP (CONNECT) proxy connection class.
  TLS
TLS connection used to encrypts already estabilished tcp connection.
Variables [hide private]
  HAVE_DNSPYTHON = True
  HAVE_PYDNS = True
  DATA_RECEIVED = 'DATA RECEIVED'
  DATA_SENT = 'DATA SENT'
  BUFLEN = 1024
  DBG_CONNECT_PROXY = 'CONNECTproxy'
  ERRORS = {'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['', '',...
  ERR_BAD_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas bad-req...
  ERR_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-stanzas conflict'
  ERR_FEATURE_NOT_IMPLEMENTED = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_FORBIDDEN = 'urn:ietf:params:xml:ns:xmpp-stanzas forbidden'
  ERR_GONE = 'urn:ietf:params:xml:ns:xmpp-stanzas gone'
  ERR_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_ITEM_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-stanzas item...
  ERR_JID_MALFORMED = 'urn:ietf:params:xml:ns:xmpp-stanzas jid-m...
  ERR_NOT_ACCEPTABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_NOT_ALLOWED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-all...
  ERR_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-stanzas not-...
  ERR_PAYMENT_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanzas pa...
  ERR_RECIPIENT_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REDIRECT = 'urn:ietf:params:xml:ns:xmpp-stanzas redirect'
  ERR_REGISTRATION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_REMOTE_SERVER_NOT_FOUND = 'urn:ietf:params:xml:ns:xmpp-sta...
  ERR_REMOTE_SERVER_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SERVICE_UNAVAILABLE = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_SUBSCRIPTION_REQUIRED = 'urn:ietf:params:xml:ns:xmpp-stanz...
  ERR_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stanzas...
  ERR_UNEXPECTED_REQUEST = 'urn:ietf:params:xml:ns:xmpp-stanzas ...
  SASL_ABORTED = 'urn:ietf:params:xml:ns:xmpp-sasl aborted'
  SASL_INCORRECT_ENCODING = 'urn:ietf:params:xml:ns:xmpp-sasl in...
  SASL_INVALID_AUTHZID = 'urn:ietf:params:xml:ns:xmpp-sasl inval...
  SASL_INVALID_MECHANISM = 'urn:ietf:params:xml:ns:xmpp-sasl inv...
  SASL_MECHANISM_TOO_WEAK = 'urn:ietf:params:xml:ns:xmpp-sasl me...
  SASL_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-sasl not-au...
  SASL_TEMPORARY_AUTH_FAILURE = 'urn:ietf:params:xml:ns:xmpp-sas...
  STREAM_BAD_FORMAT = 'urn:ietf:params:xml:ns:xmpp-streams bad-f...
  STREAM_BAD_NAMESPACE_PREFIX = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_CONFLICT = 'urn:ietf:params:xml:ns:xmpp-streams conflict'
  STREAM_CONNECTION_TIMEOUT = 'urn:ietf:params:xml:ns:xmpp-strea...
  STREAM_HOST_GONE = 'urn:ietf:params:xml:ns:xmpp-streams host-g...
  STREAM_HOST_UNKNOWN = 'urn:ietf:params:xml:ns:xmpp-streams hos...
  STREAM_IMPROPER_ADDRESSING = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_INTERNAL_SERVER_ERROR = 'urn:ietf:params:xml:ns:xmpp-st...
  STREAM_INVALID_FROM = 'urn:ietf:params:xml:ns:xmpp-streams inv...
  STREAM_INVALID_ID = 'urn:ietf:params:xml:ns:xmpp-streams inval...
  STREAM_INVALID_NAMESPACE = 'urn:ietf:params:xml:ns:xmpp-stream...
  STREAM_INVALID_XML = 'urn:ietf:params:xml:ns:xmpp-streams inva...
  STREAM_NOT_AUTHORIZED = 'urn:ietf:params:xml:ns:xmpp-streams n...
  STREAM_POLICY_VIOLATION = 'urn:ietf:params:xml:ns:xmpp-streams...
  STREAM_REMOTE_CONNECTION_FAILED = 'urn:ietf:params:xml:ns:xmpp...
  STREAM_RESOURCE_CONSTRAINT = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_RESTRICTED_XML = 'urn:ietf:params:xml:ns:xmpp-streams r...
  STREAM_SEE_OTHER_HOST = 'urn:ietf:params:xml:ns:xmpp-streams s...
  STREAM_SYSTEM_SHUTDOWN = 'urn:ietf:params:xml:ns:xmpp-streams ...
  STREAM_UNDEFINED_CONDITION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_UNSUPPORTED_ENCODING = 'urn:ietf:params:xml:ns:xmpp-str...
  STREAM_UNSUPPORTED_STANZA_TYPE = 'urn:ietf:params:xml:ns:xmpp-...
  STREAM_UNSUPPORTED_VERSION = 'urn:ietf:params:xml:ns:xmpp-stre...
  STREAM_XML_NOT_WELL_FORMED = 'urn:ietf:params:xml:ns:xmpp-stre...
  name = 'SASL_TEMPORARY_AUTH_FAILURE'
Variables Details [hide private]

ERRORS

Value:
{'urn:ietf:params:xml:ns:xmpp-sasl aborted': ['',
                                              '',
                                              'The receiving entity ac\
knowledges an <abort/> element sent by the initiating entity; sent in \
reply to the <abort/> element.'],
 'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding': ['',
                                                         '',
                                                         'The data pro\
...

ERR_BAD_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas bad-request'

ERR_FEATURE_NOT_IMPLEMENTED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas feature-not-implemented'

ERR_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas internal-server-error'

ERR_ITEM_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas item-not-found'

ERR_JID_MALFORMED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas jid-malformed'

ERR_NOT_ACCEPTABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-acceptable'

ERR_NOT_ALLOWED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-allowed'

ERR_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas not-authorized'

ERR_PAYMENT_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas payment-required'

ERR_RECIPIENT_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable'

ERR_REGISTRATION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas registration-required'

ERR_REMOTE_SERVER_NOT_FOUND

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-not-found'

ERR_REMOTE_SERVER_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas remote-server-timeout'

ERR_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas resource-constraint'

ERR_SERVICE_UNAVAILABLE

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas service-unavailable'

ERR_SUBSCRIPTION_REQUIRED

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas subscription-required'

ERR_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas undefined-condition'

ERR_UNEXPECTED_REQUEST

Value:
'urn:ietf:params:xml:ns:xmpp-stanzas unexpected-request'

SASL_INCORRECT_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-sasl incorrect-encoding'

SASL_INVALID_AUTHZID

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-authzid'

SASL_INVALID_MECHANISM

Value:
'urn:ietf:params:xml:ns:xmpp-sasl invalid-mechanism'

SASL_MECHANISM_TOO_WEAK

Value:
'urn:ietf:params:xml:ns:xmpp-sasl mechanism-too-weak'

SASL_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-sasl not-authorized'

SASL_TEMPORARY_AUTH_FAILURE

Value:
'urn:ietf:params:xml:ns:xmpp-sasl temporary-auth-failure'

STREAM_BAD_FORMAT

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-format'

STREAM_BAD_NAMESPACE_PREFIX

Value:
'urn:ietf:params:xml:ns:xmpp-streams bad-namespace-prefix'

STREAM_CONNECTION_TIMEOUT

Value:
'urn:ietf:params:xml:ns:xmpp-streams connection-timeout'

STREAM_HOST_GONE

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-gone'

STREAM_HOST_UNKNOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams host-unknown'

STREAM_IMPROPER_ADDRESSING

Value:
'urn:ietf:params:xml:ns:xmpp-streams improper-addressing'

STREAM_INTERNAL_SERVER_ERROR

Value:
'urn:ietf:params:xml:ns:xmpp-streams internal-server-error'

STREAM_INVALID_FROM

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-from'

STREAM_INVALID_ID

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-id'

STREAM_INVALID_NAMESPACE

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-namespace'

STREAM_INVALID_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams invalid-xml'

STREAM_NOT_AUTHORIZED

Value:
'urn:ietf:params:xml:ns:xmpp-streams not-authorized'

STREAM_POLICY_VIOLATION

Value:
'urn:ietf:params:xml:ns:xmpp-streams policy-violation'

STREAM_REMOTE_CONNECTION_FAILED

Value:
'urn:ietf:params:xml:ns:xmpp-streams remote-connection-failed'

STREAM_RESOURCE_CONSTRAINT

Value:
'urn:ietf:params:xml:ns:xmpp-streams resource-constraint'

STREAM_RESTRICTED_XML

Value:
'urn:ietf:params:xml:ns:xmpp-streams restricted-xml'

STREAM_SEE_OTHER_HOST

Value:
'urn:ietf:params:xml:ns:xmpp-streams see-other-host'

STREAM_SYSTEM_SHUTDOWN

Value:
'urn:ietf:params:xml:ns:xmpp-streams system-shutdown'

STREAM_UNDEFINED_CONDITION

Value:
'urn:ietf:params:xml:ns:xmpp-streams undefined-condition'

STREAM_UNSUPPORTED_ENCODING

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-encoding'

STREAM_UNSUPPORTED_STANZA_TYPE

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-stanza-type'

STREAM_UNSUPPORTED_VERSION

Value:
'urn:ietf:params:xml:ns:xmpp-streams unsupported-version'

STREAM_XML_NOT_WELL_FORMED

Value:
'urn:ietf:params:xml:ns:xmpp-streams xml-not-well-formed'

xmpppy-0.4.1/doc/apidocs/xmpp.auth.Bind-class.html0000644000175000000500000002776110731034051020672 0ustar normansrc xmpp.auth.Bind
Package xmpp :: Module auth :: Class Bind
[hide private]
[frames] | no frames]

Class Bind

source code

client.PlugIn --+
                |
               Bind

Bind some JID to the current connection to allow router know of our location.

Instance Methods [hide private]
 
__init__(self) source code
 
plugin(self, owner)
Start resource binding, if allowed at this time.
source code
 
plugout(self)
Remove Bind handler from owner's dispatcher.
source code
 
FeaturesHandler(self, conn, feats)
Determine if server supports resource binding and set some internal attributes accordingly.
source code
 
Bind(self, resource=None)
Perform binding.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Start resource binding, if allowed at this time. Used internally.

plugout(self)

source code 
Remove Bind handler from owner's dispatcher. Used internally.

Bind(self, resource=None)

source code 
Perform binding. Use provided resource name or random (if not provided).

xmpppy-0.4.1/doc/apidocs/xmpp.auth.ComponentBind-class.html0000644000175000000500000003176010731034051022547 0ustar normansrc xmpp.auth.ComponentBind
Package xmpp :: Module auth :: Class ComponentBind
[hide private]
[frames] | no frames]

Class ComponentBind

source code

client.PlugIn --+
                |
               ComponentBind

ComponentBind some JID to the current connection to allow router know of our location.

Instance Methods [hide private]
 
__init__(self, sasl) source code
 
plugin(self, owner)
Start resource binding, if allowed at this time.
source code
 
plugout(self)
Remove ComponentBind handler from owner's dispatcher.
source code
 
FeaturesHandler(self, conn, feats)
Determine if server supports resource binding and set some internal attributes accordingly.
source code
 
Bind(self, domain=None)
Perform binding.
source code
 
BindHandler(self, conn, bind) source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self, sasl)
(Constructor)

source code 
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Start resource binding, if allowed at this time. Used internally.

plugout(self)

source code 
Remove ComponentBind handler from owner's dispatcher. Used internally.

Bind(self, domain=None)

source code 
Perform binding. Use provided domain name (if not provided).

xmpppy-0.4.1/doc/apidocs/xmpp.auth.NonSASL-class.html0000644000175000000500000002634010731034051021223 0ustar normansrc xmpp.auth.NonSASL
Package xmpp :: Module auth :: Class NonSASL
[hide private]
[frames] | no frames]

Class NonSASL

source code

client.PlugIn --+
                |
               NonSASL

Implements old Non-SASL (JEP-0078) authentication used in jabberd1.4 and transport authentication.

Instance Methods [hide private]
 
__init__(self, user, password, resource)
Caches username, password and resource for auth.
source code
 
plugin(self, owner)
Determine the best auth method (digest/0k/plain) and use it for auth.
source code
 
authComponent(self, owner)
Authenticate component.
source code
 
handshakeHandler(self, disp, stanza)
Handler for registering in dispatcher for accepting transport authentication.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self, user, password, resource)
(Constructor)

source code 
Caches username, password and resource for auth.
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Determine the best auth method (digest/0k/plain) and use it for auth. Returns used method name on success. Used internally.

authComponent(self, owner)

source code 
Authenticate component. Send handshake stanza and wait for result. Returns "ok" on success.

xmpppy-0.4.1/doc/apidocs/xmpp.auth.SASL-class.html0000644000175000000500000003311010731034051020541 0ustar normansrc xmpp.auth.SASL
Package xmpp :: Module auth :: Class SASL
[hide private]
[frames] | no frames]

Class SASL

source code

client.PlugIn --+
                |
               SASL

Implements SASL authentication.

Instance Methods [hide private]
 
__init__(self, username, password) source code
 
plugin(self, owner) source code
 
auth(self)
Start authentication.
source code
 
plugout(self)
Remove SASL handlers from owner's dispatcher.
source code
 
FeaturesHandler(self, conn, feats)
Used to determine if server supports SASL auth.
source code
 
SASLHandler(self, conn, challenge)
Perform next SASL auth step.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self, username, password)
(Constructor)

source code 
Overrides: client.PlugIn.__init__

auth(self)

source code 
Start authentication. Result can be obtained via "SASL.startsasl" attribute and will be either "success" or "failure". Note that successfull auth will take at least two Dispatcher.Process() calls.

plugout(self)

source code 
Remove SASL handlers from owner's dispatcher. Used internally.

FeaturesHandler(self, conn, feats)

source code 
Used to determine if server supports SASL auth. Used internally.

SASLHandler(self, conn, challenge)

source code 
Perform next SASL auth step. Used internally.

xmpppy-0.4.1/doc/apidocs/xmpp.browser.Browser-class.html0000644000175000000500000005745210731034051022163 0ustar normansrc xmpp.browser.Browser
Package xmpp :: Module browser :: Class Browser
[hide private]
[frames] | no frames]

Class Browser

source code

client.PlugIn --+
                |
               Browser

WARNING! This class is for components only. It will not work in client mode!

Standart xmpppy class that is ancestor of PlugIn and can be attached
to your application.
All processing will be performed in the handlers registered in the browser
instance. You can register any number of handlers ensuring that for each
node/jid combination only one (or none) handler registered.
You can register static information or the fully-blown function that will
calculate the answer dynamically.
Example of static info (see JEP-0030, examples 13-14):
# cl - your xmpppy connection instance.
b=xmpp.browser.Browser()
b.PlugIn(cl)
items=[]
item={}
item['jid']='catalog.shakespeare.lit'
item['node']='books'
item['name']='Books by and about Shakespeare'
items.append(item)
item={}
item['jid']='catalog.shakespeare.lit'
item['node']='clothing'
item['name']='Wear your literary taste with pride'
items.append(item)
item={}
item['jid']='catalog.shakespeare.lit'
item['node']='music'
item['name']='Music from the time of Shakespeare'
items.append(item)
info={'ids':[], 'features':[]}
b.setDiscoHandler({'items':items,'info':info})

items should be a list of item elements.
every item element can have any of these four keys: 'jid', 'node', 'name', 'action'
info should be a dicionary and must have keys 'ids' and 'features'.
Both of them should be lists:
    ids is a list of dictionaries and features is a list of text strings.
Example (see JEP-0030, examples 1-2)
# cl - your xmpppy connection instance.
b=xmpp.browser.Browser()
b.PlugIn(cl)
items=[]
ids=[]
ids.append({'category':'conference','type':'text','name':'Play-Specific Chatrooms'})
ids.append({'category':'directory','type':'chatroom','name':'Play-Specific Chatrooms'})
features=[NS_DISCO_INFO,NS_DISCO_ITEMS,NS_MUC,NS_REGISTER,NS_SEARCH,NS_TIME,NS_VERSION]
info={'ids':ids,'features':features}
# info['xdata']=xmpp.protocol.DataForm() # JEP-0128
b.setDiscoHandler({'items':[],'info':info})



Instance Methods [hide private]
 
__init__(self)
Initialises internal variables.
source code
 
plugin(self, owner)
Registers it's own iq handlers in your application dispatcher instance.
source code
 
plugout(self)
Unregisters browser's iq handlers from your application dispatcher instance.
source code
 
_traversePath(self, node, jid, set=0)
Returns dictionary and key or None,None None - root node (w/o "node" attribute) /a/b/c - node /a/b/ - branch Set returns '' or None as the key get returns '' or None as the key or None as the dict.
source code
 
setDiscoHandler(self, handler, node='', jid='')
This is the main method that you will use in this class.
source code
 
getDiscoHandler(self, node='', jid='')
Returns the previously registered DISCO handler that is resonsible for this node/jid combination.
source code
 
delDiscoHandler(self, node='', jid='')
Unregisters DISCO handler that is resonsible for this node/jid combination.
source code
 
_DiscoveryHandler(self, conn, request)
Servers DISCO iq request from the remote client.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Initialises internal variables. Used internally.
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Registers it's own iq handlers in your application dispatcher instance. Used internally.

plugout(self)

source code 
Unregisters browser's iq handlers from your application dispatcher instance. Used internally.

_traversePath(self, node, jid, set=0)

source code 
Returns dictionary and key or None,None None - root node (w/o "node" attribute) /a/b/c - node /a/b/ - branch Set returns '' or None as the key get returns '' or None as the key or None as the dict. Used internally.

setDiscoHandler(self, handler, node='', jid='')

source code 
This is the main method that you will use in this class.
It is used to register supplied DISCO handler (or dictionary with static info)
as handler of some disco tree branch.
If you do not specify the node this handler will be used for all queried nodes.
If you do not specify the jid this handler will be used for all queried JIDs.

Usage:
cl.Browser.setDiscoHandler(someDict,node,jid)
or
cl.Browser.setDiscoHandler(someDISCOHandler,node,jid)
where

someDict={
    'items':[
              {'jid':'jid1','action':'action1','node':'node1','name':'name1'},
              {'jid':'jid2','action':'action2','node':'node2','name':'name2'},
              {'jid':'jid3','node':'node3','name':'name3'},
              {'jid':'jid4','node':'node4'}
            ],
    'info' :{
              'ids':[
                      {'category':'category1','type':'type1','name':'name1'},
                      {'category':'category2','type':'type2','name':'name2'},
                      {'category':'category3','type':'type3','name':'name3'},
                    ], 
              'features':['feature1','feature2','feature3','feature4'], 
              'xdata':DataForm
            }
         }

and/or

def someDISCOHandler(session,request,TYR):
    # if TYR=='items':  # returns items list of the same format as shown above
    # elif TYR=='info': # returns info dictionary of the same format as shown above
    # else: # this case is impossible for now.

getDiscoHandler(self, node='', jid='')

source code 
Returns the previously registered DISCO handler that is resonsible for this node/jid combination. Used internally.

delDiscoHandler(self, node='', jid='')

source code 
Unregisters DISCO handler that is resonsible for this node/jid combination. When handler is unregistered the branch is handled in the same way that it's parent branch from this moment.

_DiscoveryHandler(self, conn, request)

source code 
Servers DISCO iq request from the remote client. Automatically determines the best handler to use and calls it to handle the request. Used internally.

xmpppy-0.4.1/doc/apidocs/xmpp.client.Client-class.html0000644000175000000500000003656410731034051021552 0ustar normansrc xmpp.client.Client
Package xmpp :: Module client :: Class Client
[hide private]
[frames] | no frames]

Class Client

source code

CommonClient --+
               |
              Client

Example client class, based on CommonClient.

Instance Methods [hide private]
 
connect(self, server=None, proxy=None, secure=None, use_srv=True)
Connect to jabber server.
source code
 
auth(self, user, password, resource='', sasl=1)
Authenticate connnection and bind resource.
source code
 
getRoster(self)
Return the Roster instance, previously plugging it in and requesting roster from server if needed.
source code
 
sendInitPresence(self, requestRoster=1)
Send roster request and initial <presence/>.
source code
 
sendPresence(self, jid=None, typ=None, requestRoster=0)
Send some specific presence state.
source code

Inherited from CommonClient: DisconnectHandler, RegisterDisconnectHandler, UnregisterDisconnectHandler, __init__, disconnected, event, isConnected, reconnectAndReauth

Method Details [hide private]

connect(self, server=None, proxy=None, secure=None, use_srv=True)

source code 
Connect to jabber server. If you want to specify different ip/port to connect to you can pass it as tuple as first parameter. If there is HTTP proxy between you and server specify it's address and credentials (if needed) in the second argument. If you want ssl/tls support to be discovered and enable automatically - leave third argument as None. (ssl will be autodetected only if port is 5223 or 443) If you want to force SSL start (i.e. if port 5223 or 443 is remapped to some non-standard port) then set it to 1. If you want to disable tls/ssl support completely, set it to 0. Example: connect(('192.168.5.5',5222),{'host':'proxy.my.net','port':8080,'user':'me','password':'secret'}) Returns '' or 'tcp' or 'tls', depending on the result.
Overrides: CommonClient.connect

auth(self, user, password, resource='', sasl=1)

source code 
Authenticate connnection and bind resource. If resource is not provided random one or library name used.

sendInitPresence(self, requestRoster=1)

source code 
Send roster request and initial <presence/>. You can disable the first by setting requestRoster argument to 0.

sendPresence(self, jid=None, typ=None, requestRoster=0)

source code 
Send some specific presence state. Can also request roster from server if according agrument is set.

xmpppy-0.4.1/doc/apidocs/xmpp.client.CommonClient-class.html0000644000175000000500000004625110731034052022716 0ustar normansrc xmpp.client.CommonClient
Package xmpp :: Module client :: Class CommonClient
[hide private]
[frames] | no frames]

Class CommonClient

source code

Known Subclasses:
Client, Component

Base for Client and Component classes.

Instance Methods [hide private]
 
__init__(self, server, port=5222, debug=['always', 'nodebuilder'])
Caches server name and (optionally) port to connect to.
source code
 
RegisterDisconnectHandler(self, handler)
Register handler that will be called on disconnect.
source code
 
UnregisterDisconnectHandler(self, handler)
Unregister handler that is called on disconnect.
source code
 
disconnected(self)
Called on disconnection.
source code
 
DisconnectHandler(self)
Default disconnect handler.
source code
 
event(self, eventName, args={})
Default event handler.
source code
 
isConnected(self)
Returns connection state.
source code
 
reconnectAndReauth(self)
Example of reconnection method.
source code
 
connect(self, server=None, proxy=None, ssl=None, use_srv=None)
Make a tcp/ip connection, protect it with tls/ssl if possible and start XMPP stream.
source code
Method Details [hide private]

__init__(self, server, port=5222, debug=['always', 'nodebuilder'])
(Constructor)

source code 
Caches server name and (optionally) port to connect to. "debug" parameter specifies
the debug IDs that will go into debug output. You can either specifiy an "include"
or "exclude" list. The latter is done via adding "always" pseudo-ID to the list.
Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket', 
 'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] . 

disconnected(self)

source code 
Called on disconnection. Calls disconnect handlers and cleans things up.

DisconnectHandler(self)

source code 
Default disconnect handler. Just raises an IOError. If you choosed to use this class in your production client, override this method or at least unregister it.

event(self, eventName, args={})

source code 
Default event handler. To be overriden.

isConnected(self)

source code 
Returns connection state. F.e.: None / 'tls' / 'tcp+non_sasl' .

reconnectAndReauth(self)

source code 
Example of reconnection method. In fact, it can be used to batch connection and auth as well.

connect(self, server=None, proxy=None, ssl=None, use_srv=None)

source code 
Make a tcp/ip connection, protect it with tls/ssl if possible and start XMPP stream. Returns None or 'tcp' or 'tls', depending on the result.

xmpppy-0.4.1/doc/apidocs/xmpp.client.Component-class.html0000644000175000000500000003354110731034052022267 0ustar normansrc xmpp.client.Component
Package xmpp :: Module client :: Class Component
[hide private]
[frames] | no frames]

Class Component

source code

CommonClient --+
               |
              Component

Component class. The only difference from CommonClient is ability to perform component authentication.

Instance Methods [hide private]
 
__init__(self, server, port=5347, typ=None, debug=['always', 'nodebuilder'], domains=None, sasl=0, bind=0, route=0, xcp=0)
Init function for Components.
source code
 
connect(self, server=None, proxy=None)
This will connect to the server, and if the features tag is found then set the namespace to be jabber:client as that is required for jabberd2.
source code
 
dobind(self, sasl) source code
 
auth(self, name, password, dup=None)
Authenticate component "name" with password "password".
source code

Inherited from CommonClient: DisconnectHandler, RegisterDisconnectHandler, UnregisterDisconnectHandler, disconnected, event, isConnected, reconnectAndReauth

Method Details [hide private]

__init__(self, server, port=5347, typ=None, debug=['always', 'nodebuilder'], domains=None, sasl=0, bind=0, route=0, xcp=0)
(Constructor)

source code 
Init function for Components. As components use a different auth mechanism which includes the namespace of the component. Jabberd1.4 and Ejabberd use the default namespace then for all client messages. Jabberd2 uses jabber:client. 'server' argument is a server name that you are connecting to (f.e. "localhost"). 'port' can be specified if 'server' resolves to correct IP. If it is not then you'll need to specify IP and port while calling "connect()".
Overrides: CommonClient.__init__

connect(self, server=None, proxy=None)

source code 
This will connect to the server, and if the features tag is found then set the namespace to be jabber:client as that is required for jabberd2. 'server' and 'proxy' arguments have the same meaning as in xmpp.Client.connect()
Overrides: CommonClient.connect

xmpppy-0.4.1/doc/apidocs/xmpp.client.PlugIn-class.html0000644000175000000500000002034710731034052021523 0ustar normansrc xmpp.client.PlugIn
Package xmpp :: Module client :: Class PlugIn
[hide private]
[frames] | no frames]

Class PlugIn

source code

Known Subclasses:
dispatcher.Dispatcher, filetransfer.IBB, commands.Command_Handler_Prototype, commands.Commands, auth.Bind, auth.ComponentBind, auth.NonSASL, auth.SASL, browser.Browser, transports.TCPsocket, transports.TLS, roster.Roster

Common xmpppy plugins infrastructure: plugging in/out, debugging.

Instance Methods [hide private]
 
DEBUG(self, text, severity='info')
Feed a provided debug line to main instance's debug facility along with our ID string.
source code
 
PlugIn(self, owner)
Attach to main instance and register ourself and all our staff in it.
source code
 
PlugOut(self)
Unregister all our staff from main instance and detach from it.
source code
 
__init__(self) source code
xmpppy-0.4.1/doc/apidocs/xmpp.commands.Command_Handler_Prototype-class.html0000644000175000000500000004004510731034052025745 0ustar normansrc xmpp.commands.Command_Handler_Prototype
Package xmpp :: Module commands :: Class Command_Handler_Prototype
[hide private]
[frames] | no frames]

Class Command_Handler_Prototype

source code

client.PlugIn --+
                |
               Command_Handler_Prototype
Known Subclasses:
TestCommand

This is a prototype command handler, as each command uses a disco method 
   and execute method you can implement it any way you like, however this is 
   my first attempt at making a generic handler that you can hang process 
   stages on too. There is an example command below.

The parameters are as follows:
name : the name of the command within the jabber environment
description : the natural language description
discofeatures : the features supported by the command
initial : the initial command in the from of {'execute':commandname}

All stages set the 'actions' dictionary for each session to represent the possible options available.



Instance Methods [hide private]
 
__init__(self, jid='')
Set up the class
source code
 
plugin(self, owner)
Plug command into the commands class
source code
 
plugout(self)
Remove command from the commands class
source code
 
getSessionID(self)
Returns an id for the command session
source code
 
Execute(self, conn, request)
The method that handles all the commands, and routes them to the correct method for that stage.
source code
 
_DiscoHandler(self, conn, request, type)
The handler for discovery events
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Class Variables [hide private]
  name = 'examplecommand'
  count = 0
  description = 'an example command'
  discofeatures = ['http://jabber.org/protocol/commands', 'jabbe...
Method Details [hide private]

__init__(self, jid='')
(Constructor)

source code 
Set up the class
Overrides: client.PlugIn.__init__

Class Variable Details [hide private]

discofeatures

Value:
['http://jabber.org/protocol/commands', 'jabber:x:data']

xmpppy-0.4.1/doc/apidocs/xmpp.commands.Commands-class.html0000644000175000000500000003373210731034052022413 0ustar normansrc xmpp.commands.Commands
Package xmpp :: Module commands :: Class Commands
[hide private]
[frames] | no frames]

Class Commands

source code

client.PlugIn --+
                |
               Commands

Commands is an ancestor of PlugIn and can be attached to any session.

The commands class provides a lookup and browse mechnism. It follows the same priciple of the Browser class, for Service Discovery to provide the list of commands, it adds the 'list' disco type to your existing disco handler function. 

How it works:
    The commands are added into the existing Browser on the correct nodes. When the command list is built the supplied discovery handler function needs to have a 'list' option in type. This then gets enumerated, all results returned as None are ignored.
    The command executed is then called using it's Execute method. All session management is handled by the command itself.



Instance Methods [hide private]
 
__init__(self, browser)
Initialises class and sets up local variables
source code
 
plugin(self, owner)
Makes handlers within the session
source code
 
plugout(self)
Removes handlers from the session
source code
 
_CommandHandler(self, conn, request)
The internal method to process the routing of command execution requests
source code
 
_DiscoHandler(self, conn, request, typ)
The internal method to process service discovery requests
source code
 
addCommand(self, name, cmddisco, cmdexecute, jid='')
The method to call if adding a new command to the session, the requred parameters of cmddisco and cmdexecute are the methods to enable that command to be executed
source code
 
delCommand(self, name, jid='')
Removed command from the session
source code
 
getCommand(self, name, jid='')
Returns the command tuple
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self, browser)
(Constructor)

source code 
Initialises class and sets up local variables
Overrides: client.PlugIn.__init__

xmpppy-0.4.1/doc/apidocs/xmpp.commands.TestCommand-class.html0000644000175000000500000003453510731034052023072 0ustar normansrc xmpp.commands.TestCommand
Package xmpp :: Module commands :: Class TestCommand
[hide private]
[frames] | no frames]

Class TestCommand

source code

        client.PlugIn --+    
                        |    
Command_Handler_Prototype --+
                            |
                           TestCommand

Example class. You should read source if you wish to understate how it works. Generally, it presents a "master" that giudes user through to calculate something.

Instance Methods [hide private]
 
__init__(self, jid='')
Init internal constants.
source code
 
cmdFirstStage(self, conn, request)
Determine
source code
 
cmdSecondStage(self, conn, request) source code
 
cmdSecondStageReply(self, conn, request) source code
 
cmdThirdStage(self, conn, request) source code
 
cmdCancel(self, conn, request) source code

Inherited from Command_Handler_Prototype: Execute, getSessionID, plugin, plugout

Inherited from Command_Handler_Prototype (private): _DiscoHandler

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Class Variables [hide private]
  name = 'testcommand'
  description = 'a noddy example command'

Inherited from Command_Handler_Prototype: count, discofeatures

Method Details [hide private]

__init__(self, jid='')
(Constructor)

source code 
Init internal constants.
Overrides: Command_Handler_Prototype.__init__

xmpppy-0.4.1/doc/apidocs/xmpp.debug.Debug-class.html0000644000175000000500000005245310731034052021166 0ustar normansrc xmpp.debug.Debug
Package xmpp :: Module debug :: Class Debug
[hide private]
[frames] | no frames]

Class Debug

source code

Instance Methods [hide private]
 
__init__(self, active_flags=None, log_file=sys.stderr, prefix='DEBUG: ', sufix='\n', time_stamp=0, flag_show=None, validate_flags=1, welcome=-1) source code
 
show(self, msg, flag=None, prefix=None, sufix=None, lf=0)
flag can be of folowing types:...
source code
 
active_set(self, active_flags=None)
returns 1 if any flags where actually set, otherwise 0.
source code
 
active_get(self)
returns currently active flags.
source code
 
_as_one_list(self, items)
init param might contain nested lists, typically from group flags.
source code
 
_append_unique_str(self, lst, item)
filter out any dupes.
source code
 
_validate_flag(self, flags)
verify that flag is defined.
source code
 
_remove_dupe_flags(self)
if multiple instances of Debug is used in same app, some flags might be created multiple time, filter out dupes
source code
 
Show(self, flag, msg, prefix='') source code
 
is_active(self, flag) source code
Class Variables [hide private]
  colors = {'CONNECTproxy': '\x1b[30;1m', 'auth': '\x1b[33;1m', ...
Method Details [hide private]

show(self, msg, flag=None, prefix=None, sufix=None, lf=0)

source code 

flag can be of folowing types:
    None - this msg will always be shown if any debugging is on
    flag - will be shown if flag is active
    (flag1,flag2,,,) - will be shown if any of the given flags 
                       are active

if prefix / sufix are not given, default ones from init will be used

lf = -1 means strip linefeed if pressent
lf = 1 means add linefeed if not pressent

_as_one_list(self, items)

source code 

init param might contain nested lists, typically from group flags.

This code organises lst and remves dupes

Class Variable Details [hide private]

colors

Value:
{'CONNECTproxy': '\x1b[30;1m',
 'auth': '\x1b[33;1m',
 'browser': '\x1b[34m',
 'client': '\x1b[36m',
 'component': '\x1b[36m',
 'data': '\x1b[33m',
 'dispatcher': '\x1b[32m',
 'down': '\x1b[33m',
...

xmpppy-0.4.1/doc/apidocs/xmpp.debug.NoDebug-class.html0000644000175000000500000002147310731034052021461 0ustar normansrc xmpp.debug.NoDebug
Package xmpp :: Module debug :: Class NoDebug
[hide private]
[frames] | no frames]

Class NoDebug

source code

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
show(self, *args, **kwargs) source code
 
Show(self, *args, **kwargs) source code
 
is_active(self, flag) source code
 
active_set(self, active_flags=None) source code
Class Variables [hide private]
  colors = {}
xmpppy-0.4.1/doc/apidocs/xmpp.dispatcher.Dispatcher-class.html0000644000175000000500000013777210731034052023276 0ustar normansrc xmpp.dispatcher.Dispatcher
Package xmpp :: Module dispatcher :: Class Dispatcher
[hide private]
[frames] | no frames]

Class Dispatcher

source code

client.PlugIn --+
                |
               Dispatcher

Ancestor of PlugIn class. Handles XMPP stream, i.e. aware of stream headers. Can be plugged out/in to restart these headers (used for SASL f.e.).

Instance Methods [hide private]
 
__init__(self) source code
 
dumpHandlers(self)
Return set of user-registered callbacks in it's internal format.
source code
 
restoreHandlers(self, handlers)
Restores user-registered callbacks structure from dump previously obtained via dumpHandlers.
source code
 
_init(self)
Registers default namespaces/protocols/handlers.
source code
 
plugin(self, owner)
Plug the Dispatcher instance into Client class instance and send initial stream header.
source code
 
plugout(self)
Prepares instance to be destructed.
source code
 
StreamInit(self)
Send an initial stream header.
source code
 
_check_stream_start(self, ns, tag, attrs) source code
 
Process(self, timeout=0)
Check incoming stream for data waiting.
source code
 
RegisterNamespace(self, xmlns, order='info')
Creates internal structures for newly registered namespace.
source code
 
RegisterProtocol(self, tag_name, Proto, xmlns=None, order='info')
Used to declare some top-level stanza name to dispatcher.
source code
 
RegisterNamespaceHandler(self, xmlns, handler, typ='', ns='', makefirst=0, system=0)
Register handler for processing all stanzas for specified namespace.
source code
 
RegisterHandler(self, name, handler, typ='', ns='', xmlns=None, makefirst=0, system=0)
Register user callback as stanzas handler of declared type.
source code
 
RegisterHandlerOnce(self, name, handler, typ='', ns='', xmlns=None, makefirst=0, system=0)
Unregister handler after first call (not implemented yet).
source code
 
UnregisterHandler(self, name, handler, typ='', ns='', xmlns=None)
Unregister handler.
source code
 
RegisterDefaultHandler(self, handler)
Specify the handler that will be used if no NodeProcessed exception were raised.
source code
 
RegisterEventHandler(self, handler)
Register handler that will process events.
source code
 
returnStanzaHandler(self, conn, stanza)
Return stanza back to the sender with <feature-not-implemennted/> error set.
source code
 
streamErrorHandler(self, conn, error) source code
 
RegisterCycleHandler(self, handler)
Register handler that will be called on every Dispatcher.Process() call.
source code
 
UnregisterCycleHandler(self, handler)
Unregister handler that will is called on every Dispatcher.Process() call.
source code
 
Event(self, realm, event, data)
Raise some event.
source code
 
dispatch(self, stanza, session=None, direct=0)
Main procedure that performs XMPP stanza recognition and calling apppropriate handlers for it.
source code
 
WaitForResponse(self, ID, timeout=25)
Block and wait until stanza with specific "id" attribute will come.
source code
 
SendAndWaitForResponse(self, stanza, timeout=25)
Put stanza on the wire and wait for recipient's response to it.
source code
 
SendAndCallForResponse(self, stanza, func, args={})
Put stanza on the wire and call back when recipient replies.
source code
 
send(self, stanza)
Serialise stanza and put it on the wire.
source code
 
disconnect(self)
Send a stream terminator and and handle all incoming stanzas before stream closure.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: client.PlugIn.__init__

dumpHandlers(self)

source code 
Return set of user-registered callbacks in it's internal format. Used within the library to carry user handlers set over Dispatcher replugins.

restoreHandlers(self, handlers)

source code 
Restores user-registered callbacks structure from dump previously obtained via dumpHandlers. Used within the library to carry user handlers set over Dispatcher replugins.

_init(self)

source code 
Registers default namespaces/protocols/handlers. Used internally.

plugin(self, owner)

source code 
Plug the Dispatcher instance into Client class instance and send initial stream header. Used internally.

Process(self, timeout=0)

source code 
Check incoming stream for data waiting. If "timeout" is positive - block for as max. this time. Returns: 1) length of processed data if some data were processed; 2) '0' string if no data were processed but link is alive; 3) 0 (zero) if underlying connection is closed. Take note that in case of disconnection detect during Process() call disconnect handlers are called automatically.

RegisterNamespace(self, xmlns, order='info')

source code 
Creates internal structures for newly registered namespace. You can register handlers for this namespace afterwards. By default one namespace already registered (jabber:client or jabber:component:accept depending on context.

RegisterProtocol(self, tag_name, Proto, xmlns=None, order='info')

source code 
Used to declare some top-level stanza name to dispatcher. Needed to start registering handlers for such stanzas. Iq, message and presence protocols are registered by default.

RegisterHandler(self, name, handler, typ='', ns='', xmlns=None, makefirst=0, system=0)

source code 
Register user callback as stanzas handler of declared type. Callback must take
(if chained, see later) arguments: dispatcher instance (for replying), incomed
return of previous handlers.
The callback must raise xmpp.NodeProcessed just before return if it want preven
callbacks to be called with the same stanza as argument _and_, more importantly
library from returning stanza to sender with error set (to be enabled in 0.2 ve
 Arguments:
   "name" - name of stanza. F.e. "iq".
   "handler" - user callback.
   "typ" - value of stanza's "type" attribute. If not specified any value match
   "ns" - namespace of child that stanza must contain.
   "chained" - chain together output of several handlers.
   "makefirst" - insert handler in the beginning of handlers list instead of
     adding it to the end. Note that more common handlers (i.e. w/o "typ" and "
     will be called first nevertheless.
   "system" - call handler even if NodeProcessed Exception were raised already.
 

UnregisterHandler(self, name, handler, typ='', ns='', xmlns=None)

source code 
Unregister handler. "typ" and "ns" must be specified exactly the same as with registering.

RegisterDefaultHandler(self, handler)

source code 
Specify the handler that will be used if no NodeProcessed exception were raised. This is returnStanzaHandler by default.

RegisterEventHandler(self, handler)

source code 
Register handler that will process events. F.e. "FILERECEIVED" event.

Event(self, realm, event, data)

source code 
Raise some event. Takes three arguments: 1) "realm" - scope of event. Usually a namespace. 2) "event" - the event itself. F.e. "SUCESSFULL SEND". 3) data that comes along with event. Depends on event.

dispatch(self, stanza, session=None, direct=0)

source code 
Main procedure that performs XMPP stanza recognition and calling apppropriate handlers for it. Called internally.

WaitForResponse(self, ID, timeout=25)

source code 
Block and wait until stanza with specific "id" attribute will come. If no such stanza is arrived within timeout, return None. If operation failed for some reason then owner's attributes lastErrNode, lastErr and lastErrCode are set accordingly.

SendAndCallForResponse(self, stanza, func, args={})

source code 
Put stanza on the wire and call back when recipient replies. Additional callback arguments can be specified in args.

send(self, stanza)

source code 
Serialise stanza and put it on the wire. Assign an unique ID to it before send. Returns assigned ID.

xmpppy-0.4.1/doc/apidocs/xmpp.filetransfer.IBB-class.html0000644000175000000500000005405510731034052022132 0ustar normansrc xmpp.filetransfer.IBB
Package xmpp :: Module filetransfer :: Class IBB
[hide private]
[frames] | no frames]

Class IBB

source code

client.PlugIn --+
                |
               IBB

IBB used to transfer small-sized data chunk over estabilished xmpp connection. Data is split into small blocks (by default 3000 bytes each), encoded as base 64 and sent to another entity that compiles these blocks back into the data chunk. This is very inefficiend but should work under any circumstances. Note that using IBB normally should be the last resort.

Instance Methods [hide private]
 
__init__(self)
Initialise internal variables.
source code
 
plugin(self, owner)
Register handlers for receiving incoming datastreams.
source code
 
IqHandler(self, conn, stanza)
Handles streams state change.
source code
 
StreamOpenHandler(self, conn, stanza)
Handles opening of new incoming stream.
source code
 
OpenStream(self, sid, to, fp, blocksize=3000)
Start new stream.
source code
 
SendHandler(self, conn)
Send next portion of data if it is time to do it.
source code
 
ReceiveHandler(self, conn, stanza)
Receive next portion of incoming datastream and store it write it to temporary file.
source code
 
StreamCloseHandler(self, conn, stanza)
Handle stream closure due to all data transmitted.
source code
 
StreamBrokenHandler(self, conn, stanza)
Handle stream closure due to all some error while receiving data.
source code
 
StreamOpenReplyHandler(self, conn, stanza)
Handle remote side reply about is it agree or not to receive our datastream.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Initialise internal variables.
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Register handlers for receiving incoming datastreams. Used internally.

IqHandler(self, conn, stanza)

source code 
Handles streams state change. Used internally.

StreamOpenHandler(self, conn, stanza)

source code 
Handles opening of new incoming stream. Used internally.

OpenStream(self, sid, to, fp, blocksize=3000)

source code 
Start new stream. You should provide stream id 'sid', the endpoind jid 'to', the file object containing info for send 'fp'. Also the desired blocksize can be specified. Take into account that recommended stanza size is 4k and IBB uses base64 encoding that increases size of data by 1/3.

SendHandler(self, conn)

source code 
Send next portion of data if it is time to do it. Used internally.

ReceiveHandler(self, conn, stanza)

source code 
Receive next portion of incoming datastream and store it write it to temporary file. Used internally.

StreamCloseHandler(self, conn, stanza)

source code 
Handle stream closure due to all data transmitted. Raise xmpppy event specifying successfull data receive.

StreamBrokenHandler(self, conn, stanza)

source code 
Handle stream closure due to all some error while receiving data. Raise xmpppy event specifying unsuccessfull data receive.

StreamOpenReplyHandler(self, conn, stanza)

source code 
Handle remote side reply about is it agree or not to receive our datastream. Used internally. Raises xmpppy event specfiying if the data transfer is agreed upon.

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.BadFormat-class.html0000644000175000000500000001145310731034052022545 0ustar normansrc xmpp.protocol.BadFormat
Package xmpp :: Module protocol :: Class BadFormat
[hide private]
[frames] | no frames]

Class BadFormat

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          BadFormat

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.BadNamespacePrefix-class.html0000644000175000000500000001154110731034053024366 0ustar normansrc xmpp.protocol.BadNamespacePrefix
Package xmpp :: Module protocol :: Class BadNamespacePrefix
[hide private]
[frames] | no frames]

Class BadNamespacePrefix

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          BadNamespacePrefix

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.Conflict-class.html0000644000175000000500000001144510731034053022451 0ustar normansrc xmpp.protocol.Conflict
Package xmpp :: Module protocol :: Class Conflict
[hide private]
[frames] | no frames]

Class Conflict

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          Conflict

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.ConnectionTimeout-class.html0000644000175000000500000001153310731034053024354 0ustar normansrc xmpp.protocol.ConnectionTimeout
Package xmpp :: Module protocol :: Class ConnectionTimeout
[hide private]
[frames] | no frames]

Class ConnectionTimeout

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          ConnectionTimeout

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.DataField-class.html0000644000175000000500000006510110731034053022523 0ustar normansrc xmpp.protocol.DataField
Package xmpp :: Module protocol :: Class DataField
[hide private]
[frames] | no frames]

Class DataField

source code

simplexml.Node --+
                 |
                DataField

This class is used in the DataForm class to describe the single data item. If you are working with jabber:x:data (XEP-0004, XEP-0068, XEP-0122) then you will need to work with instances of this class.

Instance Methods [hide private]
 
__init__(self, name=None, value=None, typ=None, required=0, label=None, desc=None, options=[], node=None)
Create new data field of specified name,value and type.
source code
 
setRequired(self, req=1)
Change the state of the 'required' flag.
source code
 
isRequired(self)
Returns in this field a required one.
source code
 
setLabel(self, label)
Set the label of this field.
source code
 
getLabel(self)
Return the label of this field.
source code
 
setDesc(self, desc)
Set the description of this field.
source code
 
getDesc(self)
Return the description of this field.
source code
 
setValue(self, val)
Set the value of this field.
source code
 
getValue(self) source code
 
setValues(self, lst)
Set the values of this field as values-list.
source code
 
addValue(self, val)
Add one more value to this field.
source code
 
getValues(self)
Return the list of values associated with this field.
source code
 
getOptions(self)
Return label-option pairs list associated with this field.
source code
 
setOptions(self, lst)
Set label-option pairs list associated with this field.
source code
 
addOption(self, opt)
Add one more label-option pair to this field.
source code
 
getType(self)
Get type of this field.
source code
 
setType(self, val)
Set type of this field.
source code
 
getVar(self)
Get 'var' attribute value of this field.
source code
 
setVar(self, val)
Set 'var' attribute value of this field.
source code

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __setitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, name=None, value=None, typ=None, required=0, label=None, desc=None, options=[], node=None)
(Constructor)

source code 
Create new data field of specified name,value and type. Also 'required','desc' and 'options' fields can be set. Alternatively other XML object can be passed in as the 'node' parameted to replicate it as a new datafiled.
Overrides: simplexml.Node.__init__

setValues(self, lst)

source code 
Set the values of this field as values-list. Replaces all previous filed values! If you need to just add a value - use addValue method.

addValue(self, val)

source code 
Add one more value to this field. Used in 'get' iq's or such.

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.DataForm-class.html0000644000175000000500000005505110731034053022406 0ustar normansrc xmpp.protocol.DataForm
Package xmpp :: Module protocol :: Class DataForm
[hide private]
[frames] | no frames]

Class DataForm

source code

simplexml.Node --+
                 |
                DataForm

DataForm class. Used for manipulating dataforms in XMPP. Relevant XEPs: 0004, 0068, 0122. Can be used in disco, pub-sub and many other applications.

Instance Methods [hide private]
 
__init__(self, typ=None, data=[], title=None, node=None)
Create new dataform of type 'typ'.
source code
 
getType(self)
Return the type of dataform.
source code
 
setType(self, typ)
Set the type of dataform.
source code
 
getTitle(self)
Return the title of dataform.
source code
 
setTitle(self, text)
Set the title of dataform.
source code
 
getInstructions(self)
Return the instructions of dataform.
source code
 
setInstructions(self, text)
Set the instructions of dataform.
source code
 
addInstructions(self, text)
Add one more instruction to the dataform.
source code
 
getField(self, name)
Return the datafield object with name 'name' (if exists).
source code
 
setField(self, name)
Create if nessessary or get the existing datafield object with name 'name' and return it.
source code
 
asDict(self)
Represent dataform as simple dictionary mapping of datafield names to their values.
source code
 
__getitem__(self, name)
Simple dictionary interface for getting datafields values by their names.
source code
 
__setitem__(self, name, val)
Simple dictionary interface for setting datafields values by their names.
source code

Inherited from simplexml.Node: __delitem__, __getattr__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, typ=None, data=[], title=None, node=None)
(Constructor)

source code 

Create new dataform of type 'typ'. 'data' is the list of DataField instances that this dataform contains, 'title' - the title string. You can specify the 'node' argument as the other node to be used as base for constructing this dataform.

title and instructions is optional and SHOULD NOT contain newlines. Several instructions MAY be present. 'typ' can be one of ('form' | 'submit' | 'cancel' | 'result' ) 'typ' of reply iq can be ( 'result' | 'set' | 'set' | 'result' ) respectively. 'cancel' form can not contain any fields. All other forms contains AT LEAST one field. 'title' MAY be included in forms of type "form" and "result"
Overrides: simplexml.Node.__init__

__getitem__(self, name)
(Indexing operator)

source code 
Simple dictionary interface for getting datafields values by their names.
Overrides: simplexml.Node.__getitem__

__setitem__(self, name, val)
(Index assignment operator)

source code 
Simple dictionary interface for setting datafields values by their names.
Overrides: simplexml.Node.__setitem__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.Error-class.html0000644000175000000500000003470010731034053022000 0ustar normansrc xmpp.protocol.Error
Package xmpp :: Module protocol :: Class Error
[hide private]
[frames] | no frames]

Class Error

source code

simplexml.Node --+    
                 |    
          Protocol --+
                     |
                    Error

Used to quickly transform received stanza into error reply.

Instance Methods [hide private]
 
__init__(self, node, error, reply=1)
Create error reply basing on the received 'node' stanza and the 'error' error condition.
source code
 
__dupstr__(self, dup1=None, dup2=None)
Dummy function used as preventor of creating error node in reply to error node.
source code

Inherited from Protocol: __setitem__, getError, getErrorCode, getFrom, getID, getProperties, getTimestamp, getTo, getType, setError, setFrom, setID, setTimestamp, setTo, setType

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, node, error, reply=1)
(Constructor)

source code 
Create error reply basing on the received 'node' stanza and the 'error' error condition. If the 'node' is not the received stanza but locally created ('to' and 'from' fields needs not swapping) specify the 'reply' argument as false.
Overrides: Protocol.__init__

__dupstr__(self, dup1=None, dup2=None)

source code 
Dummy function used as preventor of creating error node in reply to error node. I.e. you will not be able to serialise "double" error into string.

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.ErrorNode-class.html0000644000175000000500000002673010731034053022612 0ustar normansrc xmpp.protocol.ErrorNode
Package xmpp :: Module protocol :: Class ErrorNode
[hide private]
[frames] | no frames]

Class ErrorNode

source code

simplexml.Node --+
                 |
                ErrorNode

XMPP-style error element. In the case of stanza error should be attached to XMPP stanza. In the case of stream-level errors should be used separately.

Instance Methods [hide private]
 
__init__(self, name, code=None, typ=None, text=None)
Create new error node object.
source code

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __setitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, name, code=None, typ=None, text=None)
(Constructor)

source code 
Create new error node object. Mandatory parameter: name - name of error condition. Optional parameters: code, typ, text. Used for backwards compartibility with older jabber protocol.
Overrides: simplexml.Node.__init__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.HostGone-class.html0000644000175000000500000001144510731034053022436 0ustar normansrc xmpp.protocol.HostGone
Package xmpp :: Module protocol :: Class HostGone
[hide private]
[frames] | no frames]

Class HostGone

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          HostGone

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.HostUnknown-class.html0000644000175000000500000001146710731034053023211 0ustar normansrc xmpp.protocol.HostUnknown
Package xmpp :: Module protocol :: Class HostUnknown
[hide private]
[frames] | no frames]

Class HostUnknown

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          HostUnknown

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.ImproperAddressing-class.html0000644000175000000500000001154110731034053024506 0ustar normansrc xmpp.protocol.ImproperAddressing
Package xmpp :: Module protocol :: Class ImproperAddressing
[hide private]
[frames] | no frames]

Class ImproperAddressing

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          ImproperAddressing

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.InternalServerError-class.html0000644000175000000500000001154710731034053024670 0ustar normansrc xmpp.protocol.InternalServerError
Package xmpp :: Module protocol :: Class InternalServerError
[hide private]
[frames] | no frames]

Class InternalServerError

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          InternalServerError

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.InvalidFrom-class.html0000644000175000000500000001146710731034053023126 0ustar normansrc xmpp.protocol.InvalidFrom
Package xmpp :: Module protocol :: Class InvalidFrom
[hide private]
[frames] | no frames]

Class InvalidFrom

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          InvalidFrom

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.InvalidID-class.html0000644000175000000500000001145310731034053022512 0ustar normansrc xmpp.protocol.InvalidID
Package xmpp :: Module protocol :: Class InvalidID
[hide private]
[frames] | no frames]

Class InvalidID

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          InvalidID

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.InvalidNamespace-class.html0000644000175000000500000001152510731034053024112 0ustar normansrc xmpp.protocol.InvalidNamespace
Package xmpp :: Module protocol :: Class InvalidNamespace
[hide private]
[frames] | no frames]

Class InvalidNamespace

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          InvalidNamespace

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.InvalidXML-class.html0000644000175000000500000001146110731034053022655 0ustar normansrc xmpp.protocol.InvalidXML
Package xmpp :: Module protocol :: Class InvalidXML
[hide private]
[frames] | no frames]

Class InvalidXML

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          InvalidXML

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.Iq-class.html0000644000175000000500000005114410731034053021261 0ustar normansrc xmpp.protocol.Iq
Package xmpp :: Module protocol :: Class Iq
[hide private]
[frames] | no frames]

Class Iq

source code

simplexml.Node --+    
                 |    
          Protocol --+
                     |
                    Iq

XMPP Iq object - get/set dialog mechanism.

Instance Methods [hide private]
 
__init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns='jabber:client', node=None)
Create Iq object.
source code
 
getQueryNS(self)
Return the namespace of the 'query' child element.
source code
 
getQuerynode(self)
Return the 'node' attribute value of the 'query' child element.
source code
 
getQueryPayload(self)
Return the 'query' child element payload.
source code
 
getQueryChildren(self)
Return the 'query' child element child nodes.
source code
 
setQueryNS(self, namespace)
Set the namespace of the 'query' child element.
source code
 
setQueryPayload(self, payload)
Set the 'query' child element payload.
source code
 
setQuerynode(self, node)
Set the 'node' attribute value of the 'query' child element.
source code
 
buildReply(self, typ)
Builds and returns another Iq object of specified type.
source code

Inherited from Protocol: __setitem__, getError, getErrorCode, getFrom, getID, getProperties, getTimestamp, getTo, getType, setError, setFrom, setID, setTimestamp, setTo, setType

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns='jabber:client', node=None)
(Constructor)

source code 
Create Iq object. You can specify type, query namespace any additional attributes, recipient of the iq, sender of the iq, any additional payload (f.e. jabber:x:data node) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as an iq.
Overrides: Protocol.__init__

buildReply(self, typ)

source code 
Builds and returns another Iq object of specified type. The to, from and query child node of new Iq are pre-set as reply to this Iq.

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.JID-class.html0000644000175000000500000004471510731034053021324 0ustar normansrc xmpp.protocol.JID
Package xmpp :: Module protocol :: Class JID
[hide private]
[frames] | no frames]

Class JID

source code

JID object. JID can be built from string, modified, compared, serialised into string.

Instance Methods [hide private]
 
__init__(self, jid=None, node='', domain='', resource='')
Constructor.
source code
 
getNode(self)
Return the node part of the JID
source code
 
setNode(self, node)
Set the node part of the JID to new value.
source code
 
getDomain(self)
Return the domain part of the JID
source code
 
setDomain(self, domain)
Set the domain part of the JID to new value.
source code
 
getResource(self)
Return the resource part of the JID
source code
 
setResource(self, resource)
Set the resource part of the JID to new value.
source code
 
getStripped(self)
Return the bare representation of JID.
source code
 
__eq__(self, other)
Compare the JID to another instance or to string for equality.
source code
 
__ne__(self, other)
Compare the JID to another instance or to string for non-equality.
source code
 
bareMatch(self, other)
Compare the node and domain parts of the JID's for equality.
source code
 
__str__(self, wresource=1)
Serialise JID into string.
source code
 
__hash__(self)
Produce hash of the JID, Allows to use JID objects as keys of the dictionary.
source code
Method Details [hide private]

__init__(self, jid=None, node='', domain='', resource='')
(Constructor)

source code 
Constructor. JID can be specified as string (jid argument) or as separate parts. Examples: JID('node@domain/resource') JID(node='node',domain='domain.org')

setNode(self, node)

source code 
Set the node part of the JID to new value. Specify None to remove the node part.

setResource(self, resource)

source code 
Set the resource part of the JID to new value. Specify None to remove the resource part.

getStripped(self)

source code 
Return the bare representation of JID. I.e. string value w/o resource.

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.Message-class.html0000644000175000000500000005045210731034053022275 0ustar normansrc xmpp.protocol.Message
Package xmpp :: Module protocol :: Class Message
[hide private]
[frames] | no frames]

Class Message

source code

simplexml.Node --+    
                 |    
          Protocol --+
                     |
                    Message

XMPP Message stanza - "push" mechanism.

Instance Methods [hide private]
 
__init__(self, to=None, body=None, typ=None, subject=None, attrs={}, frm=None, payload=[], timestamp=None, xmlns='jabber:client', node=None)
Create message object.
source code
 
getBody(self)
Returns text of the message.
source code
 
getSubject(self)
Returns subject of the message.
source code
 
getThread(self)
Returns thread of the message.
source code
 
setBody(self, val)
Sets the text of the message.
source code
 
setSubject(self, val)
Sets the subject of the message.
source code
 
setThread(self, val)
Sets the thread of the message.
source code
 
buildReply(self, text=None)
Builds and returns another message object with specified text.
source code

Inherited from Protocol: __setitem__, getError, getErrorCode, getFrom, getID, getProperties, getTimestamp, getTo, getType, setError, setFrom, setID, setTimestamp, setTo, setType

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, to=None, body=None, typ=None, subject=None, attrs={}, frm=None, payload=[], timestamp=None, xmlns='jabber:client', node=None)
(Constructor)

source code 
Create message object. You can specify recipient, text of message, type of message any additional attributes, sender of the message, any additional payload (f.e. jabber:x:delay element) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as message.
Overrides: Protocol.__init__

buildReply(self, text=None)

source code 
Builds and returns another message object with specified text. The to, from and thread properties of new message are pre-set as reply to this message.

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.NodeProcessed-class.html0000644000175000000500000001145110731034053023442 0ustar normansrc xmpp.protocol.NodeProcessed
Package xmpp :: Module protocol :: Class NodeProcessed
[hide private]
[frames] | no frames]

Class NodeProcessed

source code

exceptions.Exception --+
                       |
                      NodeProcessed

Exception that should be raised by handler when the handling should be stopped.

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.NotAuthorized-class.html0000644000175000000500000001150310731034054023503 0ustar normansrc xmpp.protocol.NotAuthorized
Package xmpp :: Module protocol :: Class NotAuthorized
[hide private]
[frames] | no frames]

Class NotAuthorized

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          NotAuthorized

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.PolicyViolation-class.html0000644000175000000500000001151710731034054024035 0ustar normansrc xmpp.protocol.PolicyViolation
Package xmpp :: Module protocol :: Class PolicyViolation
[hide private]
[frames] | no frames]

Class PolicyViolation

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          PolicyViolation

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.Presence-class.html0000644000175000000500000006234010731034054022455 0ustar normansrc xmpp.protocol.Presence
Package xmpp :: Module protocol :: Class Presence
[hide private]
[frames] | no frames]

Class Presence

source code

simplexml.Node --+    
                 |    
          Protocol --+
                     |
                    Presence

XMPP Presence object.

Instance Methods [hide private]
 
__init__(self, to=None, typ=None, priority=None, show=None, status=None, attrs={}, frm=None, timestamp=None, payload=[], xmlns='jabber:client', node=None)
Create presence object.
source code
 
getPriority(self)
Returns the priority of the message.
source code
 
getShow(self)
Returns the show value of the message.
source code
 
getStatus(self)
Returns the status string of the message.
source code
 
setPriority(self, val)
Sets the priority of the message.
source code
 
setShow(self, val)
Sets the show value of the message.
source code
 
setStatus(self, val)
Sets the status string of the message.
source code
 
_muc_getItemAttr(self, tag, attr) source code
 
_muc_getSubTagDataAttr(self, tag, attr) source code
 
getRole(self)
Returns the presence role (for groupchat)
source code
 
getAffiliation(self)
Returns the presence affiliation (for groupchat)
source code
 
getNick(self)
Returns the nick value (for nick change in groupchat)
source code
 
getJid(self)
Returns the presence jid (for groupchat)
source code
 
getReason(self)
Returns the reason of the presence (for groupchat)
source code
 
getActor(self)
Returns the reason of the presence (for groupchat)
source code
 
getStatusCode(self)
Returns the status code of the presence (for groupchat)
source code

Inherited from Protocol: __setitem__, getError, getErrorCode, getFrom, getID, getProperties, getTimestamp, getTo, getType, setError, setFrom, setID, setTimestamp, setTo, setType

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, to=None, typ=None, priority=None, show=None, status=None, attrs={}, frm=None, timestamp=None, payload=[], xmlns='jabber:client', node=None)
(Constructor)

source code 
Create presence object. You can specify recipient, type of message, priority, show and status values any additional attributes, sender of the presence, timestamp, any additional payload (f.e. jabber:x:delay element) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as presence.
Overrides: Protocol.__init__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.Protocol-class.html0000644000175000000500000006551310731034054022517 0ustar normansrc xmpp.protocol.Protocol
Package xmpp :: Module protocol :: Class Protocol
[hide private]
[frames] | no frames]

Class Protocol

source code

simplexml.Node --+
                 |
                Protocol
Known Subclasses:
Error, Iq, Message, Presence

A "stanza" object class. Contains methods that are common for presences, iqs and messages.

Instance Methods [hide private]
 
__init__(self, name=None, to=None, typ=None, frm=None, attrs={}, payload=[], timestamp=None, xmlns=None, node=None)
Constructor, name is the name of the stanza i.e.
source code
 
getTo(self)
Return value of the 'to' attribute.
source code
 
getFrom(self)
Return value of the 'from' attribute.
source code
 
getTimestamp(self)
Return the timestamp in the 'yyyymmddThhmmss' format.
source code
 
getID(self)
Return the value of the 'id' attribute.
source code
 
setTo(self, val)
Set the value of the 'to' attribute.
source code
 
getType(self)
Return the value of the 'type' attribute.
source code
 
setFrom(self, val)
Set the value of the 'from' attribute.
source code
 
setType(self, val)
Set the value of the 'type' attribute.
source code
 
setID(self, val)
Set the value of the 'id' attribute.
source code
 
getError(self)
Return the error-condition (if present) or the textual description of the error (otherwise).
source code
 
getErrorCode(self)
Return the error code.
source code
 
setError(self, error, code=None)
Set the error code.
source code
 
setTimestamp(self, val=None)
Set the timestamp.
source code
 
getProperties(self)
Return the list of namespaces to which belongs the direct childs of element
source code
 
__setitem__(self, item, val)
Set the item 'item' to the value 'val'.
source code

Inherited from simplexml.Node: __delitem__, __getattr__, __getitem__, __str__, addChild, addData, clearData, delAttr, delChild, getAttr, getAttrs, getCDATA, getChildren, getData, getName, getNamespace, getParent, getPayload, getTag, getTagAttr, getTagData, getTags, has_attr, setAttr, setData, setName, setNamespace, setParent, setPayload, setTag, setTagAttr, setTagData

Class Variables [hide private]

Inherited from simplexml.Node: FORCE_NODE_RECREATION

Method Details [hide private]

__init__(self, name=None, to=None, typ=None, frm=None, attrs={}, payload=[], timestamp=None, xmlns=None, node=None)
(Constructor)

source code 
Constructor, name is the name of the stanza i.e. 'message' or 'presence' or 'iq'. to is the value of 'to' attribure, 'typ' - 'type' attribute frn - from attribure, attrs - other attributes mapping, payload - same meaning as for simplexml payload definition timestamp - the time value that needs to be stamped over stanza xmlns - namespace of top stanza node node - parsed or unparsed stana to be taken as prototype.
Overrides: simplexml.Node.__init__

getErrorCode(self)

source code 
Return the error code. Obsolette.

setError(self, error, code=None)

source code 
Set the error code. Obsolette. Use error-conditions instead.

setTimestamp(self, val=None)

source code 
Set the timestamp. timestamp should be the yyyymmddThhmmss string.

__setitem__(self, item, val)
(Index assignment operator)

source code 
Set the item 'item' to the value 'val'.
Overrides: simplexml.Node.__setitem__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.RemoteConnectionFailed-class.html0000644000175000000500000001157110731034054025271 0ustar normansrc xmpp.protocol.RemoteConnectionFailed
Package xmpp :: Module protocol :: Class RemoteConnectionFailed
[hide private]
[frames] | no frames]

Class RemoteConnectionFailed

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          RemoteConnectionFailed

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.ResourceConstraint-class.html0000644000175000000500000001154110731034054024542 0ustar normansrc xmpp.protocol.ResourceConstraint
Package xmpp :: Module protocol :: Class ResourceConstraint
[hide private]
[frames] | no frames]

Class ResourceConstraint

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          ResourceConstraint

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.RestrictedXML-class.html0000644000175000000500000001150310731034054023375 0ustar normansrc xmpp.protocol.RestrictedXML
Package xmpp :: Module protocol :: Class RestrictedXML
[hide private]
[frames] | no frames]

Class RestrictedXML

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          RestrictedXML

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.SeeOtherHost-class.html0000644000175000000500000001147510731034054023270 0ustar normansrc xmpp.protocol.SeeOtherHost
Package xmpp :: Module protocol :: Class SeeOtherHost
[hide private]
[frames] | no frames]

Class SeeOtherHost

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          SeeOtherHost

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.StreamError-class.html0000644000175000000500000001506410731034054023157 0ustar normansrc xmpp.protocol.StreamError
Package xmpp :: Module protocol :: Class StreamError
[hide private]
[frames] | no frames]

Class StreamError

source code

exceptions.Exception --+
                       |
                      StreamError
Known Subclasses:
BadFormat, BadNamespacePrefix, Conflict, ConnectionTimeout, HostGone, HostUnknown, ImproperAddressing, InternalServerError, InvalidFrom, InvalidID, InvalidNamespace, InvalidXML, NotAuthorized, PolicyViolation, RemoteConnectionFailed, ResourceConstraint, RestrictedXML, SeeOtherHost, SystemShutdown, UndefinedCondition, UnsupportedEncoding, UnsupportedStanzaType, UnsupportedVersion, XMLNotWellFormed

Base exception class for stream errors.

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.SystemShutdown-class.html0000644000175000000500000001151110731034054023723 0ustar normansrc xmpp.protocol.SystemShutdown
Package xmpp :: Module protocol :: Class SystemShutdown
[hide private]
[frames] | no frames]

Class SystemShutdown

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          SystemShutdown

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.UndefinedCondition-class.html0000644000175000000500000001154110731034054024456 0ustar normansrc xmpp.protocol.UndefinedCondition
Package xmpp :: Module protocol :: Class UndefinedCondition
[hide private]
[frames] | no frames]

Class UndefinedCondition

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          UndefinedCondition

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.UnsupportedEncoding-class.html0000644000175000000500000001154710731034054024713 0ustar normansrc xmpp.protocol.UnsupportedEncoding
Package xmpp :: Module protocol :: Class UnsupportedEncoding
[hide private]
[frames] | no frames]

Class UnsupportedEncoding

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          UnsupportedEncoding

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.UnsupportedStanzaType-class.html0000644000175000000500000001156310731034054025265 0ustar normansrc xmpp.protocol.UnsupportedStanzaType
Package xmpp :: Module protocol :: Class UnsupportedStanzaType
[hide private]
[frames] | no frames]

Class UnsupportedStanzaType

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          UnsupportedStanzaType

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.UnsupportedVersion-class.html0000644000175000000500000001154110731034054024604 0ustar normansrc xmpp.protocol.UnsupportedVersion
Package xmpp :: Module protocol :: Class UnsupportedVersion
[hide private]
[frames] | no frames]

Class UnsupportedVersion

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          UnsupportedVersion

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.protocol.XMLNotWellFormed-class.html0000644000175000000500000001152510731034054024012 0ustar normansrc xmpp.protocol.XMLNotWellFormed
Package xmpp :: Module protocol :: Class XMLNotWellFormed
[hide private]
[frames] | no frames]

Class XMLNotWellFormed

source code

exceptions.Exception --+    
                       |    
             StreamError --+
                           |
                          XMLNotWellFormed

Instance Methods [hide private]

Inherited from exceptions.Exception: __getitem__, __init__, __str__

xmpppy-0.4.1/doc/apidocs/xmpp.roster.Roster-class.html0000644000175000000500000011110110731034054021632 0ustar normansrc xmpp.roster.Roster
Package xmpp :: Module roster :: Class Roster
[hide private]
[frames] | no frames]

Class Roster

source code

client.PlugIn --+
                |
               Roster

Defines a plenty of methods that will allow you to manage roster. Also automatically track presences from remote JIDs taking into account that every JID can have multiple resources connected. Does not currently support 'error' presences. You can also use mapping interface for access to the internal representation of contacts in roster.

Instance Methods [hide private]
 
__init__(self)
Init internal variables.
source code
 
plugin(self, owner, request=1)
Register presence and subscription trackers in the owner's dispatcher.
source code
 
Request(self, force=0)
Request roster from server if it were not yet requested (or if the 'force' argument is set).
source code
 
getRoster(self)
Requests roster from server if neccessary and returns self.
source code
 
RosterIqHandler(self, dis, stanza)
Subscription tracker.
source code
 
PresenceHandler(self, dis, pres)
Presence tracker.
source code
 
_getItemData(self, jid, dataname)
Return specific jid's representation in internal format.
source code
 
_getResourceData(self, jid, dataname)
Return specific jid's resource representation in internal format.
source code
 
delItem(self, jid)
Delete contact 'jid' from roster.
source code
 
getAsk(self, jid)
Returns 'ask' value of contact 'jid'.
source code
 
getGroups(self, jid)
Returns groups list that contact 'jid' belongs to.
source code
 
getName(self, jid)
Returns name of contact 'jid'.
source code
 
getPriority(self, jid)
Returns priority of contact 'jid'.
source code
 
getRawRoster(self)
Returns roster representation in internal format.
source code
 
getRawItem(self, jid)
Returns roster item 'jid' representation in internal format.
source code
 
getShow(self, jid)
Returns 'show' value of contact 'jid'.
source code
 
getStatus(self, jid)
Returns 'status' value of contact 'jid'.
source code
 
getSubscription(self, jid)
Returns 'subscription' value of contact 'jid'.
source code
 
getResources(self, jid)
Returns list of connected resources of contact 'jid'.
source code
 
setItem(self, jid, name=None, groups=[])
Creates/renames contact 'jid' and sets the groups list that it now belongs to.
source code
 
getItems(self)
Return list of all [bare] JIDs that the roster is currently tracks.
source code
 
keys(self)
Same as getItems.
source code
 
__getitem__(self, item)
Get the contact in the internal format.
source code
 
getItem(self, item)
Get the contact in the internal format (or None if JID 'item' is not in roster).
source code
 
Subscribe(self, jid)
Send subscription request to JID 'jid'.
source code
 
Unsubscribe(self, jid)
Ask for removing our subscription for JID 'jid'.
source code
 
Authorize(self, jid)
Authorise JID 'jid'.
source code
 
Unauthorize(self, jid)
Unauthorise JID 'jid'.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Init internal variables.
Overrides: client.PlugIn.__init__

plugin(self, owner, request=1)

source code 
Register presence and subscription trackers in the owner's dispatcher. Also request roster from server if the 'request' argument is set. Used internally.

RosterIqHandler(self, dis, stanza)

source code 
Subscription tracker. Used internally for setting items state in internal roster representation.

PresenceHandler(self, dis, pres)

source code 
Presence tracker. Used internally for setting items' resources state in internal roster representation.

_getItemData(self, jid, dataname)

source code 
Return specific jid's representation in internal format. Used internally.

_getResourceData(self, jid, dataname)

source code 
Return specific jid's resource representation in internal format. Used internally.

getPriority(self, jid)

source code 
Returns priority of contact 'jid'. 'jid' should be a full (not bare) JID.

getShow(self, jid)

source code 
Returns 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID.

getStatus(self, jid)

source code 
Returns 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID.

keys(self)

source code 
Same as getItems. Provided for the sake of dictionary interface.

__getitem__(self, item)
(Indexing operator)

source code 
Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster.

Authorize(self, jid)

source code 
Authorise JID 'jid'. Works only if these JID requested auth previously.

Unauthorize(self, jid)

source code 
Unauthorise JID 'jid'. Use for declining authorisation request or for removing existing authorization.

xmpppy-0.4.1/doc/apidocs/xmpp.session.Session-class.html0000644000175000000500000011322210731034054022152 0ustar normansrc xmpp.session.Session
Package xmpp :: Module session :: Class Session
[hide private]
[frames] | no frames]

Class Session

source code

The Session class instance is used for storing all session-related info like credentials, socket/xml stream/session state flags, roster items (in case of client type connection) etc. Session object have no means of discovering is any info is ready to be read. Instead you should use poll() (recomended) or select() methods for this purpose. Session can be one of two types: 'server' and 'client'. 'server' session handles inbound connection and 'client' one used to create an outbound one. Session instance have multitude of internal attributes. The most imporant is the 'peer' one. It is set once the peer is authenticated (client).

Instance Methods [hide private]
 
__init__(self, socket, owner, xmlns=None, peer=None)
When the session is created it's type (client/server) is determined from the beginning.
source code
 
StartStream(self)
This method is used to initialise the internal xml expat parser and to send initial stream header (in case of client connection).
source code
 
receive(self)
Reads all pending incoming data.
source code
 
sendnow(self, chunk)
Put chunk into "immidiatedly send" queue.
source code
 
enqueue(self, stanza)
Takes Protocol instance as argument.
source code
 
push_queue(self, failreason='urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable')
If stream is authenticated than move items from "send" queue to "immidiatedly send" queue.
source code
 
flush_queue(self)
Put the "immidiatedly send" queue content on the wire.
source code
 
_dispatch(self, stanza, trusted=0)
This is callback that is used to pass the received stanza forth to owner's dispatcher _if_ the stream is authorised.
source code
 
_catch_stream_id(self, ns=None, tag='stream', attrs={})
This callback is used to detect the stream namespace of incoming stream.
source code
 
_stream_open(self, ns=None, tag='stream', attrs={})
This callback is used to handle opening stream tag of the incoming stream.
source code
 
feature(self, feature)
Declare some stream feature as activated one.
source code
 
unfeature(self, feature)
Declare some feature as illegal.
source code
 
_stream_close(self, unregister=1)
Write the closing stream tag and destroy the underlaying socket.
source code
 
terminate_stream(self, error=None, unregister=1)
Notify the peer about stream closure.
source code
 
_destroy_socket(self)
Break cyclic dependancies to let python's GC free memory right now.
source code
 
start_feature(self, f)
Declare some feature as "negotiating now" to prevent other features from start negotiating.
source code
 
stop_feature(self, f)
Declare some feature as "negotiated" to allow other features start negotiating.
source code
 
set_socket_state(self, newstate)
Change the underlaying socket state.
source code
 
set_session_state(self, newstate)
Change the session state.
source code
 
set_stream_state(self, newstate)
Change the underlaying XML stream state Stream starts with STREAM__NOT_OPENED and then proceeds with STREAM__OPENED, STREAM__CLOSING and STREAM__CLOSED states.
source code
Method Details [hide private]

__init__(self, socket, owner, xmlns=None, peer=None)
(Constructor)

source code 
When the session is created it's type (client/server) is determined from the beginning. socket argument is the pre-created socket-like object. It must have the following methods: send, recv, fileno, close. owner is the 'master' instance that have Dispatcher plugged into it and generally will take care about all session events. xmlns is the stream namespace that will be used. Client must set this argument If server sets this argument than stream will be dropped if opened with some another namespace. peer is the name of peer instance. This is the flag that differentiates client session from server session. Client must set it to the name of the server that will be connected, server must leave this argument alone.

StartStream(self)

source code 
This method is used to initialise the internal xml expat parser and to send initial stream header (in case of client connection). Should be used after initial connection and after every stream restart.

receive(self)

source code 
Reads all pending incoming data. Raises IOError on disconnection. Blocks until at least one byte is read.

sendnow(self, chunk)

source code 
Put chunk into "immidiatedly send" queue. Should only be used for auth/TLS stuff and like. If you just want to shedule regular stanza for delivery use enqueue method.

enqueue(self, stanza)

source code 
Takes Protocol instance as argument. Puts stanza into "send" fifo queue. Items into the send queue are hold until stream authenticated. After that this method is effectively the same as "sendnow" method.

push_queue(self, failreason='urn:ietf:params:xml:ns:xmpp-stanzas recipient-unavailable')

source code 
If stream is authenticated than move items from "send" queue to "immidiatedly send" queue. Else if the stream is failed then return all queued stanzas with error passed as argument. Otherwise do nothing.

flush_queue(self)

source code 
Put the "immidiatedly send" queue content on the wire. Blocks until at least one byte sent.

_dispatch(self, stanza, trusted=0)

source code 
This is callback that is used to pass the received stanza forth to owner's dispatcher _if_ the stream is authorised. Otherwise the stanza is just dropped. The 'trusted' argument is used to emulate stanza receive. This method is used internally.

_catch_stream_id(self, ns=None, tag='stream', attrs={})

source code 
This callback is used to detect the stream namespace of incoming stream. Used internally.

_stream_open(self, ns=None, tag='stream', attrs={})

source code 
This callback is used to handle opening stream tag of the incoming stream. In the case of client session it just make some validation. Server session also sends server headers and if the stream valid the features node. Used internally.

unfeature(self, feature)

source code 
Declare some feature as illegal. Illegal features can not be used. Example: BIND feature becomes illegal after Non-SASL auth.

_stream_close(self, unregister=1)

source code 
Write the closing stream tag and destroy the underlaying socket. Used internally.

terminate_stream(self, error=None, unregister=1)

source code 
Notify the peer about stream closure. Ensure that xmlstream is not brokes - i.e. if the stream isn't opened yet - open it before closure. If the error condition is specified than create a stream error and send it along with closing stream tag. Emulate receiving 'unavailable' type presence just before stream closure.

set_socket_state(self, newstate)

source code 
Change the underlaying socket state. Socket starts with SOCKET_UNCONNECTED state and then proceeds (possibly) to SOCKET_ALIVE and then to SOCKET_DEAD

set_session_state(self, newstate)

source code 
Change the session state. Session starts with SESSION_NOT_AUTHED state and then comes through SESSION_AUTHED, SESSION_BOUND, SESSION_OPENED and SESSION_CLOSED states.

set_stream_state(self, newstate)

source code 
Change the underlaying XML stream state Stream starts with STREAM__NOT_OPENED and then proceeds with STREAM__OPENED, STREAM__CLOSING and STREAM__CLOSED states. Note that some features (like TLS and SASL) requires stream re-start so this state can have non-linear changes.

xmpppy-0.4.1/doc/apidocs/xmpp.simplexml.NT-class.html0000644000175000000500000002074710731034055021411 0ustar normansrc xmpp.simplexml.NT
Package xmpp :: Module simplexml :: Class NT
[hide private]
[frames] | no frames]

Class NT

source code

 T --+
     |
    NT

Auxiliary class used to quick create node's child nodes.

Instance Methods [hide private]
 
__getattr__(self, attr) source code
 
__setattr__(self, attr, val) source code

Inherited from T: __delattr__, __init__

Method Details [hide private]

__getattr__(self, attr)
(Qualification operator)

source code 
Overrides: T.__getattr__

__setattr__(self, attr, val)

source code 
Overrides: T.__setattr__

xmpppy-0.4.1/doc/apidocs/xmpp.simplexml.Node-class.html0000644000175000000500000013422310731034055021750 0ustar normansrc xmpp.simplexml.Node
Package xmpp :: Module simplexml :: Class Node
[hide private]
[frames] | no frames]

Class Node

source code

Known Subclasses:
protocol.DataField, protocol.DataForm, protocol.Protocol, protocol.ErrorNode

Node class describes syntax of separate XML Node. It have a constructor that permits node creation from set of "namespace name", attributes and payload of text strings and other nodes. It does not natively support building node from text string and uses NodeBuilder class for that purpose. After creation node can be mangled in many ways so it can be completely changed. Also node can be serialised into string in one of two modes: default (where the textual representation of node describes it exactly) and "fancy" - with whitespace added to make indentation and thus make result more readable by human.

Node class have attribute FORCE_NODE_RECREATION that is defaults to False thus enabling fast node replication from the some other node. The drawback of the fast way is that new node shares some info with the "original" node that is changing the one node may influence the other. Though it is rarely needed (in xmpppy it is never needed at all since I'm usually never using original node after replication (and using replication only to move upwards on the classes tree).

Instance Methods [hide private]
 
__init__(self, tag=None, attrs={}, payload=[], parent=None, node=None)
Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of.
source code
 
__str__(self, fancy=0)
Method used to dump node into textual representation.
source code
 
getCDATA(self)
Serialise node, dropping all tags and leaving CDATA intact.
source code
 
addChild(self, name=None, attrs={}, payload=[], namespace=None, node=None)
If "node" argument is provided, adds it as child node.
source code
 
addData(self, data)
Adds some CDATA to node.
source code
 
clearData(self)
Removes all CDATA from the node.
source code
 
delAttr(self, key)
Deletes an attribute "key"
source code
 
delChild(self, node, attrs={})
Deletes the "node" from the node's childs list, if "node" is an instance.
source code
 
getAttrs(self)
Returns all node's attributes as dictionary.
source code
 
getAttr(self, key)
Returns value of specified attribute.
source code
 
getChildren(self)
Returns all node's child nodes as list.
source code
 
getData(self)
Returns all node CDATA as string (concatenated).
source code
 
getName(self)
Returns the name of node
source code
 
getNamespace(self)
Returns the namespace of node
source code
 
getParent(self)
Returns the parent of node (if present).
source code
 
getPayload(self)
Return the payload of node i.e.
source code
 
getTag(self, name, attrs={}, namespace=None)
Filters all child nodes using specified arguments as filter.
source code
 
getTagAttr(self, tag, attr)
Returns attribute value of the child with specified name (or None if no such attribute).
source code
 
getTagData(self, tag)
Returns cocatenated CDATA of the child with specified name.
source code
 
getTags(self, name, attrs={}, namespace=None, one=0)
Filters all child nodes using specified arguments as filter.
source code
 
setAttr(self, key, val)
Sets attribute "key" with the value "val".
source code
 
setData(self, data)
Sets node's CDATA to provided string.
source code
 
setName(self, val)
Changes the node name.
source code
 
setNamespace(self, namespace)
Changes the node namespace.
source code
 
setParent(self, node)
Sets node's parent to "node".
source code
 
setPayload(self, payload, add=0)
Sets node payload according to the list specified.
source code
 
setTag(self, name, attrs={}, namespace=None)
Same as getTag but if the node with specified namespace/attributes not found, creates such node and returns it.
source code
 
setTagAttr(self, tag, attr, val)
Creates new node (if not already present) with name "tag" and sets it's attribute "attr" to value "val".
source code
 
setTagData(self, tag, val, attrs={})
Creates new node (if not already present) with name "tag" and (optionally) attributes "attrs" and sets it's CDATA to string "val".
source code
 
has_attr(self, key)
Checks if node have attribute "key".
source code
 
__getitem__(self, item)
Returns node's attribute "item" value.
source code
 
__setitem__(self, item, val)
Sets node's attribute "item" value.
source code
 
__delitem__(self, item)
Deletes node's attribute "item".
source code
 
__getattr__(self, attr)
Reduce memory usage caused by T/NT classes - use memory only when needed.
source code
Class Variables [hide private]
  FORCE_NODE_RECREATION = 0
Method Details [hide private]

__init__(self, tag=None, attrs={}, payload=[], parent=None, node=None)
(Constructor)

source code 
Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of. Also the __init__ can be provided with "node" argument that is either a text string containing exactly one node or another Node instance to begin with. If both "node" and other arguments is provided then the node initially created as replica of "node" provided and then modified to be compliant with other arguments.

__str__(self, fancy=0)
(Informal representation operator)

source code 
Method used to dump node into textual representation. if "fancy" argument is set to True produces indented output for readability.

getCDATA(self)

source code 
Serialise node, dropping all tags and leaving CDATA intact. That is effectively kills all formatiing, leaving only text were contained in XML.

addChild(self, name=None, attrs={}, payload=[], namespace=None, node=None)

source code 
If "node" argument is provided, adds it as child node. Else creates new node from the other arguments' values and adds it as well.

delChild(self, node, attrs={})

source code 
Deletes the "node" from the node's childs list, if "node" is an instance. Else deletes the first node that have specified name and (optionally) attributes.

getPayload(self)

source code 
Return the payload of node i.e. list of child nodes and CDATA entries. F.e. for "<node>text1<nodea/><nodeb/> text2</node>" will be returned list: ['text1', <nodea instance>, <nodeb instance>, ' text2'].

getTag(self, name, attrs={}, namespace=None)

source code 
Filters all child nodes using specified arguments as filter. Returns the first found or None if not found.

getTags(self, name, attrs={}, namespace=None, one=0)

source code 
Filters all child nodes using specified arguments as filter. Returns the list of nodes found.

setData(self, data)

source code 
Sets node's CDATA to provided string. Resets all previous CDATA!

setParent(self, node)

source code 
Sets node's parent to "node". WARNING: do not checks if the parent already present and not removes the node from the list of childs of previous parent.

setPayload(self, payload, add=0)

source code 
Sets node payload according to the list specified. WARNING: completely replaces all node's previous content. If you wish just to add child or CDATA - use addData or addChild methods.

xmpppy-0.4.1/doc/apidocs/xmpp.simplexml.NodeBuilder-class.html0000644000175000000500000004732410731034055023264 0ustar normansrc xmpp.simplexml.NodeBuilder
Package xmpp :: Module simplexml :: Class NodeBuilder
[hide private]
[frames] | no frames]

Class NodeBuilder

source code

Builds a Node class minidom from data parsed to it. This class used for two purposes:
  1. Creation an XML Node from a textual representation. F.e. reading a config file. See an XML2Node method.
  2. Handling an incoming XML stream. This is done by mangling the __dispatch_depth parameter and redefining the dispatch method.
You do not need to use this class directly if you do not designing your own XML handler.

Instance Methods [hide private]
 
__init__(self, data=None, initial_node=None)
Takes two optional parameters: "data" and "initial_node".
source code
 
destroy(self)
Method used to allow class instance to be garbage-collected.
source code
 
starttag(self, tag, attrs)
XML Parser callback.
source code
 
endtag(self, tag)
XML Parser callback.
source code
 
handle_data(self, data)
XML Parser callback.
source code
 
handle_namespace_start(self, prefix, uri)
XML Parser callback.
source code
 
DEBUG(self, level, text, comment=None)
Gets all NodeBuilder walking events.
source code
 
getDom(self)
Returns just built Node.
source code
 
dispatch(self, stanza)
Gets called when the NodeBuilder reaches some level of depth on it's way up with the built node as argument.
source code
 
stream_header_received(self, ns, tag, attrs)
Method called when stream just opened.
source code
 
stream_footer_received(self)
Method called when stream just closed.
source code
Method Details [hide private]

__init__(self, data=None, initial_node=None)
(Constructor)

source code 
Takes two optional parameters: "data" and "initial_node". By default class initialised with empty Node class instance. Though, if "initial_node" is provided it used as "starting point". You can think about it as of "node upgrade". "data" (if provided) feeded to parser immidiatedly after instance init.

starttag(self, tag, attrs)

source code 
XML Parser callback. Used internally

endtag(self, tag)

source code 
XML Parser callback. Used internally

handle_data(self, data)

source code 
XML Parser callback. Used internally

handle_namespace_start(self, prefix, uri)

source code 
XML Parser callback. Used internally

DEBUG(self, level, text, comment=None)

source code 
Gets all NodeBuilder walking events. Can be used for debugging if redefined.

dispatch(self, stanza)

source code 
Gets called when the NodeBuilder reaches some level of depth on it's way up with the built node as argument. Can be redefined to convert incoming XML stanzas to program events.

xmpppy-0.4.1/doc/apidocs/xmpp.simplexml.T-class.html0000644000175000000500000001622510731034055021267 0ustar normansrc xmpp.simplexml.T
Package xmpp :: Module simplexml :: Class T
[hide private]
[frames] | no frames]

Class T

source code

Known Subclasses:
NT

Auxiliary class used to quick access to node's child nodes.

Instance Methods [hide private]
 
__init__(self, node) source code
 
__getattr__(self, attr) source code
 
__setattr__(self, attr, val) source code
 
__delattr__(self, attr) source code
xmpppy-0.4.1/doc/apidocs/xmpp.transports.HTTPPROXYsocket-class.html0000644000175000000500000003351010731034055024117 0ustar normansrc xmpp.transports.HTTPPROXYsocket
Package xmpp :: Module transports :: Class HTTPPROXYsocket
[hide private]
[frames] | no frames]

Class HTTPPROXYsocket

source code

client.PlugIn --+    
                |    
        TCPsocket --+
                    |
                   HTTPPROXYsocket

HTTP (CONNECT) proxy connection class. Uses TCPsocket as the base class redefines only connect method. Allows to use HTTP proxies like squid with (optionally) simple authentication (using login and password).

Instance Methods [hide private]
 
__init__(self, proxy, server, use_srv=True)
Caches proxy and target addresses.
source code
 
plugin(self, owner)
Starts connection.
source code
 
connect(self, dupe=None)
Starts connection.
source code
 
DEBUG(self, text, severity)
Overwrites DEBUG tag to allow debug output be presented as "CONNECTproxy".
source code

Inherited from TCPsocket: disconnect, disconnected, getHost, getPort, pending_data, plugout, receive, send

Inherited from client.PlugIn: PlugIn, PlugOut

Method Details [hide private]

__init__(self, proxy, server, use_srv=True)
(Constructor)

source code 
Caches proxy and target addresses. 'proxy' argument is a dictionary with mandatory keys 'host' and 'port' (proxy address) and optional keys 'user' and 'password' to use for authentication. 'server' argument is a tuple of host and port - just like TCPsocket uses.
Overrides: TCPsocket.__init__

plugin(self, owner)

source code 
Starts connection. Used interally. Returns non-empty string on success.
Overrides: TCPsocket.plugin

connect(self, dupe=None)

source code 
Starts connection. Connects to proxy, supplies login and password to it (if were specified while creating instance). Instructs proxy to make connection to the target server. Returns non-empty sting on success.
Overrides: TCPsocket.connect

DEBUG(self, text, severity)

source code 
Overwrites DEBUG tag to allow debug output be presented as "CONNECTproxy".
Overrides: client.PlugIn.DEBUG

xmpppy-0.4.1/doc/apidocs/xmpp.transports.TCPsocket-class.html0000644000175000000500000004476210731034055023137 0ustar normansrc xmpp.transports.TCPsocket
Package xmpp :: Module transports :: Class TCPsocket
[hide private]
[frames] | no frames]

Class TCPsocket

source code

client.PlugIn --+
                |
               TCPsocket
Known Subclasses:
HTTPPROXYsocket

This class defines direct TCP connection method.

Instance Methods [hide private]
 
__init__(self, server=None, use_srv=True)
Cache connection point 'server'.
source code
 
plugin(self, owner)
Fire up connection.
source code
 
getHost(self)
Return the 'host' value that is connection is [will be] made to.
source code
 
getPort(self)
Return the 'port' value that is connection is [will be] made to.
source code
 
connect(self, server=None)
Try to connect.
source code
 
plugout(self)
Disconnect from the remote server and unregister self.disconnected method from the owner's dispatcher.
source code
 
receive(self)
Reads all pending incoming data.
source code
 
send(self, raw_data)
Writes raw outgoing data.
source code
 
pending_data(self, timeout=0)
Returns true if there is a data ready to be read.
source code
 
disconnect(self)
Closes the socket.
source code
 
disconnected(self)
Called when a Network Error or disconnection occurs.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self, server=None, use_srv=True)
(Constructor)

source code 
Cache connection point 'server'. 'server' is the tuple of (host, port) absolutely the same as standard tcp socket uses.
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Fire up connection. Return non-empty string on success. Also registers self.disconnected method in the owner's dispatcher. Called internally.

connect(self, server=None)

source code 
Try to connect. Returns non-empty string on success.

receive(self)

source code 
Reads all pending incoming data. In case of disconnection calls owner's disconnected() method and then raises IOError exception.

send(self, raw_data)

source code 
Writes raw outgoing data. Blocks until done. If supplied data is unicode string, encodes it to utf-8 before send.

disconnected(self)

source code 
Called when a Network Error or disconnection occurs. Designed to be overidden.

xmpppy-0.4.1/doc/apidocs/xmpp.transports.TLS-class.html0000644000175000000500000003476110731034055021740 0ustar normansrc xmpp.transports.TLS
Package xmpp :: Module transports :: Class TLS
[hide private]
[frames] | no frames]

Class TLS

source code

client.PlugIn --+
                |
               TLS

TLS connection used to encrypts already estabilished tcp connection.

Instance Methods [hide private]
 
PlugIn(self, owner, now=0)
If the 'now' argument is true then starts using encryption immidiatedly.
source code
 
plugout(self, now=0)
Unregisters TLS handler's from owner's dispatcher.
source code
 
FeaturesHandler(self, conn, feats)
Used to analyse server <features/> tag for TLS support.
source code
 
pending_data(self, timeout=0)
Returns true if there possible is a data ready to be read.
source code
 
_startSSL(self)
Immidiatedly switch socket to TLS mode.
source code
 
StartTLSHandler(self, conn, starttls)
Handle server reply if TLS is allowed to process.
source code

Inherited from client.PlugIn: DEBUG, PlugOut, __init__

Method Details [hide private]

PlugIn(self, owner, now=0)

source code 
If the 'now' argument is true then starts using encryption immidiatedly. If 'now' in false then starts encryption as soon as TLS feature is declared by the server (if it were already declared - it is ok).
Overrides: client.PlugIn.PlugIn

plugout(self, now=0)

source code 
Unregisters TLS handler's from owner's dispatcher. Take note that encription can not be stopped once started. You can only break the connection and start over.

FeaturesHandler(self, conn, feats)

source code 
Used to analyse server <features/> tag for TLS support. If TLS is supported starts the encryption negotiation. Used internally

_startSSL(self)

source code 
Immidiatedly switch socket to TLS mode. Used internally.

StartTLSHandler(self, conn, starttls)

source code 
Handle server reply if TLS is allowed to process. Behaves accordingly. Used internally.

xmpppy-0.4.1/doc/apidocs/xmpp.transports.error-class.html0000644000175000000500000001341410731034055022417 0ustar normansrc xmpp.transports.error
Package xmpp :: Module transports :: Class error
[hide private]
[frames] | no frames]

Class error

source code

An exception to be raised in case of low-level errors in methods of 'transports' module.

Instance Methods [hide private]
 
__init__(self, comment)
Cache the descriptive string
source code
 
__str__(self)
Serialise exception into pre-cached descriptive string.
source code
xmpppy-0.4.1/doc/apidocs/xmpp.transports-pysrc.html0000644000175000000500000037711110731034057021333 0ustar normansrc xmpp.transports
Package xmpp :: Module transports
[hide private]
[frames] | no frames]

Source Code for Module xmpp.transports

  1  ##   transports.py 
  2  ## 
  3  ##   Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: transports.py,v 1.31 2007/09/15 11:34:28 normanr Exp $ 
 16   
 17  """ 
 18  This module contains the low-level implementations of xmpppy connect methods or 
 19  (in other words) transports for xmpp-stanzas. 
 20  Currently here is three transports: 
 21  direct TCP connect - TCPsocket class 
 22  proxied TCP connect - HTTPPROXYsocket class (CONNECT proxies) 
 23  TLS connection - TLS class. Can be used for SSL connections also. 
 24   
 25  Transports are stackable so you - f.e. TLS use HTPPROXYsocket or TCPsocket as more low-level transport. 
 26   
 27  Also exception 'error' is defined to allow capture of this module specific exceptions. 
 28  """ 
 29   
 30  import socket,select,base64,dispatcher,sys 
 31  from simplexml import ustr 
 32  from client import PlugIn 
 33  from protocol import * 
 34   
 35  # determine which DNS resolution library is available 
 36  HAVE_DNSPYTHON = False 
 37  HAVE_PYDNS = False 
 38  try: 
 39      import dns.resolver # http://dnspython.org/ 
 40      HAVE_DNSPYTHON = True 
 41  except ImportError: 
 42      try: 
 43          import DNS # http://pydns.sf.net/ 
 44          HAVE_PYDNS = True 
 45      except ImportError: 
 46          #TODO: use self.DEBUG() 
 47          sys.stderr.write("Could not load one of the supported DNS libraries (dnspython or pydns). SRV records will not be queried and you may need to set custom hostname/port for some servers to be accessible.\n") 
 48   
 49  DATA_RECEIVED='DATA RECEIVED' 
 50  DATA_SENT='DATA SENT' 
 51   
52 -class error:
53 """An exception to be raised in case of low-level errors in methods of 'transports' module."""
54 - def __init__(self,comment):
55 """Cache the descriptive string""" 56 self._comment=comment
57
58 - def __str__(self):
59 """Serialise exception into pre-cached descriptive string.""" 60 return self._comment
61 62 BUFLEN=1024
63 -class TCPsocket(PlugIn):
64 """ This class defines direct TCP connection method. """
65 - def __init__(self, server=None, use_srv=True):
66 """ Cache connection point 'server'. 'server' is the tuple of (host, port) 67 absolutely the same as standard tcp socket uses. """ 68 PlugIn.__init__(self) 69 self.DBG_LINE='socket' 70 self._exported_methods=[self.send,self.disconnect] 71 72 # SRV resolver 73 if use_srv and (HAVE_DNSPYTHON or HAVE_PYDNS): 74 host, port = server 75 possible_queries = ['_xmpp-client._tcp.' + host] 76 77 for query in possible_queries: 78 try: 79 if HAVE_DNSPYTHON: 80 answers = [x for x in dns.resolver.query(query, 'SRV')] 81 if answers: 82 host = str(answers[0].target) 83 port = int(answers[0].port) 84 break 85 elif HAVE_PYDNS: 86 # ensure we haven't cached an old configuration 87 DNS.ParseResolvConf() 88 response = DNS.Request().req(query, qtype='SRV') 89 answers = response.answers 90 if len(answers) > 0: 91 # ignore the priority and weight for now 92 _, _, port, host = answers[0]['data'] 93 del _ 94 port = int(port) 95 break 96 except: 97 #TODO: use self.DEBUG() 98 print 'An error occurred while looking up %s' % query 99 server = (host, port) 100 # end of SRV resolver 101 102 self._server = server
103
104 - def plugin(self, owner):
105 """ Fire up connection. Return non-empty string on success. 106 Also registers self.disconnected method in the owner's dispatcher. 107 Called internally. """ 108 if not self._server: self._server=(self._owner.Server,5222) 109 if not self.connect(self._server): return 110 self._owner.Connection=self 111 self._owner.RegisterDisconnectHandler(self.disconnected) 112 return 'ok'
113
114 - def getHost(self):
115 """ Return the 'host' value that is connection is [will be] made to.""" 116 return self._server[0]
117 - def getPort(self):
118 """ Return the 'port' value that is connection is [will be] made to.""" 119 return self._server[1]
120
121 - def connect(self,server=None):
122 """ Try to connect. Returns non-empty string on success. """ 123 try: 124 if not server: server=self._server 125 self._sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM) 126 self._sock.connect((server[0], int(server[1]))) 127 self._send=self._sock.sendall 128 self._recv=self._sock.recv 129 self.DEBUG("Successfully connected to remote host %s"%`server`,'start') 130 return 'ok' 131 except socket.error, (errno, strerror): 132 self.DEBUG("Failed to connect to remote host %s: %s (%s)"%(`server`, strerror, errno),'error') 133 except: pass
134
135 - def plugout(self):
136 """ Disconnect from the remote server and unregister self.disconnected method from 137 the owner's dispatcher. """ 138 self._sock.close() 139 if self._owner.__dict__.has_key('Connection'): 140 del self._owner.Connection 141 self._owner.UnregisterDisconnectHandler(self.disconnected)
142
143 - def receive(self):
144 """ Reads all pending incoming data. 145 In case of disconnection calls owner's disconnected() method and then raises IOError exception.""" 146 try: received = self._recv(BUFLEN) 147 except socket.sslerror,e: 148 self._seen_data=0 149 if e[0]==socket.SSL_ERROR_WANT_READ: return '' 150 if e[0]==socket.SSL_ERROR_WANT_WRITE: return '' 151 self.DEBUG('Socket error while receiving data','error') 152 sys.exc_clear() 153 self._owner.disconnected() 154 raise IOError("Disconnected from server") 155 except: received = '' 156 157 while self.pending_data(0): 158 try: add = self._recv(BUFLEN) 159 except: add='' 160 received +=add 161 if not add: break 162 163 if len(received): # length of 0 means disconnect 164 self._seen_data=1 165 self.DEBUG(received,'got') 166 if hasattr(self._owner, 'Dispatcher'): 167 self._owner.Dispatcher.Event('', DATA_RECEIVED, received) 168 else: 169 self.DEBUG('Socket error while receiving data','error') 170 self._owner.disconnected() 171 raise IOError("Disconnected from server") 172 return received
173
174 - def send(self,raw_data):
175 """ Writes raw outgoing data. Blocks until done. 176 If supplied data is unicode string, encodes it to utf-8 before send.""" 177 if type(raw_data)==type(u''): raw_data = raw_data.encode('utf-8') 178 elif type(raw_data)<>type(''): raw_data = ustr(raw_data).encode('utf-8') 179 try: 180 self._send(raw_data) 181 # Avoid printing messages that are empty keepalive packets. 182 if raw_data.strip(): 183 self.DEBUG(raw_data,'sent') 184 self._owner.Dispatcher.Event('', DATA_SENT, raw_data) 185 except: 186 self.DEBUG("Socket error while sending data",'error') 187 self._owner.disconnected()
188
189 - def pending_data(self,timeout=0):
190 """ Returns true if there is a data ready to be read. """ 191 return select.select([self._sock],[],[],timeout)[0]
192
193 - def disconnect(self):
194 """ Closes the socket. """ 195 self.DEBUG("Closing socket",'stop') 196 self._sock.close()
197
198 - def disconnected(self):
199 """ Called when a Network Error or disconnection occurs. 200 Designed to be overidden. """ 201 self.DEBUG("Socket operation failed",'error')
202 203 DBG_CONNECT_PROXY='CONNECTproxy'
204 -class HTTPPROXYsocket(TCPsocket):
205 """ HTTP (CONNECT) proxy connection class. Uses TCPsocket as the base class 206 redefines only connect method. Allows to use HTTP proxies like squid with 207 (optionally) simple authentication (using login and password). """
208 - def __init__(self,proxy,server,use_srv=True):
209 """ Caches proxy and target addresses. 210 'proxy' argument is a dictionary with mandatory keys 'host' and 'port' (proxy address) 211 and optional keys 'user' and 'password' to use for authentication. 212 'server' argument is a tuple of host and port - just like TCPsocket uses. """ 213 TCPsocket.__init__(self,server,use_srv) 214 self.DBG_LINE=DBG_CONNECT_PROXY 215 self._proxy=proxy
216
217 - def plugin(self, owner):
218 """ Starts connection. Used interally. Returns non-empty string on success.""" 219 owner.debug_flags.append(DBG_CONNECT_PROXY) 220 return TCPsocket.plugin(self,owner)
221
222 - def connect(self,dupe=None):
223 """ Starts connection. Connects to proxy, supplies login and password to it 224 (if were specified while creating instance). Instructs proxy to make 225 connection to the target server. Returns non-empty sting on success. """ 226 if not TCPsocket.connect(self,(self._proxy['host'],self._proxy['port'])): return 227 self.DEBUG("Proxy server contacted, performing authentification",'start') 228 connector = ['CONNECT %s:%s HTTP/1.0'%self._server, 229 'Proxy-Connection: Keep-Alive', 230 'Pragma: no-cache', 231 'Host: %s:%s'%self._server, 232 'User-Agent: HTTPPROXYsocket/v0.1'] 233 if self._proxy.has_key('user') and self._proxy.has_key('password'): 234 credentials = '%s:%s'%(self._proxy['user'],self._proxy['password']) 235 credentials = base64.encodestring(credentials).strip() 236 connector.append('Proxy-Authorization: Basic '+credentials) 237 connector.append('\r\n') 238 self.send('\r\n'.join(connector)) 239 try: reply = self.receive().replace('\r','') 240 except IOError: 241 self.DEBUG('Proxy suddenly disconnected','error') 242 self._owner.disconnected() 243 return 244 try: proto,code,desc=reply.split('\n')[0].split(' ',2) 245 except: raise error('Invalid proxy reply') 246 if code<>'200': 247 self.DEBUG('Invalid proxy reply: %s %s %s'%(proto,code,desc),'error') 248 self._owner.disconnected() 249 return 250 while reply.find('\n\n') == -1: 251 try: reply += self.receive().replace('\r','') 252 except IOError: 253 self.DEBUG('Proxy suddenly disconnected','error') 254 self._owner.disconnected() 255 return 256 self.DEBUG("Authentification successfull. Jabber server contacted.",'ok') 257 return 'ok'
258
259 - def DEBUG(self,text,severity):
260 """Overwrites DEBUG tag to allow debug output be presented as "CONNECTproxy".""" 261 return self._owner.DEBUG(DBG_CONNECT_PROXY,text,severity)
262
263 -class TLS(PlugIn):
264 """ TLS connection used to encrypts already estabilished tcp connection."""
265 - def PlugIn(self,owner,now=0):
266 """ If the 'now' argument is true then starts using encryption immidiatedly. 267 If 'now' in false then starts encryption as soon as TLS feature is 268 declared by the server (if it were already declared - it is ok). 269 """ 270 if owner.__dict__.has_key('TLS'): return # Already enabled. 271 PlugIn.PlugIn(self,owner) 272 DBG_LINE='TLS' 273 if now: return self._startSSL() 274 if self._owner.Dispatcher.Stream.features: 275 try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) 276 except NodeProcessed: pass 277 else: self._owner.RegisterHandlerOnce('features',self.FeaturesHandler,xmlns=NS_STREAMS) 278 self.starttls=None
279
280 - def plugout(self,now=0):
281 """ Unregisters TLS handler's from owner's dispatcher. Take note that encription 282 can not be stopped once started. You can only break the connection and start over.""" 283 self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) 284 self._owner.UnregisterHandler('proceed',self.StartTLSHandler,xmlns=NS_TLS) 285 self._owner.UnregisterHandler('failure',self.StartTLSHandler,xmlns=NS_TLS)
286
287 - def FeaturesHandler(self, conn, feats):
288 """ Used to analyse server <features/> tag for TLS support. 289 If TLS is supported starts the encryption negotiation. Used internally""" 290 if not feats.getTag('starttls',namespace=NS_TLS): 291 self.DEBUG("TLS unsupported by remote server.",'warn') 292 return 293 self.DEBUG("TLS supported by remote server. Requesting TLS start.",'ok') 294 self._owner.RegisterHandlerOnce('proceed',self.StartTLSHandler,xmlns=NS_TLS) 295 self._owner.RegisterHandlerOnce('failure',self.StartTLSHandler,xmlns=NS_TLS) 296 self._owner.Connection.send('<starttls xmlns="%s"/>'%NS_TLS) 297 raise NodeProcessed
298
299 - def pending_data(self,timeout=0):
300 """ Returns true if there possible is a data ready to be read. """ 301 return self._tcpsock._seen_data or select.select([self._tcpsock._sock],[],[],timeout)[0]
302
303 - def _startSSL(self):
304 """ Immidiatedly switch socket to TLS mode. Used internally.""" 305 """ Here we should switch pending_data to hint mode.""" 306 tcpsock=self._owner.Connection 307 tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None) 308 tcpsock._sslIssuer = tcpsock._sslObj.issuer() 309 tcpsock._sslServer = tcpsock._sslObj.server() 310 tcpsock._recv = tcpsock._sslObj.read 311 tcpsock._send = tcpsock._sslObj.write 312 313 tcpsock._seen_data=1 314 self._tcpsock=tcpsock 315 tcpsock.pending_data=self.pending_data 316 tcpsock._sock.setblocking(0) 317 318 self.starttls='success'
319
320 - def StartTLSHandler(self, conn, starttls):
321 """ Handle server reply if TLS is allowed to process. Behaves accordingly. 322 Used internally.""" 323 if starttls.getNamespace()<>NS_TLS: return 324 self.starttls=starttls.getName() 325 if self.starttls=='failure': 326 self.DEBUG("Got starttls response: "+self.starttls,'error') 327 return 328 self.DEBUG("Got starttls proceed response. Switching to TLS/SSL...",'ok') 329 self._startSSL() 330 self._owner.Dispatcher.PlugOut() 331 dispatcher.Dispatcher().PlugIn(self._owner)
332

xmpppy-0.4.1/doc/apidocs/xmpp.commands-pysrc.html0000644000175000000500000047017710731034060020715 0ustar normansrc xmpp.commands
Package xmpp :: Module commands
[hide private]
[frames] | no frames]

Source Code for Module xmpp.commands

  1  ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $ 
  2   
  3  ## Ad-Hoc Command manager 
  4  ## Mike Albon (c) 5th January 2005 
  5   
  6  ##   This program is free software; you can redistribute it and/or modify 
  7  ##   it under the terms of the GNU General Public License as published by 
  8  ##   the Free Software Foundation; either version 2, or (at your option) 
  9  ##   any later version. 
 10  ## 
 11  ##   This program is distributed in the hope that it will be useful, 
 12  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 13  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 14  ##   GNU General Public License for more details. 
 15   
 16   
 17  """This module is a ad-hoc command processor for xmpppy. It uses the plug-in mechanism like most of the core library. It depends on a DISCO browser manager. 
 18   
 19  There are 3 classes here, a command processor Commands like the Browser, and a command template plugin Command, and an example command. 
 20   
 21  To use this module: 
 22       
 23      Instansiate the module with the parent transport and disco browser manager as parameters. 
 24      'Plug in' commands using the command template. 
 25      The command feature must be added to existing disco replies where neccessary. 
 26       
 27  What it supplies: 
 28       
 29      Automatic command registration with the disco browser manager. 
 30      Automatic listing of commands in the public command list. 
 31      A means of handling requests, by redirection though the command manager. 
 32  """ 
 33   
 34  from protocol import * 
 35  from client import PlugIn 
 36   
37 -class Commands(PlugIn):
38 """Commands is an ancestor of PlugIn and can be attached to any session. 39 40 The commands class provides a lookup and browse mechnism. It follows the same priciple of the Browser class, for Service Discovery to provide the list of commands, it adds the 'list' disco type to your existing disco handler function. 41 42 How it works: 43 The commands are added into the existing Browser on the correct nodes. When the command list is built the supplied discovery handler function needs to have a 'list' option in type. This then gets enumerated, all results returned as None are ignored. 44 The command executed is then called using it's Execute method. All session management is handled by the command itself. 45 """
46 - def __init__(self, browser):
47 """Initialises class and sets up local variables""" 48 PlugIn.__init__(self) 49 DBG_LINE='commands' 50 self._exported_methods=[] 51 self._handlers={'':{}} 52 self._browser = browser
53
54 - def plugin(self, owner):
55 """Makes handlers within the session""" 56 # Plug into the session and the disco manager 57 # We only need get and set, results are not needed by a service provider, only a service user. 58 owner.RegisterHandler('iq',self._CommandHandler,typ='set',ns=NS_COMMANDS) 59 owner.RegisterHandler('iq',self._CommandHandler,typ='get',ns=NS_COMMANDS) 60 self._browser.setDiscoHandler(self._DiscoHandler,node=NS_COMMANDS,jid='')
61
62 - def plugout(self):
63 """Removes handlers from the session""" 64 # unPlug from the session and the disco manager 65 self._owner.UnregisterHandler('iq',self._CommandHandler,ns=NS_COMMANDS) 66 for jid in self._handlers: 67 self._browser.delDiscoHandler(self._DiscoHandler,node=NS_COMMANDS)
68
69 - def _CommandHandler(self,conn,request):
70 """The internal method to process the routing of command execution requests""" 71 # This is the command handler itself. 72 # We must: 73 # Pass on command execution to command handler 74 # (Do we need to keep session details here, or can that be done in the command?) 75 jid = str(request.getTo()) 76 try: 77 node = request.getTagAttr('command','node') 78 except: 79 conn.send(Error(request,ERR_BAD_REQUEST)) 80 raise NodeProcessed 81 if self._handlers.has_key(jid): 82 if self._handlers[jid].has_key(node): 83 self._handlers[jid][node]['execute'](conn,request) 84 else: 85 conn.send(Error(request,ERR_ITEM_NOT_FOUND)) 86 raise NodeProcessed 87 elif self._handlers[''].has_key(node): 88 self._handlers[''][node]['execute'](conn,request) 89 else: 90 conn.send(Error(request,ERR_ITEM_NOT_FOUND)) 91 raise NodeProcessed
92
93 - def _DiscoHandler(self,conn,request,typ):
94 """The internal method to process service discovery requests""" 95 # This is the disco manager handler. 96 if typ == 'items': 97 # We must: 98 # Generate a list of commands and return the list 99 # * This handler does not handle individual commands disco requests. 100 # Pseudo: 101 # Enumerate the 'item' disco of each command for the specified jid 102 # Build responce and send 103 # To make this code easy to write we add an 'list' disco type, it returns a tuple or 'none' if not advertised 104 list = [] 105 items = [] 106 jid = str(request.getTo()) 107 # Get specific jid based results 108 if self._handlers.has_key(jid): 109 for each in self._handlers[jid].keys(): 110 items.append((jid,each)) 111 else: 112 # Get generic results 113 for each in self._handlers[''].keys(): 114 items.append(('',each)) 115 if items != []: 116 for each in items: 117 i = self._handlers[each[0]][each[1]]['disco'](conn,request,'list') 118 if i != None: 119 list.append(Node(tag='item',attrs={'jid':i[0],'node':i[1],'name':i[2]})) 120 iq = request.buildReply('result') 121 if request.getQuerynode(): iq.setQuerynode(request.getQuerynode()) 122 iq.setQueryPayload(list) 123 conn.send(iq) 124 else: 125 conn.send(Error(request,ERR_ITEM_NOT_FOUND)) 126 raise NodeProcessed 127 elif typ == 'info': 128 return {'ids':[{'category':'automation','type':'command-list'}],'features':[]}
129
130 - def addCommand(self,name,cmddisco,cmdexecute,jid=''):
131 """The method to call if adding a new command to the session, the requred parameters of cmddisco and cmdexecute are the methods to enable that command to be executed""" 132 # This command takes a command object and the name of the command for registration 133 # We must: 134 # Add item into disco 135 # Add item into command list 136 if not self._handlers.has_key(jid): 137 self._handlers[jid]={} 138 self._browser.setDiscoHandler(self._DiscoHandler,node=NS_COMMANDS,jid=jid) 139 if self._handlers[jid].has_key(name): 140 raise NameError,'Command Exists' 141 else: 142 self._handlers[jid][name]={'disco':cmddisco,'execute':cmdexecute} 143 # Need to add disco stuff here 144 self._browser.setDiscoHandler(cmddisco,node=name,jid=jid)
145
146 - def delCommand(self,name,jid=''):
147 """Removed command from the session""" 148 # This command takes a command object and the name used for registration 149 # We must: 150 # Remove item from disco 151 # Remove item from command list 152 if not self._handlers.has_key(jid): 153 raise NameError,'Jid not found' 154 if not self._handlers[jid].has_key(name): 155 raise NameError, 'Command not found' 156 else: 157 #Do disco removal here 158 command = self.getCommand(name,jid)['disco'] 159 del self._handlers[jid][name] 160 self._browser.delDiscoHandler(command,node=name,jid=jid)
161
162 - def getCommand(self,name,jid=''):
163 """Returns the command tuple""" 164 # This gets the command object with name 165 # We must: 166 # Return item that matches this name 167 if not self._handlers.has_key(jid): 168 raise NameError,'Jid not found' 169 elif not self._handlers[jid].has_key(name): 170 raise NameError,'Command not found' 171 else: 172 return self._handlers[jid][name]
173
174 -class Command_Handler_Prototype(PlugIn):
175 """This is a prototype command handler, as each command uses a disco method 176 and execute method you can implement it any way you like, however this is 177 my first attempt at making a generic handler that you can hang process 178 stages on too. There is an example command below. 179 180 The parameters are as follows: 181 name : the name of the command within the jabber environment 182 description : the natural language description 183 discofeatures : the features supported by the command 184 initial : the initial command in the from of {'execute':commandname} 185 186 All stages set the 'actions' dictionary for each session to represent the possible options available. 187 """ 188 name = 'examplecommand' 189 count = 0 190 description = 'an example command' 191 discofeatures = [NS_COMMANDS,NS_DATA] 192 # This is the command template
193 - def __init__(self,jid=''):
194 """Set up the class""" 195 PlugIn.__init__(self) 196 DBG_LINE='command' 197 self.sessioncount = 0 198 self.sessions = {} 199 # Disco information for command list pre-formatted as a tuple 200 self.discoinfo = {'ids':[{'category':'automation','type':'command-node','name':self.description}],'features': self.discofeatures} 201 self._jid = jid
202
203 - def plugin(self,owner):
204 """Plug command into the commands class""" 205 # The owner in this instance is the Command Processor 206 self._commands = owner 207 self._owner = owner._owner 208 self._commands.addCommand(self.name,self._DiscoHandler,self.Execute,jid=self._jid)
209
210 - def plugout(self):
211 """Remove command from the commands class""" 212 self._commands.delCommand(self.name,self._jid)
213
214 - def getSessionID(self):
215 """Returns an id for the command session""" 216 self.count = self.count+1 217 return 'cmd-%s-%d'%(self.name,self.count)
218
219 - def Execute(self,conn,request):
220 """The method that handles all the commands, and routes them to the correct method for that stage.""" 221 # New request or old? 222 try: 223 session = request.getTagAttr('command','sessionid') 224 except: 225 session = None 226 try: 227 action = request.getTagAttr('command','action') 228 except: 229 action = None 230 if action == None: action = 'execute' 231 # Check session is in session list 232 if self.sessions.has_key(session): 233 if self.sessions[session]['jid']==request.getFrom(): 234 # Check action is vaild 235 if self.sessions[session]['actions'].has_key(action): 236 # Execute next action 237 self.sessions[session]['actions'][action](conn,request) 238 else: 239 # Stage not presented as an option 240 self._owner.send(Error(request,ERR_BAD_REQUEST)) 241 raise NodeProcessed 242 else: 243 # Jid and session don't match. Go away imposter 244 self._owner.send(Error(request,ERR_BAD_REQUEST)) 245 raise NodeProcessed 246 elif session != None: 247 # Not on this sessionid you won't. 248 self._owner.send(Error(request,ERR_BAD_REQUEST)) 249 raise NodeProcessed 250 else: 251 # New session 252 self.initial[action](conn,request)
253
254 - def _DiscoHandler(self,conn,request,type):
255 """The handler for discovery events""" 256 if type == 'list': 257 return (request.getTo(),self.name,self.description) 258 elif type == 'items': 259 return [] 260 elif type == 'info': 261 return self.discoinfo
262
263 -class TestCommand(Command_Handler_Prototype):
264 """ Example class. You should read source if you wish to understate how it works. 265 Generally, it presents a "master" that giudes user through to calculate something. 266 """ 267 name = 'testcommand' 268 description = 'a noddy example command'
269 - def __init__(self,jid=''):
270 """ Init internal constants. """ 271 Command_Handler_Prototype.__init__(self,jid) 272 self.initial = {'execute':self.cmdFirstStage}
273
274 - def cmdFirstStage(self,conn,request):
275 """ Determine """ 276 # This is the only place this should be repeated as all other stages should have SessionIDs 277 try: 278 session = request.getTagAttr('command','sessionid') 279 except: 280 session = None 281 if session == None: 282 session = self.getSessionID() 283 self.sessions[session]={'jid':request.getFrom(),'actions':{'cancel':self.cmdCancel,'next':self.cmdSecondStage,'execute':self.cmdSecondStage},'data':{'type':None}} 284 # As this is the first stage we only send a form 285 reply = request.buildReply('result') 286 form = DataForm(title='Select type of operation',data=['Use the combobox to select the type of calculation you would like to do, then click Next',DataField(name='calctype',desc='Calculation Type',value=self.sessions[session]['data']['type'],options=[['circlediameter','Calculate the Diameter of a circle'],['circlearea','Calculate the area of a circle']],typ='list-single',required=1)]) 287 replypayload = [Node('actions',attrs={'execute':'next'},payload=[Node('next')]),form] 288 reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':session,'status':'executing'},payload=replypayload) 289 self._owner.send(reply) 290 raise NodeProcessed
291
292 - def cmdSecondStage(self,conn,request):
293 form = DataForm(node = request.getTag(name='command').getTag(name='x',namespace=NS_DATA)) 294 self.sessions[request.getTagAttr('command','sessionid')]['data']['type']=form.getField('calctype').getValue() 295 self.sessions[request.getTagAttr('command','sessionid')]['actions']={'cancel':self.cmdCancel,None:self.cmdThirdStage,'previous':self.cmdFirstStage,'execute':self.cmdThirdStage,'next':self.cmdThirdStage} 296 # The form generation is split out to another method as it may be called by cmdThirdStage 297 self.cmdSecondStageReply(conn,request)
298
299 - def cmdSecondStageReply(self,conn,request):
300 reply = request.buildReply('result') 301 form = DataForm(title = 'Enter the radius', data=['Enter the radius of the circle (numbers only)',DataField(desc='Radius',name='radius',typ='text-single')]) 302 replypayload = [Node('actions',attrs={'execute':'complete'},payload=[Node('complete'),Node('prev')]),form] 303 reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'executing'},payload=replypayload) 304 self._owner.send(reply) 305 raise NodeProcessed
306
307 - def cmdThirdStage(self,conn,request):
308 form = DataForm(node = request.getTag(name='command').getTag(name='x',namespace=NS_DATA)) 309 try: 310 num = float(form.getField('radius').getValue()) 311 except: 312 self.cmdSecondStageReply(conn,request) 313 from math import pi 314 if self.sessions[request.getTagAttr('command','sessionid')]['data']['type'] == 'circlearea': 315 result = (num**2)*pi 316 else: 317 result = num*2*pi 318 reply = request.buildReply('result') 319 form = DataForm(typ='result',data=[DataField(desc='result',name='result',value=result)]) 320 reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'completed'},payload=[form]) 321 self._owner.send(reply) 322 raise NodeProcessed
323
324 - def cmdCancel(self,conn,request):
325 reply = request.buildReply('result') 326 reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'cancelled'}) 327 self._owner.send(reply) 328 del self.sessions[request.getTagAttr('command','sessionid')]
329

xmpppy-0.4.1/doc/apidocs/xmpp.roster-pysrc.html0000644000175000000500000027133110731034061020422 0ustar normansrc xmpp.roster
Package xmpp :: Module roster
[hide private]
[frames] | no frames]

Source Code for Module xmpp.roster

  1  ##   roster.py 
  2  ## 
  3  ##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: roster.py,v 1.20 2005/07/13 13:22:52 snakeru Exp $ 
 16   
 17  """ 
 18  Simple roster implementation. Can be used though for different tasks like 
 19  mass-renaming of contacts. 
 20  """ 
 21   
 22  from protocol import * 
 23  from client import PlugIn 
 24   
25 -class Roster(PlugIn):
26 """ Defines a plenty of methods that will allow you to manage roster. 27 Also automatically track presences from remote JIDs taking into 28 account that every JID can have multiple resources connected. Does not 29 currently support 'error' presences. 30 You can also use mapping interface for access to the internal representation of 31 contacts in roster. 32 """
33 - def __init__(self):
34 """ Init internal variables. """ 35 PlugIn.__init__(self) 36 self.DBG_LINE='roster' 37 self._data = {} 38 self.set=None 39 self._exported_methods=[self.getRoster]
40
41 - def plugin(self,owner,request=1):
42 """ Register presence and subscription trackers in the owner's dispatcher. 43 Also request roster from server if the 'request' argument is set. 44 Used internally.""" 45 self._owner.RegisterHandler('iq',self.RosterIqHandler,'result',NS_ROSTER) 46 self._owner.RegisterHandler('iq',self.RosterIqHandler,'set',NS_ROSTER) 47 self._owner.RegisterHandler('presence',self.PresenceHandler) 48 if request: self.Request()
49
50 - def Request(self,force=0):
51 """ Request roster from server if it were not yet requested 52 (or if the 'force' argument is set). """ 53 if self.set is None: self.set=0 54 elif not force: return 55 self._owner.send(Iq('get',NS_ROSTER)) 56 self.DEBUG('Roster requested from server','start')
57
58 - def getRoster(self):
59 """ Requests roster from server if neccessary and returns self.""" 60 if not self.set: self.Request() 61 while not self.set: self._owner.Process(10) 62 return self
63
64 - def RosterIqHandler(self,dis,stanza):
65 """ Subscription tracker. Used internally for setting items state in 66 internal roster representation. """ 67 for item in stanza.getTag('query').getTags('item'): 68 jid=item.getAttr('jid') 69 if item.getAttr('subscription')=='remove': 70 if self._data.has_key(jid): del self._data[jid] 71 raise NodeProcessed # a MUST 72 self.DEBUG('Setting roster item %s...'%jid,'ok') 73 if not self._data.has_key(jid): self._data[jid]={} 74 self._data[jid]['name']=item.getAttr('name') 75 self._data[jid]['ask']=item.getAttr('ask') 76 self._data[jid]['subscription']=item.getAttr('subscription') 77 self._data[jid]['groups']=[] 78 if not self._data[jid].has_key('resources'): self._data[jid]['resources']={} 79 for group in item.getTags('group'): self._data[jid]['groups'].append(group.getData()) 80 self._data[self._owner.User+'@'+self._owner.Server]={'resources':{},'name':None,'ask':None,'subscription':None,'groups':None,} 81 self.set=1 82 raise NodeProcessed # a MUST. Otherwise you'll get back an <iq type='error'/>
83
84 - def PresenceHandler(self,dis,pres):
85 """ Presence tracker. Used internally for setting items' resources state in 86 internal roster representation. """ 87 jid=JID(pres.getFrom()) 88 if not self._data.has_key(jid.getStripped()): self._data[jid.getStripped()]={'name':None,'ask':None,'subscription':'none','groups':['Not in roster'],'resources':{}} 89 90 item=self._data[jid.getStripped()] 91 typ=pres.getType() 92 93 if not typ: 94 self.DEBUG('Setting roster item %s for resource %s...'%(jid.getStripped(),jid.getResource()),'ok') 95 item['resources'][jid.getResource()]=res={'show':None,'status':None,'priority':'0','timestamp':None} 96 if pres.getTag('show'): res['show']=pres.getShow() 97 if pres.getTag('status'): res['status']=pres.getStatus() 98 if pres.getTag('priority'): res['priority']=pres.getPriority() 99 if not pres.getTimestamp(): pres.setTimestamp() 100 res['timestamp']=pres.getTimestamp() 101 elif typ=='unavailable' and item['resources'].has_key(jid.getResource()): del item['resources'][jid.getResource()]
102 # Need to handle type='error' also 103
104 - def _getItemData(self,jid,dataname):
105 """ Return specific jid's representation in internal format. Used internally. """ 106 jid=jid[:(jid+'/').find('/')] 107 return self._data[jid][dataname]
108 - def _getResourceData(self,jid,dataname):
109 """ Return specific jid's resource representation in internal format. Used internally. """ 110 if jid.find('/')+1: 111 jid,resource=jid.split('/',1) 112 if self._data[jid]['resources'].has_key(resource): return self._data[jid]['resources'][resource][dataname] 113 elif self._data[jid]['resources'].keys(): 114 lastpri=-129 115 for r in self._data[jid]['resources'].keys(): 116 if int(self._data[jid]['resources'][r]['priority'])>lastpri: resource,lastpri=r,int(self._data[jid]['resources'][r]['priority']) 117 return self._data[jid]['resources'][resource][dataname]
118 - def delItem(self,jid):
119 """ Delete contact 'jid' from roster.""" 120 self._owner.send(Iq('set',NS_ROSTER,payload=[Node('item',{'jid':jid,'subscription':'remove'})]))
121 - def getAsk(self,jid):
122 """ Returns 'ask' value of contact 'jid'.""" 123 return self._getItemData(jid,'ask')
124 - def getGroups(self,jid):
125 """ Returns groups list that contact 'jid' belongs to.""" 126 return self._getItemData(jid,'groups')
127 - def getName(self,jid):
128 """ Returns name of contact 'jid'.""" 129 return self._getItemData(jid,'name')
130 - def getPriority(self,jid):
131 """ Returns priority of contact 'jid'. 'jid' should be a full (not bare) JID.""" 132 return self._getResourceData(jid,'priority')
133 - def getRawRoster(self):
134 """ Returns roster representation in internal format. """ 135 return self._data
136 - def getRawItem(self,jid):
137 """ Returns roster item 'jid' representation in internal format. """ 138 return self._data[jid[:(jid+'/').find('/')]]
139 - def getShow(self, jid):
140 """ Returns 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID.""" 141 return self._getResourceData(jid,'show')
142 - def getStatus(self, jid):
143 """ Returns 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID.""" 144 return self._getResourceData(jid,'status')
145 - def getSubscription(self,jid):
146 """ Returns 'subscription' value of contact 'jid'.""" 147 return self._getItemData(jid,'subscription')
148 - def getResources(self,jid):
149 """ Returns list of connected resources of contact 'jid'.""" 150 return self._data[jid[:(jid+'/').find('/')]]['resources'].keys()
151 - def setItem(self,jid,name=None,groups=[]):
152 """ Creates/renames contact 'jid' and sets the groups list that it now belongs to.""" 153 iq=Iq('set',NS_ROSTER) 154 query=iq.getTag('query') 155 attrs={'jid':jid} 156 if name: attrs['name']=name 157 item=query.setTag('item',attrs) 158 for group in groups: item.addChild(node=Node('group',payload=[group])) 159 self._owner.send(iq)
160 - def getItems(self):
161 """ Return list of all [bare] JIDs that the roster is currently tracks.""" 162 return self._data.keys()
163 - def keys(self):
164 """ Same as getItems. Provided for the sake of dictionary interface.""" 165 return self._data.keys()
166 - def __getitem__(self,item):
167 """ Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster.""" 168 return self._data[item]
169 - def getItem(self,item):
170 """ Get the contact in the internal format (or None if JID 'item' is not in roster).""" 171 if self._data.has_key(item): return self._data[item]
172 - def Subscribe(self,jid):
173 """ Send subscription request to JID 'jid'.""" 174 self._owner.send(Presence(jid,'subscribe'))
175 - def Unsubscribe(self,jid):
176 """ Ask for removing our subscription for JID 'jid'.""" 177 self._owner.send(Presence(jid,'unsubscribe'))
178 - def Authorize(self,jid):
179 """ Authorise JID 'jid'. Works only if these JID requested auth previously. """ 180 self._owner.send(Presence(jid,'subscribed'))
181 - def Unauthorize(self,jid):
182 """ Unauthorise JID 'jid'. Use for declining authorisation request 183 or for removing existing authorization. """ 184 self._owner.send(Presence(jid,'unsubscribed'))
185

xmpppy-0.4.1/doc/apidocs/xmpp.simplexml-pysrc.html0000644000175000000500000052072010731034062021116 0ustar normansrc xmpp.simplexml
Package xmpp :: Module simplexml
[hide private]
[frames] | no frames]

Source Code for Module xmpp.simplexml

  1  ##   simplexml.py based on Mattew Allum's xmlstream.py 
  2  ## 
  3  ##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: simplexml.py,v 1.33 2007/09/11 12:46:16 normanr Exp $ 
 16   
 17  """Simplexml module provides xmpppy library with all needed tools to handle XML nodes and XML streams. 
 18  I'm personally using it in many other separate projects. It is designed to be as standalone as possible.""" 
 19   
 20  import xml.parsers.expat 
 21   
22 -def XMLescape(txt):
23 """Returns provided string with symbols & < > " replaced by their respective XML entities.""" 24 return txt.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace('"', "&quot;")
25 26 ENCODING='utf-8'
27 -def ustr(what):
28 """Converts object "what" to unicode string using it's own __str__ method if accessible or unicode method otherwise.""" 29 if type(what) == type(u''): return what 30 try: r=what.__str__() 31 except AttributeError: r=str(what) 32 if type(r)<>type(u''): return unicode(r,ENCODING) 33 return r
34
35 -class Node:
36 """ Node class describes syntax of separate XML Node. It have a constructor that permits node creation 37 from set of "namespace name", attributes and payload of text strings and other nodes. 38 It does not natively support building node from text string and uses NodeBuilder class for that purpose. 39 After creation node can be mangled in many ways so it can be completely changed. 40 Also node can be serialised into string in one of two modes: default (where the textual representation 41 of node describes it exactly) and "fancy" - with whitespace added to make indentation and thus make 42 result more readable by human. 43 44 Node class have attribute FORCE_NODE_RECREATION that is defaults to False thus enabling fast node 45 replication from the some other node. The drawback of the fast way is that new node shares some 46 info with the "original" node that is changing the one node may influence the other. Though it is 47 rarely needed (in xmpppy it is never needed at all since I'm usually never using original node after 48 replication (and using replication only to move upwards on the classes tree). 49 """ 50 FORCE_NODE_RECREATION=0
51 - def __init__(self, tag=None, attrs={}, payload=[], parent=None, node=None):
52 """ Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it 53 by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings 54 and child nodes that this node carries within itself and "parent" argument that is another node 55 that this one will be the child of. Also the __init__ can be provided with "node" argument that is 56 either a text string containing exactly one node or another Node instance to begin with. If both 57 "node" and other arguments is provided then the node initially created as replica of "node" 58 provided and then modified to be compliant with other arguments.""" 59 if node: 60 if self.FORCE_NODE_RECREATION and type(node)==type(self): node=str(node) 61 if type(node)<>type(self): node=NodeBuilder(node,self) 62 else: 63 self.name,self.namespace,self.attrs,self.data,self.kids,self.parent = node.name,node.namespace,{},[],[],node.parent 64 for key in node.attrs.keys(): self.attrs[key]=node.attrs[key] 65 for data in node.data: self.data.append(data) 66 for kid in node.kids: self.kids.append(kid) 67 else: self.name,self.namespace,self.attrs,self.data,self.kids,self.parent = 'tag','',{},[],[],None 68 69 if tag: self.namespace, self.name = ([self.namespace]+tag.split())[-2:] 70 if parent: self.parent = parent 71 if self.parent and not self.namespace: self.namespace=self.parent.namespace 72 for attr in attrs.keys(): 73 self.attrs[attr]=attrs[attr] 74 if type(payload) in (type(''),type(u'')): payload=[payload] 75 for i in payload: 76 if type(i)==type(self): self.addChild(node=i) 77 else: self.addData(i)
78
79 - def __str__(self,fancy=0):
80 """ Method used to dump node into textual representation. 81 if "fancy" argument is set to True produces indented output for readability.""" 82 s = (fancy-1) * 2 * ' ' + "<" + self.name 83 if self.namespace: 84 if not self.parent or self.parent.namespace!=self.namespace: 85 s = s + ' xmlns="%s"'%self.namespace 86 for key in self.attrs.keys(): 87 val = ustr(self.attrs[key]) 88 s = s + ' %s="%s"' % ( key, XMLescape(val) ) 89 s = s + ">" 90 cnt = 0 91 if self.kids: 92 if fancy: s = s + "\n" 93 for a in self.kids: 94 if not fancy and (len(self.data)-1)>=cnt: s=s+XMLescape(self.data[cnt]) 95 elif (len(self.data)-1)>=cnt: s=s+XMLescape(self.data[cnt].strip()) 96 if a: s = s + a.__str__(fancy and fancy+1) 97 cnt=cnt+1 98 if not fancy and (len(self.data)-1) >= cnt: s = s + XMLescape(self.data[cnt]) 99 elif (len(self.data)-1) >= cnt: s = s + XMLescape(self.data[cnt].strip()) 100 if not self.kids and s[-1:]=='>': 101 s=s[:-1]+' />' 102 if fancy: s = s + "\n" 103 else: 104 if fancy and not self.data: s = s + (fancy-1) * 2 * ' ' 105 s = s + "</" + self.name + ">" 106 if fancy: s = s + "\n" 107 return s
108 - def getCDATA(self):
109 """ Serialise node, dropping all tags and leaving CDATA intact. 110 That is effectively kills all formatiing, leaving only text were contained in XML. 111 """ 112 s = "" 113 cnt = 0 114 if self.kids: 115 for a in self.kids: 116 s=s+self.data[cnt] 117 if a: s = s + a.getCDATA() 118 cnt=cnt+1 119 if (len(self.data)-1) >= cnt: s = s + self.data[cnt] 120 return s
121 - def addChild(self, name=None, attrs={}, payload=[], namespace=None, node=None):
122 """ If "node" argument is provided, adds it as child node. Else creates new node from 123 the other arguments' values and adds it as well.""" 124 if attrs.has_key('xmlns'): 125 raise AttributeError("Use namespace=x instead of attrs={'xmlns':x}") 126 if namespace: name=namespace+' '+name 127 if node: 128 newnode=node 129 node.parent = self 130 else: newnode=Node(tag=name, parent=self, attrs=attrs, payload=payload) 131 self.kids.append(newnode) 132 self.data.append(u'') 133 return newnode
134 - def addData(self, data):
135 """ Adds some CDATA to node. """ 136 self.data.append(ustr(data)) 137 self.kids.append(None)
138 - def clearData(self):
139 """ Removes all CDATA from the node. """ 140 self.data=[]
141 - def delAttr(self, key):
142 """ Deletes an attribute "key" """ 143 del self.attrs[key]
144 - def delChild(self, node, attrs={}):
145 """ Deletes the "node" from the node's childs list, if "node" is an instance. 146 Else deletes the first node that have specified name and (optionally) attributes. """ 147 if type(node)<>type(self): node=self.getTag(node,attrs) 148 self.kids[self.kids.index(node)]=None 149 return node
150 - def getAttrs(self):
151 """ Returns all node's attributes as dictionary. """ 152 return self.attrs
153 - def getAttr(self, key):
154 """ Returns value of specified attribute. """ 155 try: return self.attrs[key] 156 except: return None
157 - def getChildren(self):
158 """ Returns all node's child nodes as list. """ 159 return self.kids
160 - def getData(self):
161 """ Returns all node CDATA as string (concatenated). """ 162 return ''.join(self.data)
163 - def getName(self):
164 """ Returns the name of node """ 165 return self.name
166 - def getNamespace(self):
167 """ Returns the namespace of node """ 168 return self.namespace
169 - def getParent(self):
170 """ Returns the parent of node (if present). """ 171 return self.parent
172 - def getPayload(self):
173 """ Return the payload of node i.e. list of child nodes and CDATA entries. 174 F.e. for "<node>text1<nodea/><nodeb/> text2</node>" will be returned list: 175 ['text1', <nodea instance>, <nodeb instance>, ' text2']. """ 176 ret=[] 177 for i in range(max(len(self.data),len(self.kids))): 178 if i < len(self.data) and self.data[i]: ret.append(self.data[i]) 179 if i < len(self.kids) and self.kids[i]: ret.append(self.kids[i]) 180 return ret
181 - def getTag(self, name, attrs={}, namespace=None):
182 """ Filters all child nodes using specified arguments as filter. 183 Returns the first found or None if not found. """ 184 return self.getTags(name, attrs, namespace, one=1)
185 - def getTagAttr(self,tag,attr):
186 """ Returns attribute value of the child with specified name (or None if no such attribute).""" 187 try: return self.getTag(tag).attrs[attr] 188 except: return None
189 - def getTagData(self,tag):
190 """ Returns cocatenated CDATA of the child with specified name.""" 191 try: return self.getTag(tag).getData() 192 except: return None
193 - def getTags(self, name, attrs={}, namespace=None, one=0):
194 """ Filters all child nodes using specified arguments as filter. 195 Returns the list of nodes found. """ 196 nodes=[] 197 for node in self.kids: 198 if not node: continue 199 if namespace and namespace<>node.getNamespace(): continue 200 if node.getName() == name: 201 for key in attrs.keys(): 202 if not node.attrs.has_key(key) or node.attrs[key]<>attrs[key]: break 203 else: nodes.append(node) 204 if one and nodes: return nodes[0] 205 if not one: return nodes
206 - def setAttr(self, key, val):
207 """ Sets attribute "key" with the value "val". """ 208 self.attrs[key]=val
209 - def setData(self, data):
210 """ Sets node's CDATA to provided string. Resets all previous CDATA!""" 211 self.data=[ustr(data)]
212 - def setName(self,val):
213 """ Changes the node name. """ 214 self.name = val
215 - def setNamespace(self, namespace):
216 """ Changes the node namespace. """ 217 self.namespace=namespace
218 - def setParent(self, node):
219 """ Sets node's parent to "node". WARNING: do not checks if the parent already present 220 and not removes the node from the list of childs of previous parent. """ 221 self.parent = node
222 - def setPayload(self,payload,add=0):
223 """ Sets node payload according to the list specified. WARNING: completely replaces all node's 224 previous content. If you wish just to add child or CDATA - use addData or addChild methods. """ 225 if type(payload) in (type(''),type(u'')): payload=[payload] 226 if add: self.kids+=payload 227 else: self.kids=payload
228 - def setTag(self, name, attrs={}, namespace=None):
229 """ Same as getTag but if the node with specified namespace/attributes not found, creates such 230 node and returns it. """ 231 node=self.getTags(name, attrs, namespace=namespace, one=1) 232 if node: return node 233 else: return self.addChild(name, attrs, namespace=namespace)
234 - def setTagAttr(self,tag,attr,val):
235 """ Creates new node (if not already present) with name "tag" 236 and sets it's attribute "attr" to value "val". """ 237 try: self.getTag(tag).attrs[attr]=val 238 except: self.addChild(tag,attrs={attr:val})
239 - def setTagData(self,tag,val,attrs={}):
240 """ Creates new node (if not already present) with name "tag" and (optionally) attributes "attrs" 241 and sets it's CDATA to string "val". """ 242 try: self.getTag(tag,attrs).setData(ustr(val)) 243 except: self.addChild(tag,attrs,payload=[ustr(val)])
244 - def has_attr(self,key):
245 """ Checks if node have attribute "key".""" 246 return self.attrs.has_key(key)
247 - def __getitem__(self,item):
248 """ Returns node's attribute "item" value. """ 249 return self.getAttr(item)
250 - def __setitem__(self,item,val):
251 """ Sets node's attribute "item" value. """ 252 return self.setAttr(item,val)
253 - def __delitem__(self,item):
254 """ Deletes node's attribute "item". """ 255 return self.delAttr(item)
256 - def __getattr__(self,attr):
257 """ Reduce memory usage caused by T/NT classes - use memory only when needed. """ 258 if attr=='T': 259 self.T=T(self) 260 return self.T 261 if attr=='NT': 262 self.NT=NT(self) 263 return self.NT 264 raise AttributeError
265
266 -class T:
267 """ Auxiliary class used to quick access to node's child nodes. """
268 - def __init__(self,node): self.__dict__['node']=node
269 - def __getattr__(self,attr): return self.node.getTag(attr)
270 - def __setattr__(self,attr,val):
271 if isinstance(val,Node): Node.__init__(self.node.setTag(attr),node=val) 272 else: return self.node.setTagData(attr,val)
273 - def __delattr__(self,attr): return self.node.delChild(attr)
274
275 -class NT(T):
276 """ Auxiliary class used to quick create node's child nodes. """
277 - def __getattr__(self,attr): return self.node.addChild(attr)
278 - def __setattr__(self,attr,val):
279 if isinstance(val,Node): self.node.addChild(attr,node=val) 280 else: return self.node.addChild(attr,payload=[val])
281 282 DBG_NODEBUILDER = 'nodebuilder'
283 -class NodeBuilder:
284 """ Builds a Node class minidom from data parsed to it. This class used for two purposes: 285 1. Creation an XML Node from a textual representation. F.e. reading a config file. See an XML2Node method. 286 2. Handling an incoming XML stream. This is done by mangling 287 the __dispatch_depth parameter and redefining the dispatch method. 288 You do not need to use this class directly if you do not designing your own XML handler."""
289 - def __init__(self,data=None,initial_node=None):
290 """ Takes two optional parameters: "data" and "initial_node". 291 By default class initialised with empty Node class instance. 292 Though, if "initial_node" is provided it used as "starting point". 293 You can think about it as of "node upgrade". 294 "data" (if provided) feeded to parser immidiatedly after instance init. 295 """ 296 self.DEBUG(DBG_NODEBUILDER, "Preparing to handle incoming XML stream.", 'start') 297 self._parser = xml.parsers.expat.ParserCreate(namespace_separator=' ') 298 self._parser.StartElementHandler = self.starttag 299 self._parser.EndElementHandler = self.endtag 300 self._parser.CharacterDataHandler = self.handle_data 301 self._parser.StartNamespaceDeclHandler = self.handle_namespace_start 302 self.Parse = self._parser.Parse 303 304 self.__depth = 0 305 self._dispatch_depth = 1 306 self._document_attrs = None 307 self._mini_dom=initial_node 308 self.last_is_data = 1 309 self._ptr=None 310 self.namespaces={"http://www.w3.org/XML/1998/namespace":'xml:'} 311 self.xmlns="http://www.w3.org/XML/1998/namespace" 312 313 if data: self._parser.Parse(data,1)
314
315 - def destroy(self):
316 """ Method used to allow class instance to be garbage-collected. """ 317 self._parser.StartElementHandler = None 318 self._parser.EndElementHandler = None 319 self._parser.CharacterDataHandler = None 320 self._parser.StartNamespaceDeclHandler = None
321
322 - def starttag(self, tag, attrs):
323 """XML Parser callback. Used internally""" 324 attlist=attrs.keys() # 325 for attr in attlist: # FIXME: Crude hack. And it also slows down the whole library considerably. 326 sp=attr.rfind(" ") # 327 if sp==-1: continue # 328 ns=attr[:sp] # 329 attrs[self.namespaces[ns]+attr[sp+1:]]=attrs[attr] 330 del attrs[attr] # 331 self.__depth += 1 332 self.DEBUG(DBG_NODEBUILDER, "DEPTH -> %i , tag -> %s, attrs -> %s" % (self.__depth, tag, `attrs`), 'down') 333 if self.__depth == self._dispatch_depth: 334 if not self._mini_dom : self._mini_dom = Node(tag=tag, attrs=attrs) 335 else: Node.__init__(self._mini_dom,tag=tag, attrs=attrs) 336 self._ptr = self._mini_dom 337 elif self.__depth > self._dispatch_depth: 338 self._ptr.kids.append(Node(tag=tag,parent=self._ptr,attrs=attrs)) 339 self._ptr = self._ptr.kids[-1] 340 if self.__depth == 1: 341 self._document_attrs = attrs 342 ns, name = (['']+tag.split())[-2:] 343 self.stream_header_received(ns, name, attrs) 344 if not self.last_is_data and self._ptr.parent: self._ptr.parent.data.append('') 345 self.last_is_data = 0
346
347 - def endtag(self, tag ):
348 """XML Parser callback. Used internally""" 349 self.DEBUG(DBG_NODEBUILDER, "DEPTH -> %i , tag -> %s" % (self.__depth, tag), 'up') 350 if self.__depth == self._dispatch_depth: 351 self.dispatch(self._mini_dom) 352 elif self.__depth > self._dispatch_depth: 353 self._ptr = self._ptr.parent 354 else: 355 self.DEBUG(DBG_NODEBUILDER, "Got higher than dispatch level. Stream terminated?", 'stop') 356 self.__depth -= 1 357 self.last_is_data = 0 358 if self.__depth == 0: self.stream_footer_received()
359
360 - def handle_data(self, data):
361 """XML Parser callback. Used internally""" 362 self.DEBUG(DBG_NODEBUILDER, data, 'data') 363 if not self._ptr: return 364 if self.last_is_data: 365 self._ptr.data[-1] += data 366 else: 367 self._ptr.data.append(data) 368 self.last_is_data = 1
369
370 - def handle_namespace_start(self, prefix, uri):
371 """XML Parser callback. Used internally""" 372 if prefix: self.namespaces[uri]=prefix+':' 373 else: self.xmlns=uri
374 - def DEBUG(self, level, text, comment=None):
375 """ Gets all NodeBuilder walking events. Can be used for debugging if redefined."""
376 - def getDom(self):
377 """ Returns just built Node. """ 378 return self._mini_dom
379 - def dispatch(self,stanza):
380 """ Gets called when the NodeBuilder reaches some level of depth on it's way up with the built 381 node as argument. Can be redefined to convert incoming XML stanzas to program events. """
382 - def stream_header_received(self,ns,tag,attrs):
383 """ Method called when stream just opened. """
386
387 -def XML2Node(xml):
388 """ Converts supplied textual string into XML node. Handy f.e. for reading configuration file. 389 Raises xml.parser.expat.parsererror if provided string is not well-formed XML. """ 390 return NodeBuilder(xml).getDom()
391
392 -def BadXML2Node(xml):
393 """ Converts supplied textual string into XML node. Survives if xml data is cutted half way round. 394 I.e. "<html>some text <br>some more text". Will raise xml.parser.expat.parsererror on misplaced 395 tags though. F.e. "<b>some text <br>some more text</b>" will not work.""" 396 return NodeBuilder(xml).getDom()
397

xmpppy-0.4.1/doc/apidocs/xmpp.browser-pysrc.html0000644000175000000500000022316610731034063020574 0ustar normansrc xmpp.browser
Package xmpp :: Module browser
[hide private]
[frames] | no frames]

Source Code for Module xmpp.browser

  1  ##   browser.py 
  2  ## 
  3  ##   Copyright (C) 2004 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: browser.py,v 1.12 2007/05/13 17:55:14 normanr Exp $ 
 16   
 17  """Browser module provides DISCO server framework for your application. 
 18  This functionality can be used for very different purposes - from publishing 
 19  software version and supported features to building of "jabber site" that users 
 20  can navigate with their disco browsers and interact with active content. 
 21   
 22  Such functionality is achieved via registering "DISCO handlers" that are 
 23  automatically called when user requests some node of your disco tree. 
 24  """ 
 25   
 26  from dispatcher import * 
 27  from client import PlugIn 
 28   
29 -class Browser(PlugIn):
30 """ WARNING! This class is for components only. It will not work in client mode! 31 32 Standart xmpppy class that is ancestor of PlugIn and can be attached 33 to your application. 34 All processing will be performed in the handlers registered in the browser 35 instance. You can register any number of handlers ensuring that for each 36 node/jid combination only one (or none) handler registered. 37 You can register static information or the fully-blown function that will 38 calculate the answer dynamically. 39 Example of static info (see JEP-0030, examples 13-14): 40 # cl - your xmpppy connection instance. 41 b=xmpp.browser.Browser() 42 b.PlugIn(cl) 43 items=[] 44 item={} 45 item['jid']='catalog.shakespeare.lit' 46 item['node']='books' 47 item['name']='Books by and about Shakespeare' 48 items.append(item) 49 item={} 50 item['jid']='catalog.shakespeare.lit' 51 item['node']='clothing' 52 item['name']='Wear your literary taste with pride' 53 items.append(item) 54 item={} 55 item['jid']='catalog.shakespeare.lit' 56 item['node']='music' 57 item['name']='Music from the time of Shakespeare' 58 items.append(item) 59 info={'ids':[], 'features':[]} 60 b.setDiscoHandler({'items':items,'info':info}) 61 62 items should be a list of item elements. 63 every item element can have any of these four keys: 'jid', 'node', 'name', 'action' 64 info should be a dicionary and must have keys 'ids' and 'features'. 65 Both of them should be lists: 66 ids is a list of dictionaries and features is a list of text strings. 67 Example (see JEP-0030, examples 1-2) 68 # cl - your xmpppy connection instance. 69 b=xmpp.browser.Browser() 70 b.PlugIn(cl) 71 items=[] 72 ids=[] 73 ids.append({'category':'conference','type':'text','name':'Play-Specific Chatrooms'}) 74 ids.append({'category':'directory','type':'chatroom','name':'Play-Specific Chatrooms'}) 75 features=[NS_DISCO_INFO,NS_DISCO_ITEMS,NS_MUC,NS_REGISTER,NS_SEARCH,NS_TIME,NS_VERSION] 76 info={'ids':ids,'features':features} 77 # info['xdata']=xmpp.protocol.DataForm() # JEP-0128 78 b.setDiscoHandler({'items':[],'info':info}) 79 """
80 - def __init__(self):
81 """Initialises internal variables. Used internally.""" 82 PlugIn.__init__(self) 83 DBG_LINE='browser' 84 self._exported_methods=[] 85 self._handlers={'':{}}
86
87 - def plugin(self, owner):
88 """ Registers it's own iq handlers in your application dispatcher instance. 89 Used internally.""" 90 owner.RegisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_INFO) 91 owner.RegisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_ITEMS)
92
93 - def plugout(self):
94 """ Unregisters browser's iq handlers from your application dispatcher instance. 95 Used internally.""" 96 self._owner.UnregisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_INFO) 97 self._owner.UnregisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_ITEMS)
98
99 - def _traversePath(self,node,jid,set=0):
100 """ Returns dictionary and key or None,None 101 None - root node (w/o "node" attribute) 102 /a/b/c - node 103 /a/b/ - branch 104 Set returns '' or None as the key 105 get returns '' or None as the key or None as the dict. 106 Used internally.""" 107 if self._handlers.has_key(jid): cur=self._handlers[jid] 108 elif set: 109 self._handlers[jid]={} 110 cur=self._handlers[jid] 111 else: cur=self._handlers[''] 112 if node is None: node=[None] 113 else: node=node.replace('/',' /').split('/') 114 for i in node: 115 if i<>'' and cur.has_key(i): cur=cur[i] 116 elif set and i<>'': cur[i]={dict:cur,str:i}; cur=cur[i] 117 elif set or cur.has_key(''): return cur,'' 118 else: return None,None 119 if cur.has_key(1) or set: return cur,1 120 raise "Corrupted data"
121
122 - def setDiscoHandler(self,handler,node='',jid=''):
123 """ This is the main method that you will use in this class. 124 It is used to register supplied DISCO handler (or dictionary with static info) 125 as handler of some disco tree branch. 126 If you do not specify the node this handler will be used for all queried nodes. 127 If you do not specify the jid this handler will be used for all queried JIDs. 128 129 Usage: 130 cl.Browser.setDiscoHandler(someDict,node,jid) 131 or 132 cl.Browser.setDiscoHandler(someDISCOHandler,node,jid) 133 where 134 135 someDict={ 136 'items':[ 137 {'jid':'jid1','action':'action1','node':'node1','name':'name1'}, 138 {'jid':'jid2','action':'action2','node':'node2','name':'name2'}, 139 {'jid':'jid3','node':'node3','name':'name3'}, 140 {'jid':'jid4','node':'node4'} 141 ], 142 'info' :{ 143 'ids':[ 144 {'category':'category1','type':'type1','name':'name1'}, 145 {'category':'category2','type':'type2','name':'name2'}, 146 {'category':'category3','type':'type3','name':'name3'}, 147 ], 148 'features':['feature1','feature2','feature3','feature4'], 149 'xdata':DataForm 150 } 151 } 152 153 and/or 154 155 def someDISCOHandler(session,request,TYR): 156 # if TYR=='items': # returns items list of the same format as shown above 157 # elif TYR=='info': # returns info dictionary of the same format as shown above 158 # else: # this case is impossible for now. 159 """ 160 self.DEBUG('Registering handler %s for "%s" node->%s'%(handler,jid,node), 'info') 161 node,key=self._traversePath(node,jid,1) 162 node[key]=handler
163
164 - def getDiscoHandler(self,node='',jid=''):
165 """ Returns the previously registered DISCO handler 166 that is resonsible for this node/jid combination. 167 Used internally.""" 168 node,key=self._traversePath(node,jid) 169 if node: return node[key]
170
171 - def delDiscoHandler(self,node='',jid=''):
172 """ Unregisters DISCO handler that is resonsible for this 173 node/jid combination. When handler is unregistered the branch 174 is handled in the same way that it's parent branch from this moment. 175 """ 176 node,key=self._traversePath(node,jid) 177 if node: 178 handler=node[key] 179 del node[dict][node[str]] 180 return handler
181
182 - def _DiscoveryHandler(self,conn,request):
183 """ Servers DISCO iq request from the remote client. 184 Automatically determines the best handler to use and calls it 185 to handle the request. Used internally. 186 """ 187 node=request.getQuerynode() 188 if node: 189 nodestr=node 190 else: 191 nodestr='None' 192 handler=self.getDiscoHandler(node,request.getTo()) 193 if not handler: 194 self.DEBUG("No Handler for request with jid->%s node->%s ns->%s"%(request.getTo().__str__().encode('utf8'),nodestr.encode('utf8'),request.getQueryNS().encode('utf8')),'error') 195 conn.send(Error(request,ERR_ITEM_NOT_FOUND)) 196 raise NodeProcessed 197 self.DEBUG("Handling request with jid->%s node->%s ns->%s"%(request.getTo().__str__().encode('utf8'),nodestr.encode('utf8'),request.getQueryNS().encode('utf8')),'ok') 198 rep=request.buildReply('result') 199 if node: rep.setQuerynode(node) 200 q=rep.getTag('query') 201 if request.getQueryNS()==NS_DISCO_ITEMS: 202 # handler must return list: [{jid,action,node,name}] 203 if type(handler)==dict: lst=handler['items'] 204 else: lst=handler(conn,request,'items') 205 if lst==None: 206 conn.send(Error(request,ERR_ITEM_NOT_FOUND)) 207 raise NodeProcessed 208 for item in lst: q.addChild('item',item) 209 elif request.getQueryNS()==NS_DISCO_INFO: 210 if type(handler)==dict: dt=handler['info'] 211 else: dt=handler(conn,request,'info') 212 if dt==None: 213 conn.send(Error(request,ERR_ITEM_NOT_FOUND)) 214 raise NodeProcessed 215 # handler must return dictionary: 216 # {'ids':[{},{},{},{}], 'features':[fe,at,ur,es], 'xdata':DataForm} 217 for id in dt['ids']: q.addChild('identity',id) 218 for feature in dt['features']: q.addChild('feature',{'var':feature}) 219 if dt.has_key('xdata'): q.addChild(node=dt['xdata']) 220 conn.send(rep) 221 raise NodeProcessed
222

xmpppy-0.4.1/doc/apidocs/xmpp.client-pysrc.html0000644000175000000500000051653710731034064020377 0ustar normansrc xmpp.client
Package xmpp :: Module client
[hide private]
[frames] | no frames]

Source Code for Module xmpp.client

  1  ##   client.py 
  2  ## 
  3  ##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: client.py,v 1.60 2007/08/28 10:03:33 normanr Exp $ 
 16   
 17  """ 
 18  Provides PlugIn class functionality to develop extentions for xmpppy. 
 19  Also provides Client and Component classes implementations as the 
 20  examples of xmpppy structures usage. 
 21  These classes can be used for simple applications "AS IS" though. 
 22  """ 
 23   
 24  import socket 
 25  import debug 
 26  Debug=debug 
 27  Debug.DEBUGGING_IS_ON=1 
 28  Debug.Debug.colors['socket']=debug.color_dark_gray 
 29  Debug.Debug.colors['CONNECTproxy']=debug.color_dark_gray 
 30  Debug.Debug.colors['nodebuilder']=debug.color_brown 
 31  Debug.Debug.colors['client']=debug.color_cyan 
 32  Debug.Debug.colors['component']=debug.color_cyan 
 33  Debug.Debug.colors['dispatcher']=debug.color_green 
 34  Debug.Debug.colors['browser']=debug.color_blue 
 35  Debug.Debug.colors['auth']=debug.color_yellow 
 36  Debug.Debug.colors['roster']=debug.color_magenta 
 37  Debug.Debug.colors['ibb']=debug.color_yellow 
 38   
 39  Debug.Debug.colors['down']=debug.color_brown 
 40  Debug.Debug.colors['up']=debug.color_brown 
 41  Debug.Debug.colors['data']=debug.color_brown 
 42  Debug.Debug.colors['ok']=debug.color_green 
 43  Debug.Debug.colors['warn']=debug.color_yellow 
 44  Debug.Debug.colors['error']=debug.color_red 
 45  Debug.Debug.colors['start']=debug.color_dark_gray 
 46  Debug.Debug.colors['stop']=debug.color_dark_gray 
 47  Debug.Debug.colors['sent']=debug.color_yellow 
 48  Debug.Debug.colors['got']=debug.color_bright_cyan 
 49   
 50  DBG_CLIENT='client' 
 51  DBG_COMPONENT='component' 
 52   
53 -class PlugIn:
54 """ Common xmpppy plugins infrastructure: plugging in/out, debugging. """
55 - def __init__(self):
56 self._exported_methods=[] 57 self.DBG_LINE=self.__class__.__name__.lower()
58
59 - def PlugIn(self,owner):
60 """ Attach to main instance and register ourself and all our staff in it. """ 61 self._owner=owner 62 if self.DBG_LINE not in owner.debug_flags: 63 owner.debug_flags.append(self.DBG_LINE) 64 self.DEBUG('Plugging %s into %s'%(self,self._owner),'start') 65 if owner.__dict__.has_key(self.__class__.__name__): 66 return self.DEBUG('Plugging ignored: another instance already plugged.','error') 67 self._old_owners_methods=[] 68 for method in self._exported_methods: 69 if owner.__dict__.has_key(method.__name__): 70 self._old_owners_methods.append(owner.__dict__[method.__name__]) 71 owner.__dict__[method.__name__]=method 72 owner.__dict__[self.__class__.__name__]=self 73 if self.__class__.__dict__.has_key('plugin'): return self.plugin(owner)
74
75 - def PlugOut(self):
76 """ Unregister all our staff from main instance and detach from it. """ 77 self.DEBUG('Plugging %s out of %s.'%(self,self._owner),'stop') 78 ret = None 79 if self.__class__.__dict__.has_key('plugout'): ret = self.plugout() 80 self._owner.debug_flags.remove(self.DBG_LINE) 81 for method in self._exported_methods: del self._owner.__dict__[method.__name__] 82 for method in self._old_owners_methods: self._owner.__dict__[method.__name__]=method 83 del self._owner.__dict__[self.__class__.__name__] 84 return ret
85
86 - def DEBUG(self,text,severity='info'):
87 """ Feed a provided debug line to main instance's debug facility along with our ID string. """ 88 self._owner.DEBUG(self.DBG_LINE,text,severity)
89 90 import transports,dispatcher,auth,roster
91 -class CommonClient:
92 """ Base for Client and Component classes."""
93 - def __init__(self,server,port=5222,debug=['always', 'nodebuilder']):
94 """ Caches server name and (optionally) port to connect to. "debug" parameter specifies 95 the debug IDs that will go into debug output. You can either specifiy an "include" 96 or "exclude" list. The latter is done via adding "always" pseudo-ID to the list. 97 Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket', 98 'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] . """ 99 if self.__class__.__name__=='Client': self.Namespace,self.DBG='jabber:client',DBG_CLIENT 100 elif self.__class__.__name__=='Component': self.Namespace,self.DBG=dispatcher.NS_COMPONENT_ACCEPT,DBG_COMPONENT 101 self.defaultNamespace=self.Namespace 102 self.disconnect_handlers=[] 103 self.Server=server 104 self.Port=port 105 if debug and type(debug)<>list: debug=['always', 'nodebuilder'] 106 self._DEBUG=Debug.Debug(debug) 107 self.DEBUG=self._DEBUG.Show 108 self.debug_flags=self._DEBUG.debug_flags 109 self.debug_flags.append(self.DBG) 110 self._owner=self 111 self._registered_name=None 112 self.RegisterDisconnectHandler(self.DisconnectHandler) 113 self.connected='' 114 self._route=0
115
116 - def RegisterDisconnectHandler(self,handler):
117 """ Register handler that will be called on disconnect.""" 118 self.disconnect_handlers.append(handler)
119
120 - def UnregisterDisconnectHandler(self,handler):
121 """ Unregister handler that is called on disconnect.""" 122 self.disconnect_handlers.remove(handler)
123
124 - def disconnected(self):
125 """ Called on disconnection. Calls disconnect handlers and cleans things up. """ 126 self.connected='' 127 self.DEBUG(self.DBG,'Disconnect detected','stop') 128 self.disconnect_handlers.reverse() 129 for i in self.disconnect_handlers: i() 130 self.disconnect_handlers.reverse() 131 if self.__dict__.has_key('TLS'): self.TLS.PlugOut()
132
133 - def DisconnectHandler(self):
134 """ Default disconnect handler. Just raises an IOError. 135 If you choosed to use this class in your production client, 136 override this method or at least unregister it. """ 137 raise IOError('Disconnected from server.')
138
139 - def event(self,eventName,args={}):
140 """ Default event handler. To be overriden. """ 141 print "Event: ",(eventName,args)
142
143 - def isConnected(self):
144 """ Returns connection state. F.e.: None / 'tls' / 'tcp+non_sasl' . """ 145 return self.connected
146
147 - def reconnectAndReauth(self):
148 """ Example of reconnection method. In fact, it can be used to batch connection and auth as well. """ 149 handlerssave=self.Dispatcher.dumpHandlers() 150 if self.__dict__.has_key('ComponentBind'): self.ComponentBind.PlugOut() 151 if self.__dict__.has_key('Bind'): self.Bind.PlugOut() 152 self._route=0 153 if self.__dict__.has_key('NonSASL'): self.NonSASL.PlugOut() 154 if self.__dict__.has_key('SASL'): self.SASL.PlugOut() 155 if self.__dict__.has_key('TLS'): self.TLS.PlugOut() 156 self.Dispatcher.PlugOut() 157 if self.__dict__.has_key('HTTPPROXYsocket'): self.HTTPPROXYsocket.PlugOut() 158 if self.__dict__.has_key('TCPsocket'): self.TCPsocket.PlugOut() 159 if not self.connect(server=self._Server,proxy=self._Proxy): return 160 if not self.auth(self._User,self._Password,self._Resource): return 161 self.Dispatcher.restoreHandlers(handlerssave) 162 return self.connected
163
164 - def connect(self,server=None,proxy=None,ssl=None,use_srv=None):
165 """ Make a tcp/ip connection, protect it with tls/ssl if possible and start XMPP stream. 166 Returns None or 'tcp' or 'tls', depending on the result.""" 167 if not server: server=(self.Server,self.Port) 168 if proxy: sock=transports.HTTPPROXYsocket(proxy,server,use_srv) 169 else: sock=transports.TCPsocket(server,use_srv) 170 connected=sock.PlugIn(self) 171 if not connected: 172 sock.PlugOut() 173 return 174 self._Server,self._Proxy=server,proxy 175 self.connected='tcp' 176 if (ssl is None and self.Connection.getPort() in (5223, 443)) or ssl: 177 try: # FIXME. This should be done in transports.py 178 transports.TLS().PlugIn(self,now=1) 179 self.connected='ssl' 180 except socket.sslerror: 181 return 182 dispatcher.Dispatcher().PlugIn(self) 183 while self.Dispatcher.Stream._document_attrs is None: 184 if not self.Process(1): return 185 if self.Dispatcher.Stream._document_attrs.has_key('version') and self.Dispatcher.Stream._document_attrs['version']=='1.0': 186 while not self.Dispatcher.Stream.features and self.Process(1): pass # If we get version 1.0 stream the features tag MUST BE presented 187 return self.connected
188
189 -class Client(CommonClient):
190 """ Example client class, based on CommonClient. """
191 - def connect(self,server=None,proxy=None,secure=None,use_srv=True):
192 """ Connect to jabber server. If you want to specify different ip/port to connect to you can 193 pass it as tuple as first parameter. If there is HTTP proxy between you and server 194 specify it's address and credentials (if needed) in the second argument. 195 If you want ssl/tls support to be discovered and enable automatically - leave third argument as None. (ssl will be autodetected only if port is 5223 or 443) 196 If you want to force SSL start (i.e. if port 5223 or 443 is remapped to some non-standard port) then set it to 1. 197 If you want to disable tls/ssl support completely, set it to 0. 198 Example: connect(('192.168.5.5',5222),{'host':'proxy.my.net','port':8080,'user':'me','password':'secret'}) 199 Returns '' or 'tcp' or 'tls', depending on the result.""" 200 if not CommonClient.connect(self,server,proxy,secure,use_srv) or secure<>None and not secure: return self.connected 201 transports.TLS().PlugIn(self) 202 if not self.Dispatcher.Stream._document_attrs.has_key('version') or not self.Dispatcher.Stream._document_attrs['version']=='1.0': return self.connected 203 while not self.Dispatcher.Stream.features and self.Process(1): pass # If we get version 1.0 stream the features tag MUST BE presented 204 if not self.Dispatcher.Stream.features.getTag('starttls'): return self.connected # TLS not supported by server 205 while not self.TLS.starttls and self.Process(1): pass 206 if not hasattr(self, 'TLS') or self.TLS.starttls!='success': self.event('tls_failed'); return self.connected 207 self.connected='tls' 208 return self.connected
209
210 - def auth(self,user,password,resource='',sasl=1):
211 """ Authenticate connnection and bind resource. If resource is not provided 212 random one or library name used. """ 213 self._User,self._Password,self._Resource=user,password,resource 214 while not self.Dispatcher.Stream._document_attrs and self.Process(1): pass 215 if self.Dispatcher.Stream._document_attrs.has_key('version') and self.Dispatcher.Stream._document_attrs['version']=='1.0': 216 while not self.Dispatcher.Stream.features and self.Process(1): pass # If we get version 1.0 stream the features tag MUST BE presented 217 if sasl: auth.SASL(user,password).PlugIn(self) 218 if not sasl or self.SASL.startsasl=='not-supported': 219 if not resource: resource='xmpppy' 220 if auth.NonSASL(user,password,resource).PlugIn(self): 221 self.connected+='+old_auth' 222 return 'old_auth' 223 return 224 self.SASL.auth() 225 while self.SASL.startsasl=='in-process' and self.Process(1): pass 226 if self.SASL.startsasl=='success': 227 auth.Bind().PlugIn(self) 228 while self.Bind.bound is None and self.Process(1): pass 229 if self.Bind.Bind(resource): 230 self.connected+='+sasl' 231 return 'sasl' 232 else: 233 if self.__dict__.has_key('SASL'): self.SASL.PlugOut()
234
235 - def getRoster(self):
236 """ Return the Roster instance, previously plugging it in and 237 requesting roster from server if needed. """ 238 if not self.__dict__.has_key('Roster'): roster.Roster().PlugIn(self) 239 return self.Roster.getRoster()
240
241 - def sendInitPresence(self,requestRoster=1):
242 """ Send roster request and initial <presence/>. 243 You can disable the first by setting requestRoster argument to 0. """ 244 self.sendPresence(requestRoster=requestRoster)
245
246 - def sendPresence(self,jid=None,typ=None,requestRoster=0):
247 """ Send some specific presence state. 248 Can also request roster from server if according agrument is set.""" 249 if requestRoster: roster.Roster().PlugIn(self) 250 self.send(dispatcher.Presence(to=jid, typ=typ))
251
252 -class Component(CommonClient):
253 """ Component class. The only difference from CommonClient is ability to perform component authentication. """
254 - def __init__(self,server,port=5347,typ=None,debug=['always', 'nodebuilder'],domains=None,sasl=0,bind=0,route=0,xcp=0):
255 """ Init function for Components. 256 As components use a different auth mechanism which includes the namespace of the component. 257 Jabberd1.4 and Ejabberd use the default namespace then for all client messages. 258 Jabberd2 uses jabber:client. 259 'server' argument is a server name that you are connecting to (f.e. "localhost"). 260 'port' can be specified if 'server' resolves to correct IP. If it is not then you'll need to specify IP 261 and port while calling "connect()".""" 262 CommonClient.__init__(self,server,port=port,debug=debug) 263 self.typ=typ 264 self.sasl=sasl 265 self.bind=bind 266 self.route=route 267 self.xcp=xcp 268 if domains: 269 self.domains=domains 270 else: 271 self.domains=[server]
272
273 - def connect(self,server=None,proxy=None):
274 """ This will connect to the server, and if the features tag is found then set 275 the namespace to be jabber:client as that is required for jabberd2. 276 'server' and 'proxy' arguments have the same meaning as in xmpp.Client.connect() """ 277 if self.sasl: 278 self.Namespace=auth.NS_COMPONENT_1 279 self.Server=server[0] 280 CommonClient.connect(self,server=server,proxy=proxy) 281 if self.connected and (self.typ=='jabberd2' or not self.typ and self.Dispatcher.Stream.features != None) and (not self.xcp): 282 self.defaultNamespace=auth.NS_CLIENT 283 self.Dispatcher.RegisterNamespace(self.defaultNamespace) 284 self.Dispatcher.RegisterProtocol('iq',dispatcher.Iq) 285 self.Dispatcher.RegisterProtocol('message',dispatcher.Message) 286 self.Dispatcher.RegisterProtocol('presence',dispatcher.Presence) 287 return self.connected
288
289 - def dobind(self, sasl):
290 # This has to be done before binding, because we can receive a route stanza before binding finishes 291 self._route = self.route 292 if self.bind: 293 for domain in self.domains: 294 auth.ComponentBind(sasl).PlugIn(self) 295 while self.ComponentBind.bound is None: self.Process(1) 296 if (not self.ComponentBind.Bind(domain)): 297 self.ComponentBind.PlugOut() 298 return 299 self.ComponentBind.PlugOut()
300
301 - def auth(self,name,password,dup=None):
302 """ Authenticate component "name" with password "password".""" 303 self._User,self._Password,self._Resource=name,password,'' 304 try: 305 if self.sasl: auth.SASL(name,password).PlugIn(self) 306 if not self.sasl or self.SASL.startsasl=='not-supported': 307 if auth.NonSASL(name,password,'').PlugIn(self): 308 self.dobind(sasl=False) 309 self.connected+='+old_auth' 310 return 'old_auth' 311 return 312 self.SASL.auth() 313 while self.SASL.startsasl=='in-process' and self.Process(1): pass 314 if self.SASL.startsasl=='success': 315 self.dobind(sasl=True) 316 self.connected+='+sasl' 317 return 'sasl' 318 else: 319 raise auth.NotAuthorized(self.SASL.startsasl) 320 except: 321 self.DEBUG(self.DBG,"Failed to authenticate %s"%name,'error')
322

xmpppy-0.4.1/doc/apidocs/xmpp.filetransfer-pysrc.html0000644000175000000500000030333310731034065021572 0ustar normansrc xmpp.filetransfer
Package xmpp :: Module filetransfer
[hide private]
[frames] | no frames]

Source Code for Module xmpp.filetransfer

  1  ##   filetransfer.py  
  2  ## 
  3  ##   Copyright (C) 2004 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: filetransfer.py,v 1.6 2004/12/25 20:06:59 snakeru Exp $ 
 16   
 17  """ 
 18  This module contains IBB class that is the simple implementation of JEP-0047. 
 19  Note that this is just a transport for data. You have to negotiate data transfer before 
 20  (via StreamInitiation most probably). Unfortunately SI is not implemented yet. 
 21  """ 
 22   
 23  from protocol import * 
 24  from dispatcher import PlugIn 
 25  import base64 
 26   
27 -class IBB(PlugIn):
28 """ IBB used to transfer small-sized data chunk over estabilished xmpp connection. 29 Data is split into small blocks (by default 3000 bytes each), encoded as base 64 30 and sent to another entity that compiles these blocks back into the data chunk. 31 This is very inefficiend but should work under any circumstances. Note that 32 using IBB normally should be the last resort. 33 """
34 - def __init__(self):
35 """ Initialise internal variables. """ 36 PlugIn.__init__(self) 37 self.DBG_LINE='ibb' 38 self._exported_methods=[self.OpenStream] 39 self._streams={} 40 self._ampnode=Node(NS_AMP+' amp',payload=[Node('rule',{'condition':'deliver-at','value':'stored','action':'error'}),Node('rule',{'condition':'match-resource','value':'exact','action':'error'})])
41
42 - def plugin(self,owner):
43 """ Register handlers for receiving incoming datastreams. Used internally. """ 44 self._owner.RegisterHandlerOnce('iq',self.StreamOpenReplyHandler) # Move to StreamOpen and specify stanza id 45 self._owner.RegisterHandler('iq',self.IqHandler,ns=NS_IBB) 46 self._owner.RegisterHandler('message',self.ReceiveHandler,ns=NS_IBB)
47
48 - def IqHandler(self,conn,stanza):
49 """ Handles streams state change. Used internally. """ 50 typ=stanza.getType() 51 self.DEBUG('IqHandler called typ->%s'%typ,'info') 52 if typ=='set' and stanza.getTag('open',namespace=NS_IBB): self.StreamOpenHandler(conn,stanza) 53 elif typ=='set' and stanza.getTag('close',namespace=NS_IBB): self.StreamCloseHandler(conn,stanza) 54 elif typ=='result': self.StreamCommitHandler(conn,stanza) 55 elif typ=='error': self.StreamOpenReplyHandler(conn,stanza) 56 else: conn.send(Error(stanza,ERR_BAD_REQUEST)) 57 raise NodeProcessed
58
59 - def StreamOpenHandler(self,conn,stanza):
60 """ Handles opening of new incoming stream. Used internally. """ 61 """ 62 <iq type='set' 63 from='romeo@montague.net/orchard' 64 to='juliet@capulet.com/balcony' 65 id='inband_1'> 66 <open sid='mySID' 67 block-size='4096' 68 xmlns='http://jabber.org/protocol/ibb'/> 69 </iq> 70 """ 71 err=None 72 sid,blocksize=stanza.getTagAttr('open','sid'),stanza.getTagAttr('open','block-size') 73 self.DEBUG('StreamOpenHandler called sid->%s blocksize->%s'%(sid,blocksize),'info') 74 try: blocksize=int(blocksize) 75 except: err=ERR_BAD_REQUEST 76 if not sid or not blocksize: err=ERR_BAD_REQUEST 77 elif sid in self._streams.keys(): err=ERR_UNEXPECTED_REQUEST 78 if err: rep=Error(stanza,err) 79 else: 80 self.DEBUG("Opening stream: id %s, block-size %s"%(sid,blocksize),'info') 81 rep=Protocol('iq',stanza.getFrom(),'result',stanza.getTo(),{'id':stanza.getID()}) 82 self._streams[sid]={'direction':'<'+str(stanza.getFrom()),'block-size':blocksize,'fp':open('/tmp/xmpp_file_'+sid,'w'),'seq':0,'syn_id':stanza.getID()} 83 conn.send(rep)
84
85 - def OpenStream(self,sid,to,fp,blocksize=3000):
86 """ Start new stream. You should provide stream id 'sid', the endpoind jid 'to', 87 the file object containing info for send 'fp'. Also the desired blocksize can be specified. 88 Take into account that recommended stanza size is 4k and IBB uses base64 encoding 89 that increases size of data by 1/3.""" 90 if sid in self._streams.keys(): return 91 if not JID(to).getResource(): return 92 self._streams[sid]={'direction':'|>'+to,'block-size':blocksize,'fp':fp,'seq':0} 93 self._owner.RegisterCycleHandler(self.SendHandler) 94 syn=Protocol('iq',to,'set',payload=[Node(NS_IBB+' open',{'sid':sid,'block-size':blocksize})]) 95 self._owner.send(syn) 96 self._streams[sid]['syn_id']=syn.getID() 97 return self._streams[sid]
98
99 - def SendHandler(self,conn):
100 """ Send next portion of data if it is time to do it. Used internally. """ 101 self.DEBUG('SendHandler called','info') 102 for sid in self._streams.keys(): 103 stream=self._streams[sid] 104 if stream['direction'][:2]=='|>': cont=1 105 elif stream['direction'][0]=='>': 106 chunk=stream['fp'].read(stream['block-size']) 107 if chunk: 108 datanode=Node(NS_IBB+' data',{'sid':sid,'seq':stream['seq']},base64.encodestring(chunk)) 109 stream['seq']+=1 110 if stream['seq']==65536: stream['seq']=0 111 conn.send(Protocol('message',stream['direction'][1:],payload=[datanode,self._ampnode])) 112 else: 113 """ notify the other side about stream closing 114 notify the local user about sucessfull send 115 delete the local stream""" 116 conn.send(Protocol('iq',stream['direction'][1:],'set',payload=[Node(NS_IBB+' close',{'sid':sid})])) 117 conn.Event(self.DBG_LINE,'SUCCESSFULL SEND',stream) 118 del self._streams[sid] 119 self._owner.UnregisterCycleHandler(self.SendHandler) 120 121 """ 122 <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='msg1'> 123 <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'> 124 qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ 125 WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu 126 IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P 127 AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH 128 kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA 129 </data> 130 <amp xmlns='http://jabber.org/protocol/amp'> 131 <rule condition='deliver-at' value='stored' action='error'/> 132 <rule condition='match-resource' value='exact' action='error'/> 133 </amp> 134 </message> 135 """
136
137 - def ReceiveHandler(self,conn,stanza):
138 """ Receive next portion of incoming datastream and store it write 139 it to temporary file. Used internally. 140 """ 141 sid,seq,data=stanza.getTagAttr('data','sid'),stanza.getTagAttr('data','seq'),stanza.getTagData('data') 142 self.DEBUG('ReceiveHandler called sid->%s seq->%s'%(sid,seq),'info') 143 try: seq=int(seq); data=base64.decodestring(data) 144 except: seq=''; data='' 145 err=None 146 if not sid in self._streams.keys(): err=ERR_ITEM_NOT_FOUND 147 else: 148 stream=self._streams[sid] 149 if not data: err=ERR_BAD_REQUEST 150 elif seq<>stream['seq']: err=ERR_UNEXPECTED_REQUEST 151 else: 152 self.DEBUG('Successfull receive sid->%s %s+%s bytes'%(sid,stream['fp'].tell(),len(data)),'ok') 153 stream['seq']+=1 154 stream['fp'].write(data) 155 if err: 156 self.DEBUG('Error on receive: %s'%err,'error') 157 conn.send(Error(Iq(to=stanza.getFrom(),frm=stanza.getTo(),payload=[Node(NS_IBB+' close')]),err,reply=0))
158
159 - def StreamCloseHandler(self,conn,stanza):
160 """ Handle stream closure due to all data transmitted. 161 Raise xmpppy event specifying successfull data receive. """ 162 sid=stanza.getTagAttr('close','sid') 163 self.DEBUG('StreamCloseHandler called sid->%s'%sid,'info') 164 if sid in self._streams.keys(): 165 conn.send(stanza.buildReply('result')) 166 conn.Event(self.DBG_LINE,'SUCCESSFULL RECEIVE',self._streams[sid]) 167 del self._streams[sid] 168 else: conn.send(Error(stanza,ERR_ITEM_NOT_FOUND))
169
170 - def StreamBrokenHandler(self,conn,stanza):
171 """ Handle stream closure due to all some error while receiving data. 172 Raise xmpppy event specifying unsuccessfull data receive. """ 173 syn_id=stanza.getID() 174 self.DEBUG('StreamBrokenHandler called syn_id->%s'%syn_id,'info') 175 for sid in self._streams.keys(): 176 stream=self._streams[sid] 177 if stream['syn_id']==syn_id: 178 if stream['direction'][0]=='<': conn.Event(self.DBG_LINE,'ERROR ON RECEIVE',stream) 179 else: conn.Event(self.DBG_LINE,'ERROR ON SEND',stream) 180 del self._streams[sid]
181
182 - def StreamOpenReplyHandler(self,conn,stanza):
183 """ Handle remote side reply about is it agree or not to receive our datastream. 184 Used internally. Raises xmpppy event specfiying if the data transfer 185 is agreed upon.""" 186 syn_id=stanza.getID() 187 self.DEBUG('StreamOpenReplyHandler called syn_id->%s'%syn_id,'info') 188 for sid in self._streams.keys(): 189 stream=self._streams[sid] 190 if stream['syn_id']==syn_id: 191 if stanza.getType()=='error': 192 if stream['direction'][0]=='<': conn.Event(self.DBG_LINE,'ERROR ON RECEIVE',stream) 193 else: conn.Event(self.DBG_LINE,'ERROR ON SEND',stream) 194 del self._streams[sid] 195 elif stanza.getType()=='result': 196 if stream['direction'][0]=='|': 197 stream['direction']=stream['direction'][1:] 198 conn.Event(self.DBG_LINE,'STREAM COMMITTED',stream) 199 else: conn.send(Error(stanza,ERR_UNEXPECTED_REQUEST))
200

xmpppy-0.4.1/doc/apidocs/xmpp.debug-pysrc.html0000644000175000000500000032577310731034066020211 0ustar normansrc xmpp.debug
Package xmpp :: Module debug
[hide private]
[frames] | no frames]

Source Code for Module xmpp.debug

  1  ##   debug.py  
  2  ## 
  3  ##   Copyright (C) 2003 Jacob Lundqvist 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU Lesser General Public License as published 
  7  ##   by the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU Lesser General Public License for more details. 
 14   
 15  _version_ = '1.4.0' 
 16   
 17  """\ 
 18   
 19  Generic debug class 
 20   
 21  Other modules can always define extra debug flags for local usage, as long as 
 22  they make sure they append them to debug_flags 
 23   
 24  Also its always a good thing to prefix local flags with something, to reduce risk 
 25  of coliding flags. Nothing breaks if two flags would be identical, but it might  
 26  activate unintended debugging. 
 27   
 28  flags can be numeric, but that makes analysing harder, on creation its 
 29  not obvious what is activated, and when flag_show is given, output isnt 
 30  really meaningfull. 
 31   
 32  This Debug class can either be initialized and used on app level, or used independantly 
 33  by the individual classes. 
 34   
 35  For samples of usage, see samples subdir in distro source, and selftest 
 36  in this code 
 37       
 38  """ 
 39   
 40   
 41   
 42  import sys 
 43  import traceback 
 44  import time 
 45  import os 
 46   
 47  import types 
 48   
 49  if os.environ.has_key('TERM'): 
 50      colors_enabled=True 
 51  else: 
 52      colors_enabled=False 
 53   
 54  color_none         = chr(27) + "[0m" 
 55  color_black        = chr(27) + "[30m" 
 56  color_red          = chr(27) + "[31m" 
 57  color_green        = chr(27) + "[32m" 
 58  color_brown        = chr(27) + "[33m" 
 59  color_blue         = chr(27) + "[34m" 
 60  color_magenta      = chr(27) + "[35m" 
 61  color_cyan         = chr(27) + "[36m" 
 62  color_light_gray   = chr(27) + "[37m" 
 63  color_dark_gray    = chr(27) + "[30;1m" 
 64  color_bright_red   = chr(27) + "[31;1m" 
 65  color_bright_green = chr(27) + "[32;1m" 
 66  color_yellow       = chr(27) + "[33;1m" 
 67  color_bright_blue  = chr(27) + "[34;1m" 
 68  color_purple       = chr(27) + "[35;1m" 
 69  color_bright_cyan  = chr(27) + "[36;1m" 
 70  color_white        = chr(27) + "[37;1m" 
 71   
 72   
 73  """ 
 74  Define your flags in yor modules like this: 
 75   
 76  from debug import * 
 77   
 78  DBG_INIT = 'init'                ; debug_flags.append( DBG_INIT ) 
 79  DBG_CONNECTION = 'connection'    ; debug_flags.append( DBG_CONNECTION ) 
 80   
 81   The reason for having a double statement wis so we can validate params 
 82   and catch all undefined debug flags 
 83    
 84   This gives us control over all used flags, and makes it easier to allow 
 85   global debugging in your code, just do something like 
 86    
 87   foo = Debug( debug_flags ) 
 88    
 89   group flags, that is a flag in it self containing multiple flags should be 
 90   defined without the debug_flags.append() sequence, since the parts are already 
 91   in the list, also they must of course be defined after the flags they depend on ;) 
 92   example: 
 93   
 94  DBG_MULTI = [ DBG_INIT, DBG_CONNECTION ] 
 95   
 96   
 97   
 98    NoDebug 
 99    ------- 
100    To speed code up, typically for product releases or such 
101    use this class instead if you globaly want to disable debugging 
102  """ 
103   
104   
105 -class NoDebug:
106 - def __init__( self, *args, **kwargs ):
107 self.debug_flags = []
108 - def show( self, *args, **kwargs):
109 pass
110 - def Show( self, *args, **kwargs):
111 pass
112 - def is_active( self, flag ):
113 pass
114 colors={}
115 - def active_set( self, active_flags = None ):
116 return 0
117 118 119 LINE_FEED = '\n' 120 121
122 -class Debug:
123 - def __init__( self, 124 # 125 # active_flags are those that will trigger output 126 # 127 active_flags = None, 128 # 129 # Log file should be file object or file namne 130 # 131 log_file = sys.stderr, 132 # 133 # prefix and sufix can either be set globaly or per call. 134 # personally I use this to color code debug statements 135 # with prefix = chr(27) + '[34m' 136 # sufix = chr(27) + '[37;1m\n' 137 # 138 prefix = 'DEBUG: ', 139 sufix = '\n', 140 # 141 # If you want unix style timestamps, 142 # 0 disables timestamps 143 # 1 before prefix, good when prefix is a string 144 # 2 after prefix, good when prefix is a color 145 # 146 time_stamp = 0, 147 # 148 # flag_show should normaly be of, but can be turned on to get a 149 # good view of what flags are actually used for calls, 150 # if it is not None, it should be a string 151 # flags for current call will be displayed 152 # with flag_show as separator 153 # recomended values vould be '-' or ':', but any string goes 154 # 155 flag_show = None, 156 # 157 # If you dont want to validate flags on each call to 158 # show(), set this to 0 159 # 160 validate_flags = 1, 161 # 162 # If you dont want the welcome message, set to 0 163 # default is to show welcome if any flags are active 164 welcome = -1 165 ):
166 167 self.debug_flags = [] 168 if welcome == -1: 169 if active_flags and len(active_flags): 170 welcome = 1 171 else: 172 welcome = 0 173 174 self._remove_dupe_flags() 175 if log_file: 176 if type( log_file ) is type(''): 177 try: 178 self._fh = open(log_file,'w') 179 except: 180 print 'ERROR: can open %s for writing' 181 sys.exit(0) 182 else: ## assume its a stream type object 183 self._fh = log_file 184 else: 185 self._fh = sys.stdout 186 187 if time_stamp not in (0,1,2): 188 msg2 = '%s' % time_stamp 189 raise 'Invalid time_stamp param', msg2 190 self.prefix = prefix 191 self.sufix = sufix 192 self.time_stamp = time_stamp 193 self.flag_show = None # must be initialised after possible welcome 194 self.validate_flags = validate_flags 195 196 self.active_set( active_flags ) 197 if welcome: 198 self.show('') 199 caller = sys._getframe(1) # used to get name of caller 200 try: 201 mod_name= ":%s" % caller.f_locals['__name__'] 202 except: 203 mod_name = "" 204 self.show('Debug created for %s%s' % (caller.f_code.co_filename, 205 mod_name )) 206 self.show(' flags defined: %s' % ','.join( self.active )) 207 208 if type(flag_show) in (type(''), type(None)): 209 self.flag_show = flag_show 210 else: 211 msg2 = '%s' % type(flag_show ) 212 raise 'Invalid type for flag_show!', msg2
213 214 215 216 217
218 - def show( self, msg, flag = None, prefix = None, sufix = None, 219 lf = 0 ):
220 """ 221 flag can be of folowing types: 222 None - this msg will always be shown if any debugging is on 223 flag - will be shown if flag is active 224 (flag1,flag2,,,) - will be shown if any of the given flags 225 are active 226 227 if prefix / sufix are not given, default ones from init will be used 228 229 lf = -1 means strip linefeed if pressent 230 lf = 1 means add linefeed if not pressent 231 """ 232 233 if self.validate_flags: 234 self._validate_flag( flag ) 235 236 if not self.is_active(flag): 237 return 238 if prefix: 239 pre = prefix 240 else: 241 pre = self.prefix 242 if sufix: 243 suf = sufix 244 else: 245 suf = self.sufix 246 247 if self.time_stamp == 2: 248 output = '%s%s ' % ( pre, 249 time.strftime('%b %d %H:%M:%S', 250 time.localtime(time.time() )), 251 ) 252 elif self.time_stamp == 1: 253 output = '%s %s' % ( time.strftime('%b %d %H:%M:%S', 254 time.localtime(time.time() )), 255 pre, 256 ) 257 else: 258 output = pre 259 260 if self.flag_show: 261 if flag: 262 output = '%s%s%s' % ( output, flag, self.flag_show ) 263 else: 264 # this call uses the global default, 265 # dont print "None", just show the separator 266 output = '%s %s' % ( output, self.flag_show ) 267 268 output = '%s%s%s' % ( output, msg, suf ) 269 if lf: 270 # strip/add lf if needed 271 last_char = output[-1] 272 if lf == 1 and last_char != LINE_FEED: 273 output = output + LINE_FEED 274 elif lf == -1 and last_char == LINE_FEED: 275 output = output[:-1] 276 try: 277 self._fh.write( output ) 278 except: 279 # unicode strikes again ;) 280 s=u'' 281 for i in range(len(output)): 282 if ord(output[i]) < 128: 283 c = output[i] 284 else: 285 c = '?' 286 s=s+c 287 self._fh.write( '%s%s%s' % ( pre, s, suf )) 288 self._fh.flush()
289 290
291 - def is_active( self, flag ):
292 'If given flag(s) should generate output.' 293 294 # try to abort early to quicken code 295 if not self.active: 296 return 0 297 if not flag or flag in self.active: 298 return 1 299 else: 300 # check for multi flag type: 301 if type( flag ) in ( type(()), type([]) ): 302 for s in flag: 303 if s in self.active: 304 return 1 305 return 0
306 307
308 - def active_set( self, active_flags = None ):
309 "returns 1 if any flags where actually set, otherwise 0." 310 r = 0 311 ok_flags = [] 312 if not active_flags: 313 #no debuging at all 314 self.active = [] 315 elif type( active_flags ) in ( types.TupleType, types.ListType ): 316 flags = self._as_one_list( active_flags ) 317 for t in flags: 318 if t not in self.debug_flags: 319 sys.stderr.write('Invalid debugflag given: %s\n' % t ) 320 ok_flags.append( t ) 321 322 self.active = ok_flags 323 r = 1 324 else: 325 # assume comma string 326 try: 327 flags = active_flags.split(',') 328 except: 329 self.show( '***' ) 330 self.show( '*** Invalid debug param given: %s' % active_flags ) 331 self.show( '*** please correct your param!' ) 332 self.show( '*** due to this, full debuging is enabled' ) 333 self.active = self.debug_flags 334 335 for f in flags: 336 s = f.strip() 337 ok_flags.append( s ) 338 self.active = ok_flags 339 340 self._remove_dupe_flags() 341 return r
342
343 - def active_get( self ):
344 "returns currently active flags." 345 return self.active
346 347
348 - def _as_one_list( self, items ):
349 """ init param might contain nested lists, typically from group flags. 350 351 This code organises lst and remves dupes 352 """ 353 if type( items ) <> type( [] ) and type( items ) <> type( () ): 354 return [ items ] 355 r = [] 356 for l in items: 357 if type( l ) == type([]): 358 lst2 = self._as_one_list( l ) 359 for l2 in lst2: 360 self._append_unique_str(r, l2 ) 361 elif l == None: 362 continue 363 else: 364 self._append_unique_str(r, l ) 365 return r
366 367
368 - def _append_unique_str( self, lst, item ):
369 """filter out any dupes.""" 370 if type(item) <> type(''): 371 msg2 = '%s' % item 372 raise 'Invalid item type (should be string)',msg2 373 if item not in lst: 374 lst.append( item ) 375 return lst
376 377
378 - def _validate_flag( self, flags ):
379 'verify that flag is defined.' 380 if flags: 381 for f in self._as_one_list( flags ): 382 if not f in self.debug_flags: 383 msg2 = '%s' % f 384 raise 'Invalid debugflag given', msg2
385
386 - def _remove_dupe_flags( self ):
387 """ 388 if multiple instances of Debug is used in same app, 389 some flags might be created multiple time, filter out dupes 390 """ 391 unique_flags = [] 392 for f in self.debug_flags: 393 if f not in unique_flags: 394 unique_flags.append(f) 395 self.debug_flags = unique_flags
396 397 colors={}
398 - def Show(self, flag, msg, prefix=''):
399 msg=msg.replace('\r','\\r').replace('\n','\\n').replace('><','>\n <') 400 if not colors_enabled: pass 401 elif self.colors.has_key(prefix): msg=self.colors[prefix]+msg+color_none 402 else: msg=color_none+msg 403 if not colors_enabled: prefixcolor='' 404 elif self.colors.has_key(flag): prefixcolor=self.colors[flag] 405 else: prefixcolor=color_none 406 407 if prefix=='error': 408 _exception = sys.exc_info() 409 if _exception[0]: 410 msg=msg+'\n'+''.join(traceback.format_exception(_exception[0], _exception[1], _exception[2])).rstrip() 411 412 prefix= self.prefix+prefixcolor+(flag+' '*12)[:12]+' '+(prefix+' '*6)[:6] 413 self.show(msg, flag, prefix)
414
415 - def is_active( self, flag ):
416 if not self.active: return 0 417 if not flag or flag in self.active and DBG_ALWAYS not in self.active or flag not in self.active and DBG_ALWAYS in self.active : return 1 418 return 0
419 420 DBG_ALWAYS='always' 421 422 ##Uncomment this to effectively disable all debugging and all debugging overhead. 423 #Debug=NoDebug 424

xmpppy-0.4.1/doc/apidocs/xmpp.jep0106-pysrc.html0000644000175000000500000003075510731034066020201 0ustar normansrc xmpp.jep0106
Package xmpp :: Module jep0106
[hide private]
[frames] | no frames]

Source Code for Module xmpp.jep0106

 1   
 2  # JID Escaping XEP-0106 for the xmpppy based transports written by Norman Rasmussen 
 3   
 4  """This file is the XEP-0106 commands. 
 5   
 6  Implemented commands as follows: 
 7   
 8  4.2 Encode : Encoding Transformation 
 9  4.3 Decode : Decoding Transformation 
10   
11   
12  """ 
13   
14  xep0106mapping = [ 
15          [' ' ,'20'], 
16          ['"' ,'22'], 
17          ['&' ,'26'], 
18          ['\'','27'], 
19          ['/' ,'2f'], 
20          [':' ,'3a'], 
21          ['<' ,'3c'], 
22          ['>' ,'3e'], 
23          ['@' ,'40']] 
24   
25 -def JIDEncode(str):
26 str = str.replace('\\5c', '\\5c5c') 27 for each in xep0106mapping: 28 str = str.replace('\\' + each[1], '\\5c' + each[1]) 29 for each in xep0106mapping: 30 str = str.replace(each[0], '\\' + each[1]) 31 return str
32
33 -def JIDDecode(str):
34 for each in xep0106mapping: 35 str = str.replace('\\' + each[1], each[0]) 36 return str.replace('\\5c', '\\')
37

xmpppy-0.4.1/doc/apidocs/xmpp.dispatcher-pysrc.html0000644000175000000500000053322110731034067021237 0ustar normansrc xmpp.dispatcher
Package xmpp :: Module dispatcher
[hide private]
[frames] | no frames]

Source Code for Module xmpp.dispatcher

  1  ##   transports.py 
  2  ## 
  3  ##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: dispatcher.py,v 1.42 2007/05/18 23:18:36 normanr Exp $ 
 16   
 17  """ 
 18  Main xmpppy mechanism. Provides library with methods to assign different handlers 
 19  to different XMPP stanzas. 
 20  Contains one tunable attribute: DefaultTimeout (25 seconds by default). It defines time that  
 21  Dispatcher.SendAndWaitForResponce method will wait for reply stanza before giving up. 
 22  """ 
 23   
 24  import simplexml,time,sys 
 25  from protocol import * 
 26  from client import PlugIn 
 27   
 28  DefaultTimeout=25 
 29  ID=0 
 30   
31 -class Dispatcher(PlugIn):
32 """ Ancestor of PlugIn class. Handles XMPP stream, i.e. aware of stream headers. 33 Can be plugged out/in to restart these headers (used for SASL f.e.). """
34 - def __init__(self):
35 PlugIn.__init__(self) 36 DBG_LINE='dispatcher' 37 self.handlers={} 38 self._expected={} 39 self._defaultHandler=None 40 self._pendingExceptions=[] 41 self._eventHandler=None 42 self._cycleHandlers=[] 43 self._exported_methods=[self.Process,self.RegisterHandler,self.RegisterDefaultHandler,\ 44 self.RegisterEventHandler,self.UnregisterCycleHandler,self.RegisterCycleHandler,\ 45 self.RegisterHandlerOnce,self.UnregisterHandler,self.RegisterProtocol,\ 46 self.WaitForResponse,self.SendAndWaitForResponse,self.send,self.disconnect,\ 47 self.SendAndCallForResponse, ]
48
49 - def dumpHandlers(self):
50 """ Return set of user-registered callbacks in it's internal format. 51 Used within the library to carry user handlers set over Dispatcher replugins. """ 52 return self.handlers
53 - def restoreHandlers(self,handlers):
54 """ Restores user-registered callbacks structure from dump previously obtained via dumpHandlers. 55 Used within the library to carry user handlers set over Dispatcher replugins. """ 56 self.handlers=handlers
57
58 - def _init(self):
59 """ Registers default namespaces/protocols/handlers. Used internally. """ 60 self.RegisterNamespace('unknown') 61 self.RegisterNamespace(NS_STREAMS) 62 self.RegisterNamespace(self._owner.defaultNamespace) 63 self.RegisterProtocol('iq',Iq) 64 self.RegisterProtocol('presence',Presence) 65 self.RegisterProtocol('message',Message) 66 self.RegisterDefaultHandler(self.returnStanzaHandler) 67 self.RegisterHandler('error',self.streamErrorHandler,xmlns=NS_STREAMS)
68
69 - def plugin(self, owner):
70 """ Plug the Dispatcher instance into Client class instance and send initial stream header. Used internally.""" 71 self._init() 72 for method in self._old_owners_methods: 73 if method.__name__=='send': self._owner_send=method; break 74 self._owner.lastErrNode=None 75 self._owner.lastErr=None 76 self._owner.lastErrCode=None 77 self.StreamInit()
78
79 - def plugout(self):
80 """ Prepares instance to be destructed. """ 81 self.Stream.dispatch=None 82 self.Stream.DEBUG=None 83 self.Stream.features=None 84 self.Stream.destroy()
85
86 - def StreamInit(self):
87 """ Send an initial stream header. """ 88 self.Stream=simplexml.NodeBuilder() 89 self.Stream._dispatch_depth=2 90 self.Stream.dispatch=self.dispatch 91 self.Stream.stream_header_received=self._check_stream_start 92 self._owner.debug_flags.append(simplexml.DBG_NODEBUILDER) 93 self.Stream.DEBUG=self._owner.DEBUG 94 self.Stream.features=None 95 self._metastream=Node('stream:stream') 96 self._metastream.setNamespace(self._owner.Namespace) 97 self._metastream.setAttr('version','1.0') 98 self._metastream.setAttr('xmlns:stream',NS_STREAMS) 99 self._metastream.setAttr('to',self._owner.Server) 100 self._owner.send("<?xml version='1.0'?>%s>"%str(self._metastream)[:-2])
101
102 - def _check_stream_start(self,ns,tag,attrs):
103 if ns<>NS_STREAMS or tag<>'stream': 104 raise ValueError('Incorrect stream start: (%s,%s). Terminating.'%(tag,ns))
105
106 - def Process(self, timeout=0):
107 """ Check incoming stream for data waiting. If "timeout" is positive - block for as max. this time. 108 Returns: 109 1) length of processed data if some data were processed; 110 2) '0' string if no data were processed but link is alive; 111 3) 0 (zero) if underlying connection is closed. 112 Take note that in case of disconnection detect during Process() call 113 disconnect handlers are called automatically. 114 """ 115 for handler in self._cycleHandlers: handler(self) 116 if len(self._pendingExceptions) > 0: 117 _pendingException = self._pendingExceptions.pop() 118 raise _pendingException[0], _pendingException[1], _pendingException[2] 119 if self._owner.Connection.pending_data(timeout): 120 try: data=self._owner.Connection.receive() 121 except IOError: return 122 self.Stream.Parse(data) 123 if len(self._pendingExceptions) > 0: 124 _pendingException = self._pendingExceptions.pop() 125 raise _pendingException[0], _pendingException[1], _pendingException[2] 126 if data: return len(data) 127 return '0' # It means that nothing is received but link is alive.
128
129 - def RegisterNamespace(self,xmlns,order='info'):
130 """ Creates internal structures for newly registered namespace. 131 You can register handlers for this namespace afterwards. By default one namespace 132 already registered (jabber:client or jabber:component:accept depending on context. """ 133 self.DEBUG('Registering namespace "%s"'%xmlns,order) 134 self.handlers[xmlns]={} 135 self.RegisterProtocol('unknown',Protocol,xmlns=xmlns) 136 self.RegisterProtocol('default',Protocol,xmlns=xmlns)
137
138 - def RegisterProtocol(self,tag_name,Proto,xmlns=None,order='info'):
139 """ Used to declare some top-level stanza name to dispatcher. 140 Needed to start registering handlers for such stanzas. 141 Iq, message and presence protocols are registered by default. """ 142 if not xmlns: xmlns=self._owner.defaultNamespace 143 self.DEBUG('Registering protocol "%s" as %s(%s)'%(tag_name,Proto,xmlns), order) 144 self.handlers[xmlns][tag_name]={type:Proto, 'default':[]}
145
146 - def RegisterNamespaceHandler(self,xmlns,handler,typ='',ns='', makefirst=0, system=0):
147 """ Register handler for processing all stanzas for specified namespace. """ 148 self.RegisterHandler('default', handler, typ, ns, xmlns, makefirst, system)
149
150 - def RegisterHandler(self,name,handler,typ='',ns='',xmlns=None, makefirst=0, system=0):
151 """Register user callback as stanzas handler of declared type. Callback must take 152 (if chained, see later) arguments: dispatcher instance (for replying), incomed 153 return of previous handlers. 154 The callback must raise xmpp.NodeProcessed just before return if it want preven 155 callbacks to be called with the same stanza as argument _and_, more importantly 156 library from returning stanza to sender with error set (to be enabled in 0.2 ve 157 Arguments: 158 "name" - name of stanza. F.e. "iq". 159 "handler" - user callback. 160 "typ" - value of stanza's "type" attribute. If not specified any value match 161 "ns" - namespace of child that stanza must contain. 162 "chained" - chain together output of several handlers. 163 "makefirst" - insert handler in the beginning of handlers list instead of 164 adding it to the end. Note that more common handlers (i.e. w/o "typ" and " 165 will be called first nevertheless. 166 "system" - call handler even if NodeProcessed Exception were raised already. 167 """ 168 if not xmlns: xmlns=self._owner.defaultNamespace 169 self.DEBUG('Registering handler %s for "%s" type->%s ns->%s(%s)'%(handler,name,typ,ns,xmlns), 'info') 170 if not typ and not ns: typ='default' 171 if not self.handlers.has_key(xmlns): self.RegisterNamespace(xmlns,'warn') 172 if not self.handlers[xmlns].has_key(name): self.RegisterProtocol(name,Protocol,xmlns,'warn') 173 if not self.handlers[xmlns][name].has_key(typ+ns): self.handlers[xmlns][name][typ+ns]=[] 174 if makefirst: self.handlers[xmlns][name][typ+ns].insert(0,{'func':handler,'system':system}) 175 else: self.handlers[xmlns][name][typ+ns].append({'func':handler,'system':system})
176
177 - def RegisterHandlerOnce(self,name,handler,typ='',ns='',xmlns=None,makefirst=0, system=0):
178 """ Unregister handler after first call (not implemented yet). """ 179 if not xmlns: xmlns=self._owner.defaultNamespace 180 self.RegisterHandler(name, handler, typ, ns, xmlns, makefirst, system)
181
182 - def UnregisterHandler(self,name,handler,typ='',ns='',xmlns=None):
183 """ Unregister handler. "typ" and "ns" must be specified exactly the same as with registering.""" 184 if not xmlns: xmlns=self._owner.defaultNamespace 185 if not self.handlers.has_key(xmlns): return 186 if not typ and not ns: typ='default' 187 for pack in self.handlers[xmlns][name][typ+ns]: 188 if handler==pack['func']: break 189 else: pack=None 190 try: self.handlers[xmlns][name][typ+ns].remove(pack) 191 except ValueError: pass
192
193 - def RegisterDefaultHandler(self,handler):
194 """ Specify the handler that will be used if no NodeProcessed exception were raised. 195 This is returnStanzaHandler by default. """ 196 self._defaultHandler=handler
197
198 - def RegisterEventHandler(self,handler):
199 """ Register handler that will process events. F.e. "FILERECEIVED" event. """ 200 self._eventHandler=handler
201
202 - def returnStanzaHandler(self,conn,stanza):
203 """ Return stanza back to the sender with <feature-not-implemennted/> error set. """ 204 if stanza.getType() in ['get','set']: 205 conn.send(Error(stanza,ERR_FEATURE_NOT_IMPLEMENTED))
206
207 - def streamErrorHandler(self,conn,error):
208 name,text='error',error.getData() 209 for tag in error.getChildren(): 210 if tag.getNamespace()==NS_XMPP_STREAMS: 211 if tag.getName()=='text': text=tag.getData() 212 else: name=tag.getName() 213 if name in stream_exceptions.keys(): exc=stream_exceptions[name] 214 else: exc=StreamError 215 raise exc((name,text))
216
217 - def RegisterCycleHandler(self,handler):
218 """ Register handler that will be called on every Dispatcher.Process() call. """ 219 if handler not in self._cycleHandlers: self._cycleHandlers.append(handler)
220
221 - def UnregisterCycleHandler(self,handler):
222 """ Unregister handler that will is called on every Dispatcher.Process() call.""" 223 if handler in self._cycleHandlers: self._cycleHandlers.remove(handler)
224
225 - def Event(self,realm,event,data):
226 """ Raise some event. Takes three arguments: 227 1) "realm" - scope of event. Usually a namespace. 228 2) "event" - the event itself. F.e. "SUCESSFULL SEND". 229 3) data that comes along with event. Depends on event.""" 230 if self._eventHandler: self._eventHandler(realm,event,data)
231
232 - def dispatch(self,stanza,session=None,direct=0):
233 """ Main procedure that performs XMPP stanza recognition and calling apppropriate handlers for it. 234 Called internally. """ 235 if not session: session=self 236 session.Stream._mini_dom=None 237 name=stanza.getName() 238 239 if not direct and self._owner._route: 240 if name == 'route': 241 if stanza.getAttr('error') == None: 242 if len(stanza.getChildren()) == 1: 243 stanza = stanza.getChildren()[0] 244 name=stanza.getName() 245 else: 246 for each in stanza.getChildren(): 247 self.dispatch(each,session,direct=1) 248 return 249 elif name == 'presence': 250 return 251 elif name in ('features','bind'): 252 pass 253 else: 254 raise UnsupportedStanzaType(name) 255 256 if name=='features': session.Stream.features=stanza 257 258 xmlns=stanza.getNamespace() 259 if not self.handlers.has_key(xmlns): 260 self.DEBUG("Unknown namespace: " + xmlns,'warn') 261 xmlns='unknown' 262 if not self.handlers[xmlns].has_key(name): 263 self.DEBUG("Unknown stanza: " + name,'warn') 264 name='unknown' 265 else: 266 self.DEBUG("Got %s/%s stanza"%(xmlns,name), 'ok') 267 268 if stanza.__class__.__name__=='Node': stanza=self.handlers[xmlns][name][type](node=stanza) 269 270 typ=stanza.getType() 271 if not typ: typ='' 272 stanza.props=stanza.getProperties() 273 ID=stanza.getID() 274 275 session.DEBUG("Dispatching %s stanza with type->%s props->%s id->%s"%(name,typ,stanza.props,ID),'ok') 276 277 list=['default'] # we will use all handlers: 278 if self.handlers[xmlns][name].has_key(typ): list.append(typ) # from very common... 279 for prop in stanza.props: 280 if self.handlers[xmlns][name].has_key(prop): list.append(prop) 281 if typ and self.handlers[xmlns][name].has_key(typ+prop): list.append(typ+prop) # ...to very particular 282 283 chain=self.handlers[xmlns]['default']['default'] 284 for key in list: 285 if key: chain = chain + self.handlers[xmlns][name][key] 286 287 output='' 288 if session._expected.has_key(ID): 289 user=0 290 if type(session._expected[ID])==type(()): 291 cb,args=session._expected[ID] 292 session.DEBUG("Expected stanza arrived. Callback %s(%s) found!"%(cb,args),'ok') 293 try: cb(session,stanza,**args) 294 except Exception, typ: 295 if typ.__class__.__name__<>'NodeProcessed': raise 296 else: 297 session.DEBUG("Expected stanza arrived!",'ok') 298 session._expected[ID]=stanza 299 else: user=1 300 for handler in chain: 301 if user or handler['system']: 302 try: 303 handler['func'](session,stanza) 304 except Exception, typ: 305 if typ.__class__.__name__<>'NodeProcessed': 306 self._pendingExceptions.insert(0, sys.exc_info()) 307 return 308 user=0 309 if user and self._defaultHandler: self._defaultHandler(session,stanza)
310
311 - def WaitForResponse(self, ID, timeout=DefaultTimeout):
312 """ Block and wait until stanza with specific "id" attribute will come. 313 If no such stanza is arrived within timeout, return None. 314 If operation failed for some reason then owner's attributes 315 lastErrNode, lastErr and lastErrCode are set accordingly. """ 316 self._expected[ID]=None 317 has_timed_out=0 318 abort_time=time.time() + timeout 319 self.DEBUG("Waiting for ID:%s with timeout %s..." % (ID,timeout),'wait') 320 while not self._expected[ID]: 321 if not self.Process(0.04): 322 self._owner.lastErr="Disconnect" 323 return None 324 if time.time() > abort_time: 325 self._owner.lastErr="Timeout" 326 return None 327 response=self._expected[ID] 328 del self._expected[ID] 329 if response.getErrorCode(): 330 self._owner.lastErrNode=response 331 self._owner.lastErr=response.getError() 332 self._owner.lastErrCode=response.getErrorCode() 333 return response
334
335 - def SendAndWaitForResponse(self, stanza, timeout=DefaultTimeout):
336 """ Put stanza on the wire and wait for recipient's response to it. """ 337 return self.WaitForResponse(self.send(stanza),timeout)
338
339 - def SendAndCallForResponse(self, stanza, func, args={}):
340 """ Put stanza on the wire and call back when recipient replies. 341 Additional callback arguments can be specified in args. """ 342 self._expected[self.send(stanza)]=(func,args)
343
344 - def send(self,stanza):
345 """ Serialise stanza and put it on the wire. Assign an unique ID to it before send. 346 Returns assigned ID.""" 347 if type(stanza) in [type(''), type(u'')]: return self._owner_send(stanza) 348 if not isinstance(stanza,Protocol): _ID=None 349 elif not stanza.getID(): 350 global ID 351 ID+=1 352 _ID=`ID` 353 stanza.setID(_ID) 354 else: _ID=stanza.getID() 355 if self._owner._registered_name and not stanza.getAttr('from'): stanza.setAttr('from',self._owner._registered_name) 356 if self._owner._route and stanza.getName()!='bind': 357 to=self._owner.Server 358 if stanza.getTo() and stanza.getTo().getDomain(): 359 to=stanza.getTo().getDomain() 360 frm=stanza.getFrom() 361 if frm.getDomain(): 362 frm=frm.getDomain() 363 route=Protocol('route',to=to,frm=frm,payload=[stanza]) 364 stanza=route 365 stanza.setNamespace(self._owner.Namespace) 366 stanza.setParent(self._metastream) 367 self._owner_send(stanza) 368 return _ID
369
370 - def disconnect(self):
371 """ Send a stream terminator and and handle all incoming stanzas before stream closure. """ 372 self._owner_send('</stream:stream>') 373 while self.Process(1): pass
374

xmpppy-0.4.1/doc/apidocs/xmpp.session-pysrc.html0000644000175000000500000043434110731034070020571 0ustar normansrc xmpp.session
Package xmpp :: Module session
[hide private]
[frames] | no frames]

Source Code for Module xmpp.session

  1  ## 
  2  ##   XMPP server 
  3  ## 
  4  ##   Copyright (C) 2004 Alexey "Snake" Nezhdanov 
  5  ## 
  6  ##   This program is free software; you can redistribute it and/or modify 
  7  ##   it under the terms of the GNU General Public License as published by 
  8  ##   the Free Software Foundation; either version 2, or (at your option) 
  9  ##   any later version. 
 10  ## 
 11  ##   This program is distributed in the hope that it will be useful, 
 12  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 13  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 14  ##   GNU General Public License for more details. 
 15   
 16  __version__="$Id" 
 17   
 18  """ 
 19  When your handler is called it is getting the session instance as the first argument. 
 20  This is the difference from xmpppy 0.1 where you got the "Client" instance. 
 21  With Session class you can have "multi-session" client instead of having 
 22  one client for each connection. Is is specifically important when you are 
 23  writing the server. 
 24  """ 
 25   
 26  from protocol import * 
 27   
 28  # Transport-level flags 
 29  SOCKET_UNCONNECTED  =0 
 30  SOCKET_ALIVE        =1 
 31  SOCKET_DEAD         =2 
 32  # XML-level flags 
 33  STREAM__NOT_OPENED =1 
 34  STREAM__OPENED     =2 
 35  STREAM__CLOSING    =3 
 36  STREAM__CLOSED     =4 
 37  # XMPP-session flags 
 38  SESSION_NOT_AUTHED =1 
 39  SESSION_AUTHED     =2 
 40  SESSION_BOUND      =3 
 41  SESSION_OPENED     =4 
 42  SESSION_CLOSED     =5 
 43   
44 -class Session:
45 """ 46 The Session class instance is used for storing all session-related info like 47 credentials, socket/xml stream/session state flags, roster items (in case of 48 client type connection) etc. 49 Session object have no means of discovering is any info is ready to be read. 50 Instead you should use poll() (recomended) or select() methods for this purpose. 51 Session can be one of two types: 'server' and 'client'. 'server' session handles 52 inbound connection and 'client' one used to create an outbound one. 53 Session instance have multitude of internal attributes. The most imporant is the 'peer' one. 54 It is set once the peer is authenticated (client). 55 """
56 - def __init__(self,socket,owner,xmlns=None,peer=None):
57 """ When the session is created it's type (client/server) is determined from the beginning. 58 socket argument is the pre-created socket-like object. 59 It must have the following methods: send, recv, fileno, close. 60 owner is the 'master' instance that have Dispatcher plugged into it and generally 61 will take care about all session events. 62 xmlns is the stream namespace that will be used. Client must set this argument 63 If server sets this argument than stream will be dropped if opened with some another namespace. 64 peer is the name of peer instance. This is the flag that differentiates client session from 65 server session. Client must set it to the name of the server that will be connected, server must 66 leave this argument alone. 67 """ 68 self.xmlns=xmlns 69 if peer: 70 self.TYP='client' 71 self.peer=peer 72 self._socket_state=SOCKET_UNCONNECTED 73 else: 74 self.TYP='server' 75 self.peer=None 76 self._socket_state=SOCKET_ALIVE 77 self._sock=socket 78 self._send=socket.send 79 self._recv=socket.recv 80 self.fileno=socket.fileno 81 self._registered=0 82 83 self.Dispatcher=owner.Dispatcher 84 self.DBG_LINE='session' 85 self.DEBUG=owner.Dispatcher.DEBUG 86 self._expected={} 87 self._owner=owner 88 if self.TYP=='server': self.ID=`random.random()`[2:] 89 else: self.ID=None 90 91 self.sendbuffer='' 92 self._stream_pos_queued=None 93 self._stream_pos_sent=0 94 self.deliver_key_queue=[] 95 self.deliver_queue_map={} 96 self.stanza_queue=[] 97 98 self._session_state=SESSION_NOT_AUTHED 99 self.waiting_features=[] 100 for feature in [NS_TLS,NS_SASL,NS_BIND,NS_SESSION]: 101 if feature in owner.features: self.waiting_features.append(feature) 102 self.features=[] 103 self.feature_in_process=None 104 self.slave_session=None 105 self.StartStream()
106
107 - def StartStream(self):
108 """ This method is used to initialise the internal xml expat parser 109 and to send initial stream header (in case of client connection). 110 Should be used after initial connection and after every stream restart.""" 111 self._stream_state=STREAM__NOT_OPENED 112 self.Stream=simplexml.NodeBuilder() 113 self.Stream._dispatch_depth=2 114 self.Stream.dispatch=self._dispatch 115 self.Parse=self.Stream.Parse 116 self.Stream.stream_footer_received=self._stream_close 117 if self.TYP=='client': 118 self.Stream.stream_header_received=self._catch_stream_id 119 self._stream_open() 120 else: 121 self.Stream.stream_header_received=self._stream_open
122
123 - def receive(self):
124 """ Reads all pending incoming data. 125 Raises IOError on disconnection. 126 Blocks until at least one byte is read.""" 127 try: received = self._recv(10240) 128 except: received = '' 129 130 if len(received): # length of 0 means disconnect 131 self.DEBUG(`self.fileno()`+' '+received,'got') 132 else: 133 self.DEBUG('Socket error while receiving data','error') 134 self.set_socket_state(SOCKET_DEAD) 135 raise IOError("Peer disconnected") 136 return received
137
138 - def sendnow(self,chunk):
139 """ Put chunk into "immidiatedly send" queue. 140 Should only be used for auth/TLS stuff and like. 141 If you just want to shedule regular stanza for delivery use enqueue method. 142 """ 143 if isinstance(chunk,Node): chunk = chunk.__str__().encode('utf-8') 144 elif type(chunk)==type(u''): chunk = chunk.encode('utf-8') 145 self.enqueue(chunk)
146
147 - def enqueue(self,stanza):
148 """ Takes Protocol instance as argument. 149 Puts stanza into "send" fifo queue. Items into the send queue are hold until 150 stream authenticated. After that this method is effectively the same as "sendnow" method.""" 151 if isinstance(stanza,Protocol): 152 self.stanza_queue.append(stanza) 153 else: self.sendbuffer+=stanza 154 if self._socket_state>=SOCKET_ALIVE: self.push_queue()
155
156 - def push_queue(self,failreason=ERR_RECIPIENT_UNAVAILABLE):
157 """ If stream is authenticated than move items from "send" queue to "immidiatedly send" queue. 158 Else if the stream is failed then return all queued stanzas with error passed as argument. 159 Otherwise do nothing.""" 160 # If the stream authed - convert stanza_queue into sendbuffer and set the checkpoints 161 162 if self._stream_state>=STREAM__CLOSED or self._socket_state>=SOCKET_DEAD: # the stream failed. Return all stanzas that are still waiting for delivery. 163 self._owner.deactivatesession(self) 164 for key in self.deliver_key_queue: # Not sure. May be I 165 self._dispatch(Error(self.deliver_queue_map[key],failreason),trusted=1) # should simply re-dispatch it? 166 for stanza in self.stanza_queue: # But such action can invoke 167 self._dispatch(Error(stanza,failreason),trusted=1) # Infinite loops in case of S2S connection... 168 self.deliver_queue_map,self.deliver_key_queue,self.stanza_queue={},[],[] 169 return 170 elif self._session_state>=SESSION_AUTHED: # FIXME! äÏÌÖÅÎ ÂÙÔØ ËÁËÏÊ-ÔÏ ÄÒÕÇÏÊ ÆÌÁÇ. 171 #### LOCK_QUEUE 172 for stanza in self.stanza_queue: 173 txt=stanza.__str__().encode('utf-8') 174 self.sendbuffer+=txt 175 self._stream_pos_queued+=len(txt) # should be re-evaluated for SSL connection. 176 self.deliver_queue_map[self._stream_pos_queued]=stanza # position of the stream when stanza will be successfully and fully sent 177 self.deliver_key_queue.append(self._stream_pos_queued) 178 self.stanza_queue=[]
179 #### UNLOCK_QUEUE 180
181 - def flush_queue(self):
182 """ Put the "immidiatedly send" queue content on the wire. Blocks until at least one byte sent.""" 183 if self.sendbuffer: 184 try: 185 # LOCK_QUEUE 186 sent=self._send(self.sendbuffer) # âÌÏËÉÒÕÀÝÁÑ ÛÔÕÞËÁ! 187 except: 188 # UNLOCK_QUEUE 189 self.set_socket_state(SOCKET_DEAD) 190 self.DEBUG("Socket error while sending data",'error') 191 return self.terminate_stream() 192 self.DEBUG(`self.fileno()`+' '+self.sendbuffer[:sent],'sent') 193 self._stream_pos_sent+=sent 194 self.sendbuffer=self.sendbuffer[sent:] 195 self._stream_pos_delivered=self._stream_pos_sent # Should be acquired from socket somehow. Take SSL into account. 196 while self.deliver_key_queue and self._stream_pos_delivered>self.deliver_key_queue[0]: 197 del self.deliver_queue_map[self.deliver_key_queue[0]] 198 self.deliver_key_queue.remove(self.deliver_key_queue[0])
199 # UNLOCK_QUEUE 200
201 - def _dispatch(self,stanza,trusted=0):
202 """ This is callback that is used to pass the received stanza forth to owner's dispatcher 203 _if_ the stream is authorised. Otherwise the stanza is just dropped. 204 The 'trusted' argument is used to emulate stanza receive. 205 This method is used internally. 206 """ 207 self._owner.packets+=1 208 print self._owner.packets 209 if self._stream_state==STREAM__OPENED or trusted: # if the server really should reject all stanzas after he is closed stream (himeself)? 210 self.DEBUG(stanza.__str__(),'dispatch') 211 stanza.trusted=trusted 212 return self.Dispatcher.dispatch(stanza,self)
213
214 - def _catch_stream_id(self,ns=None,tag='stream',attrs={}):
215 """ This callback is used to detect the stream namespace of incoming stream. Used internally. """ 216 if not attrs.has_key('id') or not attrs['id']: 217 return self.terminate_stream(STREAM_INVALID_XML) 218 self.ID=attrs['id'] 219 if not attrs.has_key('version'): self._owner.Dialback(self)
220
221 - def _stream_open(self,ns=None,tag='stream',attrs={}):
222 """ This callback is used to handle opening stream tag of the incoming stream. 223 In the case of client session it just make some validation. 224 Server session also sends server headers and if the stream valid the features node. 225 Used internally. """ 226 text='<?xml version="1.0" encoding="utf-8"?>\n<stream:stream' 227 if self.TYP=='client': 228 text+=' to="%s"'%self.peer 229 else: 230 text+=' id="%s"'%self.ID 231 if not attrs.has_key('to'): text+=' from="%s"'%self._owner.servernames[0] 232 else: text+=' from="%s"'%attrs['to'] 233 if attrs.has_key('xml:lang'): text+=' xml:lang="%s"'%attrs['xml:lang'] 234 if self.xmlns: xmlns=self.xmlns 235 else: xmlns=NS_SERVER 236 text+=' xmlns:db="%s" xmlns:stream="%s" xmlns="%s"'%(NS_DIALBACK,NS_STREAMS,xmlns) 237 if attrs.has_key('version') or self.TYP=='client': text+=' version="1.0"' 238 self.sendnow(text+'>') 239 self.set_stream_state(STREAM__OPENED) 240 if self.TYP=='client': return 241 if tag<>'stream': return self.terminate_stream(STREAM_INVALID_XML) 242 if ns<>NS_STREAMS: return self.terminate_stream(STREAM_INVALID_NAMESPACE) 243 if self.Stream.xmlns<>self.xmlns: return self.terminate_stream(STREAM_BAD_NAMESPACE_PREFIX) 244 if not attrs.has_key('to'): return self.terminate_stream(STREAM_IMPROPER_ADDRESSING) 245 if attrs['to'] not in self._owner.servernames: return self.terminate_stream(STREAM_HOST_UNKNOWN) 246 self.ourname=attrs['to'].lower() 247 if self.TYP=='server' and attrs.has_key('version'): 248 # send features 249 features=Node('stream:features') 250 if NS_TLS in self.waiting_features: 251 features.NT.starttls.setNamespace(NS_TLS) 252 features.T.starttls.NT.required 253 if NS_SASL in self.waiting_features: 254 features.NT.mechanisms.setNamespace(NS_SASL) 255 for mec in self._owner.SASL.mechanisms: 256 features.T.mechanisms.NT.mechanism=mec 257 else: 258 if NS_BIND in self.waiting_features: features.NT.bind.setNamespace(NS_BIND) 259 if NS_SESSION in self.waiting_features: features.NT.session.setNamespace(NS_SESSION) 260 self.sendnow(features)
261
262 - def feature(self,feature):
263 """ Declare some stream feature as activated one. """ 264 if feature not in self.features: self.features.append(feature) 265 self.unfeature(feature)
266
267 - def unfeature(self,feature):
268 """ Declare some feature as illegal. Illegal features can not be used. 269 Example: BIND feature becomes illegal after Non-SASL auth. """ 270 if feature in self.waiting_features: self.waiting_features.remove(feature)
271
272 - def _stream_close(self,unregister=1):
273 """ Write the closing stream tag and destroy the underlaying socket. Used internally. """ 274 if self._stream_state>=STREAM__CLOSED: return 275 self.set_stream_state(STREAM__CLOSING) 276 self.sendnow('</stream:stream>') 277 self.set_stream_state(STREAM__CLOSED) 278 self.push_queue() # decompose queue really since STREAM__CLOSED 279 self._owner.flush_queues() 280 if unregister: self._owner.unregistersession(self) 281 self._destroy_socket()
282
283 - def terminate_stream(self,error=None,unregister=1):
284 """ Notify the peer about stream closure. 285 Ensure that xmlstream is not brokes - i.e. if the stream isn't opened yet - 286 open it before closure. 287 If the error condition is specified than create a stream error and send it along with 288 closing stream tag. 289 Emulate receiving 'unavailable' type presence just before stream closure. 290 """ 291 if self._stream_state>=STREAM__CLOSING: return 292 if self._stream_state<STREAM__OPENED: 293 self.set_stream_state(STREAM__CLOSING) 294 self._stream_open() 295 else: 296 self.set_stream_state(STREAM__CLOSING) 297 p=Presence(typ='unavailable') 298 p.setNamespace(NS_CLIENT) 299 self._dispatch(p,trusted=1) 300 if error: 301 if isinstance(error,Node): self.sendnow(error) 302 else: self.sendnow(ErrorNode(error)) 303 self._stream_close(unregister=unregister) 304 if self.slave_session: 305 self.slave_session.terminate_stream(STREAM_REMOTE_CONNECTION_FAILED)
306
307 - def _destroy_socket(self):
308 """ Break cyclic dependancies to let python's GC free memory right now.""" 309 self.Stream.dispatch=None 310 self.Stream.stream_footer_received=None 311 self.Stream.stream_header_received=None 312 self.Stream.destroy() 313 self._sock.close() 314 self.set_socket_state(SOCKET_DEAD)
315
316 - def start_feature(self,f):
317 """ Declare some feature as "negotiating now" to prevent other features from start negotiating. """ 318 if self.feature_in_process: raise "Starting feature %s over %s !"%(f,self.feature_in_process) 319 self.feature_in_process=f
320
321 - def stop_feature(self,f):
322 """ Declare some feature as "negotiated" to allow other features start negotiating. """ 323 if self.feature_in_process<>f: raise "Stopping feature %s instead of %s !"%(f,self.feature_in_process) 324 self.feature_in_process=None
325
326 - def set_socket_state(self,newstate):
327 """ Change the underlaying socket state. 328 Socket starts with SOCKET_UNCONNECTED state 329 and then proceeds (possibly) to SOCKET_ALIVE 330 and then to SOCKET_DEAD """ 331 if self._socket_state<newstate: self._socket_state=newstate
332
333 - def set_session_state(self,newstate):
334 """ Change the session state. 335 Session starts with SESSION_NOT_AUTHED state 336 and then comes through 337 SESSION_AUTHED, SESSION_BOUND, SESSION_OPENED and SESSION_CLOSED states. 338 """ 339 if self._session_state<newstate: 340 if self._session_state<SESSION_AUTHED and \ 341 newstate>=SESSION_AUTHED: self._stream_pos_queued=self._stream_pos_sent 342 self._session_state=newstate
343
344 - def set_stream_state(self,newstate):
345 """ Change the underlaying XML stream state 346 Stream starts with STREAM__NOT_OPENED and then proceeds with 347 STREAM__OPENED, STREAM__CLOSING and STREAM__CLOSED states. 348 Note that some features (like TLS and SASL) 349 requires stream re-start so this state can have non-linear changes. """ 350 if self._stream_state<newstate: self._stream_state=newstate
351

xmpppy-0.4.1/doc/apidocs/xmpp-pysrc.html0000644000175000000500000002701510731034070017103 0ustar normansrc xmpp
Package xmpp
[hide private]
[frames] | no frames]

Source Code for Package xmpp

 1  # $Id: __init__.py,v 1.9 2005/03/07 09:34:51 snakeru Exp $ 
 2   
 3  """ 
 4  All features of xmpppy library contained within separate modules. 
 5  At present there are modules: 
 6  simplexml - XML handling routines 
 7  protocol - jabber-objects (I.e. JID and different stanzas and sub-stanzas) handling routines. 
 8  debug - Jacob Lundquist's debugging module. Very handy if you like colored debug. 
 9  auth - Non-SASL and SASL stuff. You will need it to auth as a client or transport. 
10  transports - low level connection handling. TCP and TLS currently. HTTP support planned. 
11  roster - simple roster for use in clients. 
12  dispatcher - decision-making logic. Handles all hooks. The first who takes control over fresh stanzas. 
13  features - different stuff that didn't worths separating into modules 
14  browser - DISCO server framework. Allows to build dynamic disco tree. 
15  filetransfer - Currently contains only IBB stuff. Can be used for bot-to-bot transfers. 
16   
17  Most of the classes that is defined in all these modules is an ancestors of  
18  class PlugIn so they share a single set of methods allowing you to compile  
19  a featured XMPP client. For every instance of PlugIn class the 'owner' is the class 
20  in what the plug was plugged. While plugging in such instance usually sets some 
21  methods of owner to it's own ones for easy access. All session specific info stored 
22  either in instance of PlugIn or in owner's instance. This is considered unhandy 
23  and there are plans to port 'Session' class from xmppd.py project for storing all 
24  session-related info. Though if you are not accessing instances variables directly 
25  and use only methods for access all values you should not have any problems. 
26   
27  """ 
28   
29  import simplexml,protocol,debug,auth,transports,roster,dispatcher,features,browser,filetransfer,commands 
30  from client import * 
31  from protocol import * 
32   

xmpppy-0.4.1/doc/apidocs/xmpp.protocol-pysrc.html0000644000175000000500000132332210731034073020747 0ustar normansrc xmpp.protocol
Package xmpp :: Module protocol
[hide private]
[frames] | no frames]

Source Code for Module xmpp.protocol

  1  ##   protocol.py  
  2  ## 
  3  ##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: protocol.py,v 1.58 2007/05/13 17:55:46 normanr Exp $ 
 16   
 17  """ 
 18  Protocol module contains tools that is needed for processing of  
 19  xmpp-related data structures. 
 20  """ 
 21   
 22  from simplexml import Node,ustr 
 23  import time 
 24  NS_ACTIVITY         ='http://jabber.org/protocol/activity'                  # XEP-0108 
 25  NS_ADDRESS          ='http://jabber.org/protocol/address'                   # XEP-0033 
 26  NS_ADMIN            ='http://jabber.org/protocol/admin'                     # XEP-0133 
 27  NS_ADMIN_ADD_USER               =NS_ADMIN+'#add-user'                       # XEP-0133 
 28  NS_ADMIN_DELETE_USER            =NS_ADMIN+'#delete-user'                    # XEP-0133 
 29  NS_ADMIN_DISABLE_USER           =NS_ADMIN+'#disable-user'                   # XEP-0133 
 30  NS_ADMIN_REENABLE_USER          =NS_ADMIN+'#reenable-user'                  # XEP-0133 
 31  NS_ADMIN_END_USER_SESSION       =NS_ADMIN+'#end-user-session'               # XEP-0133 
 32  NS_ADMIN_GET_USER_PASSWORD      =NS_ADMIN+'#get-user-password'              # XEP-0133 
 33  NS_ADMIN_CHANGE_USER_PASSWORD   =NS_ADMIN+'#change-user-password'           # XEP-0133 
 34  NS_ADMIN_GET_USER_ROSTER        =NS_ADMIN+'#get-user-roster'                # XEP-0133 
 35  NS_ADMIN_GET_USER_LASTLOGIN     =NS_ADMIN+'#get-user-lastlogin'             # XEP-0133 
 36  NS_ADMIN_USER_STATS             =NS_ADMIN+'#user-stats'                     # XEP-0133 
 37  NS_ADMIN_EDIT_BLACKLIST         =NS_ADMIN+'#edit-blacklist'                 # XEP-0133 
 38  NS_ADMIN_EDIT_WHITELIST         =NS_ADMIN+'#edit-whitelist'                 # XEP-0133 
 39  NS_ADMIN_REGISTERED_USERS_NUM   =NS_ADMIN+'#get-registered-users-num'       # XEP-0133 
 40  NS_ADMIN_DISABLED_USERS_NUM     =NS_ADMIN+'#get-disabled-users-num'         # XEP-0133 
 41  NS_ADMIN_ONLINE_USERS_NUM       =NS_ADMIN+'#get-online-users-num'           # XEP-0133 
 42  NS_ADMIN_ACTIVE_USERS_NUM       =NS_ADMIN+'#get-active-users-num'           # XEP-0133 
 43  NS_ADMIN_IDLE_USERS_NUM         =NS_ADMIN+'#get-idle-users-num'             # XEP-0133 
 44  NS_ADMIN_REGISTERED_USERS_LIST  =NS_ADMIN+'#get-registered-users-list'      # XEP-0133 
 45  NS_ADMIN_DISABLED_USERS_LIST    =NS_ADMIN+'#get-disabled-users-list'        # XEP-0133 
 46  NS_ADMIN_ONLINE_USERS_LIST      =NS_ADMIN+'#get-online-users-list'          # XEP-0133 
 47  NS_ADMIN_ACTIVE_USERS_LIST      =NS_ADMIN+'#get-active-users-list'          # XEP-0133 
 48  NS_ADMIN_IDLE_USERS_LIST        =NS_ADMIN+'#get-idle-users-list'            # XEP-0133 
 49  NS_ADMIN_ANNOUNCE               =NS_ADMIN+'#announce'                       # XEP-0133 
 50  NS_ADMIN_SET_MOTD               =NS_ADMIN+'#set-motd'                       # XEP-0133 
 51  NS_ADMIN_EDIT_MOTD              =NS_ADMIN+'#edit-motd'                      # XEP-0133 
 52  NS_ADMIN_DELETE_MOTD            =NS_ADMIN+'#delete-motd'                    # XEP-0133 
 53  NS_ADMIN_SET_WELCOME            =NS_ADMIN+'#set-welcome'                    # XEP-0133 
 54  NS_ADMIN_DELETE_WELCOME         =NS_ADMIN+'#delete-welcome'                 # XEP-0133 
 55  NS_ADMIN_EDIT_ADMIN             =NS_ADMIN+'#edit-admin'                     # XEP-0133 
 56  NS_ADMIN_RESTART                =NS_ADMIN+'#restart'                        # XEP-0133 
 57  NS_ADMIN_SHUTDOWN               =NS_ADMIN+'#shutdown'                       # XEP-0133 
 58  NS_AGENTS           ='jabber:iq:agents'                                     # XEP-0094 (historical) 
 59  NS_AMP              ='http://jabber.org/protocol/amp'                       # XEP-0079 
 60  NS_AMP_ERRORS                   =NS_AMP+'#errors'                           # XEP-0079 
 61  NS_AUTH             ='jabber:iq:auth' 
 62  NS_AVATAR           ='jabber:iq:avatar'                                     # XEP-0008 (historical) 
 63  NS_BIND             ='urn:ietf:params:xml:ns:xmpp-bind' 
 64  NS_BROWSE           ='jabber:iq:browse'                                     # XEP-0011 (historical) 
 65  NS_BYTESTREAM       ='http://jabber.org/protocol/bytestreams'               # XEP-0065 
 66  NS_CAPS             ='http://jabber.org/protocol/caps'                      # XEP-0115 
 67  NS_CHATSTATES       ='http://jabber.org/protocol/chatstates'                # XEP-0085 
 68  NS_CLIENT           ='jabber:client' 
 69  NS_COMMANDS         ='http://jabber.org/protocol/commands' 
 70  NS_COMPONENT_ACCEPT ='jabber:component:accept' 
 71  NS_COMPONENT_1      ='http://jabberd.jabberstudio.org/ns/component/1.0' 
 72  NS_COMPRESS         ='http://jabber.org/protocol/compress'                  # XEP-0138 
 73  NS_DATA             ='jabber:x:data'                                        # XEP-0004 
 74  NS_DELAY            ='jabber:x:delay' 
 75  NS_DIALBACK         ='jabber:server:dialback' 
 76  NS_DISCO            ='http://jabber.org/protocol/disco'                     # XEP-0030 
 77  NS_DISCO_INFO                   =NS_DISCO+'#info'                           # XEP-0030 
 78  NS_DISCO_ITEMS                  =NS_DISCO+'#items'                          # XEP-0030 
 79  NS_ENCRYPTED        ='jabber:x:encrypted'                                   # XEP-0027 
 80  NS_EVENT            ='jabber:x:event'                                       # XEP-0022 
 81  NS_FEATURE          ='http://jabber.org/protocol/feature-neg'   
 82  NS_FILE             ='http://jabber.org/protocol/si/profile/file-transfer'  # XEP-0096 
 83  NS_GATEWAY          ='jabber:iq:gateway' 
 84  NS_GEOLOC           ='http://jabber.org/protocol/geoloc'                    # XEP-0080 
 85  NS_GROUPCHAT        ='gc-1.0' 
 86  NS_HTTP_BIND        ='http://jabber.org/protocol/httpbind'                  # XEP-0124 
 87  NS_IBB              ='http://jabber.org/protocol/ibb' 
 88  NS_INVISIBLE        ='presence-invisible'                                   # Jabberd2 
 89  NS_IQ               ='iq'                                                   # Jabberd2 
 90  NS_LAST             ='jabber:iq:last' 
 91  NS_MESSAGE          ='message'                                              # Jabberd2 
 92  NS_MOOD             ='http://jabber.org/protocol/mood'                      # XEP-0107 
 93  NS_MUC              ='http://jabber.org/protocol/muc'                       # XEP-0045 
 94  NS_MUC_ADMIN                    =NS_MUC+'#admin'                            # XEP-0045 
 95  NS_MUC_OWNER                    =NS_MUC+'#owner'                            # XEP-0045 
 96  NS_MUC_UNIQUE                   =NS_MUC+'#unique'                           # XEP-0045 
 97  NS_MUC_USER                     =NS_MUC+'#user'                             # XEP-0045 
 98  NS_MUC_REGISTER                 =NS_MUC+'#register'                         # XEP-0045 
 99  NS_MUC_REQUEST                  =NS_MUC+'#request'                          # XEP-0045 
100  NS_MUC_ROOMCONFIG               =NS_MUC+'#roomconfig'                       # XEP-0045 
101  NS_MUC_ROOMINFO                 =NS_MUC+'#roominfo'                         # XEP-0045 
102  NS_MUC_ROOMS                    =NS_MUC+'#rooms'                            # XEP-0045 
103  NS_MUC_TRAFIC                   =NS_MUC+'#traffic'                          # XEP-0045 
104  NS_OFFLINE          ='http://jabber.org/protocol/offline'                   # XEP-0013 
105  NS_PHYSLOC          ='http://jabber.org/protocol/physloc'                   # XEP-0112 
106  NS_PRESENCE         ='presence'                                             # Jabberd2 
107  NS_PRIVACY          ='jabber:iq:privacy' 
108  NS_PRIVATE          ='jabber:iq:private' 
109  NS_PUBSUB           ='http://jabber.org/protocol/pubsub'                    # XEP-0060 
110  NS_REGISTER         ='jabber:iq:register' 
111  NS_ROSTER           ='jabber:iq:roster' 
112  NS_ROSTERX          ='http://jabber.org/protocol/rosterx'                   # XEP-0144 
113  NS_RPC              ='jabber:iq:rpc'                                        # XEP-0009 
114  NS_SASL             ='urn:ietf:params:xml:ns:xmpp-sasl' 
115  NS_SEARCH           ='jabber:iq:search' 
116  NS_SERVER           ='jabber:server' 
117  NS_SESSION          ='urn:ietf:params:xml:ns:xmpp-session' 
118  NS_SI               ='http://jabber.org/protocol/si'                        # XEP-0096 
119  NS_SI_PUB           ='http://jabber.org/protocol/sipub'                     # XEP-0137 
120  NS_SIGNED           ='jabber:x:signed'                                      # XEP-0027 
121  NS_STANZAS          ='urn:ietf:params:xml:ns:xmpp-stanzas' 
122  NS_STREAMS          ='http://etherx.jabber.org/streams' 
123  NS_TIME             ='jabber:iq:time' 
124  NS_TLS              ='urn:ietf:params:xml:ns:xmpp-tls' 
125  NS_VACATION         ='http://jabber.org/protocol/vacation' 
126  NS_VCARD            ='vcard-temp' 
127  NS_VERSION          ='jabber:iq:version' 
128  NS_WAITINGLIST      ='http://jabber.org/protocol/waitinglist'               # XEP-0130 
129  NS_XHTML_IM         ='http://jabber.org/protocol/xhtml-im'                  # XEP-0071 
130  NS_DATA_LAYOUT      ='http://jabber.org/protocol/xdata-layout'              # XEP-0141 
131  NS_DATA_VALIDATE    ='http://jabber.org/protocol/xdata-validate'            # XEP-0122 
132  NS_XMPP_STREAMS     ='urn:ietf:params:xml:ns:xmpp-streams' 
133   
134  xmpp_stream_error_conditions=""" 
135  bad-format --  --  -- The entity has sent XML that cannot be processed. 
136  bad-namespace-prefix --  --  -- The entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that requires such a prefix. 
137  conflict --  --  -- The server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream. 
138  connection-timeout --  --  -- The entity has not generated any traffic over the stream for some period of time. 
139  host-gone --  --  -- The value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server. 
140  host-unknown --  --  -- The value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server. 
141  improper-addressing --  --  -- A stanza sent between two servers lacks a 'to' or 'from' attribute (or the attribute has no value). 
142  internal-server-error --  --  -- The server has experienced a misconfiguration or an otherwise-undefined internal error that prevents it from servicing the stream. 
143  invalid-from -- cancel --  -- The JID or hostname provided in a 'from' address does not match an authorized JID or validated domain negotiated between servers via SASL or dialback, or between a client and a server via authentication and resource authorization. 
144  invalid-id --  --  -- The stream ID or dialback ID is invalid or does not match an ID previously provided. 
145  invalid-namespace --  --  -- The streams namespace name is something other than "http://etherx.jabber.org/streams" or the dialback namespace name is something other than "jabber:server:dialback". 
146  invalid-xml --  --  -- The entity has sent invalid XML over the stream to a server that performs validation. 
147  not-authorized --  --  -- The entity has attempted to send data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation. 
148  policy-violation --  --  -- The entity has violated some local service policy. 
149  remote-connection-failed --  --  -- The server is unable to properly connect to a remote resource that is required for authentication or authorization. 
150  resource-constraint --  --  -- The server lacks the system resources necessary to service the stream. 
151  restricted-xml --  --  -- The entity has attempted to send restricted XML features such as a comment, processing instruction, DTD, entity reference, or unescaped character. 
152  see-other-host --  --  -- The server will not provide service to the initiating entity but is redirecting traffic to another host. 
153  system-shutdown --  --  -- The server is being shut down and all active streams are being closed. 
154  undefined-condition --  --  -- The error condition is not one of those defined by the other conditions in this list. 
155  unsupported-encoding --  --  -- The initiating entity has encoded the stream in an encoding that is not supported by the server. 
156  unsupported-stanza-type --  --  -- The initiating entity has sent a first-level child of the stream that is not supported by the server. 
157  unsupported-version --  --  -- The value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server. 
158  xml-not-well-formed --  --  -- The initiating entity has sent XML that is not well-formed.""" 
159  xmpp_stanza_error_conditions=""" 
160  bad-request -- 400 -- modify -- The sender has sent XML that is malformed or that cannot be processed. 
161  conflict -- 409 -- cancel -- Access cannot be granted because an existing resource or session exists with the same name or address. 
162  feature-not-implemented -- 501 -- cancel -- The feature requested is not implemented by the recipient or server and therefore cannot be processed. 
163  forbidden -- 403 -- auth -- The requesting entity does not possess the required permissions to perform the action. 
164  gone -- 302 -- modify -- The recipient or server can no longer be contacted at this address. 
165  internal-server-error -- 500 -- wait -- The server could not process the stanza because of a misconfiguration or an otherwise-undefined internal server error. 
166  item-not-found -- 404 -- cancel -- The addressed JID or item requested cannot be found. 
167  jid-malformed -- 400 -- modify -- The value of the 'to' attribute in the sender's stanza does not adhere to the syntax defined in Addressing Scheme. 
168  not-acceptable -- 406 -- cancel -- The recipient or server understands the request but is refusing to process it because it does not meet criteria defined by the recipient or server. 
169  not-allowed -- 405 -- cancel -- The recipient or server does not allow any entity to perform the action. 
170  not-authorized -- 401 -- auth -- The sender must provide proper credentials before being allowed to perform the action, or has provided improper credentials. 
171  payment-required -- 402 -- auth -- The requesting entity is not authorized to access the requested service because payment is required. 
172  recipient-unavailable -- 404 -- wait -- The intended recipient is temporarily unavailable. 
173  redirect -- 302 -- modify -- The recipient or server is redirecting requests for this information to another entity. 
174  registration-required -- 407 -- auth -- The requesting entity is not authorized to access the requested service because registration is required. 
175  remote-server-not-found -- 404 -- cancel -- A remote server or service specified as part or all of the JID of the intended recipient does not exist. 
176  remote-server-timeout -- 504 -- wait -- A remote server or service specified as part or all of the JID of the intended recipient could not be contacted within a reasonable amount of time. 
177  resource-constraint -- 500 -- wait -- The server or recipient lacks the system resources necessary to service the request. 
178  service-unavailable -- 503 -- cancel -- The server or recipient does not currently provide the requested service. 
179  subscription-required -- 407 -- auth -- The requesting entity is not authorized to access the requested service because a subscription is required. 
180  undefined-condition -- 500 --  --  
181  unexpected-request -- 400 -- wait -- The recipient or server understood the request but was not expecting it at this time (e.g., the request was out of order).""" 
182  sasl_error_conditions=""" 
183  aborted --  --  -- The receiving entity acknowledges an <abort/> element sent by the initiating entity; sent in reply to the <abort/> element. 
184  incorrect-encoding --  --  -- The data provided by the initiating entity could not be processed because the [BASE64]Josefsson, S., The Base16, Base32, and Base64 Data Encodings, July 2003. encoding is incorrect (e.g., because the encoding does not adhere to the definition in Section 3 of [BASE64]Josefsson, S., The Base16, Base32, and Base64 Data Encodings, July 2003.); sent in reply to a <response/> element or an <auth/> element with initial response data. 
185  invalid-authzid --  --  -- The authzid provided by the initiating entity is invalid, either because it is incorrectly formatted or because the initiating entity does not have permissions to authorize that ID; sent in reply to a <response/> element or an <auth/> element with initial response data. 
186  invalid-mechanism --  --  -- The initiating entity did not provide a mechanism or requested a mechanism that is not supported by the receiving entity; sent in reply to an <auth/> element. 
187  mechanism-too-weak --  --  -- The mechanism requested by the initiating entity is weaker than server policy permits for that initiating entity; sent in reply to a <response/> element or an <auth/> element with initial response data. 
188  not-authorized --  --  -- The authentication failed because the initiating entity did not provide valid credentials (this includes but is not limited to the case of an unknown username); sent in reply to a <response/> element or an <auth/> element with initial response data. 
189  temporary-auth-failure --  --  -- The authentication failed because of a temporary error condition within the receiving entity; sent in reply to an <auth/> element or <response/> element.""" 
190   
191  ERRORS,_errorcodes={},{} 
192  for ns,errname,errpool in [(NS_XMPP_STREAMS,'STREAM',xmpp_stream_error_conditions), 
193                             (NS_STANZAS     ,'ERR'   ,xmpp_stanza_error_conditions), 
194                             (NS_SASL        ,'SASL'  ,sasl_error_conditions)]: 
195      for err in errpool.split('\n')[1:]: 
196          cond,code,typ,text=err.split(' -- ') 
197          name=errname+'_'+cond.upper().replace('-','_') 
198          locals()[name]=ns+' '+cond 
199          ERRORS[ns+' '+cond]=[code,typ,text] 
200          if code: _errorcodes[code]=cond 
201  del ns,errname,errpool,err,cond,code,typ,text 
202   
203 -def isResultNode(node):
204 """ Returns true if the node is a positive reply. """ 205 return node and node.getType()=='result'
206 -def isErrorNode(node):
207 """ Returns true if the node is a negative reply. """ 208 return node and node.getType()=='error'
209
210 -class NodeProcessed(Exception):
211 """ Exception that should be raised by handler when the handling should be stopped. """
212 -class StreamError(Exception):
213 """ Base exception class for stream errors."""
214 -class BadFormat(StreamError): pass
215 -class BadNamespacePrefix(StreamError): pass
216 -class Conflict(StreamError): pass
217 -class ConnectionTimeout(StreamError): pass
218 -class HostGone(StreamError): pass
219 -class HostUnknown(StreamError): pass
220 -class ImproperAddressing(StreamError): pass
221 -class InternalServerError(StreamError): pass
222 -class InvalidFrom(StreamError): pass
223 -class InvalidID(StreamError): pass
224 -class InvalidNamespace(StreamError): pass
225 -class InvalidXML(StreamError): pass
226 -class NotAuthorized(StreamError): pass
227 -class PolicyViolation(StreamError): pass
228 -class RemoteConnectionFailed(StreamError): pass
229 -class ResourceConstraint(StreamError): pass
230 -class RestrictedXML(StreamError): pass
231 -class SeeOtherHost(StreamError): pass
232 -class SystemShutdown(StreamError): pass
233 -class UndefinedCondition(StreamError): pass
234 -class UnsupportedEncoding(StreamError): pass
235 -class UnsupportedStanzaType(StreamError): pass
236 -class UnsupportedVersion(StreamError): pass
237 -class XMLNotWellFormed(StreamError): pass
238 239 stream_exceptions = {'bad-format': BadFormat, 240 'bad-namespace-prefix': BadNamespacePrefix, 241 'conflict': Conflict, 242 'connection-timeout': ConnectionTimeout, 243 'host-gone': HostGone, 244 'host-unknown': HostUnknown, 245 'improper-addressing': ImproperAddressing, 246 'internal-server-error': InternalServerError, 247 'invalid-from': InvalidFrom, 248 'invalid-id': InvalidID, 249 'invalid-namespace': InvalidNamespace, 250 'invalid-xml': InvalidXML, 251 'not-authorized': NotAuthorized, 252 'policy-violation': PolicyViolation, 253 'remote-connection-failed': RemoteConnectionFailed, 254 'resource-constraint': ResourceConstraint, 255 'restricted-xml': RestrictedXML, 256 'see-other-host': SeeOtherHost, 257 'system-shutdown': SystemShutdown, 258 'undefined-condition': UndefinedCondition, 259 'unsupported-encoding': UnsupportedEncoding, 260 'unsupported-stanza-type': UnsupportedStanzaType, 261 'unsupported-version': UnsupportedVersion, 262 'xml-not-well-formed': XMLNotWellFormed} 263
264 -class JID:
265 """ JID object. JID can be built from string, modified, compared, serialised into string. """
266 - def __init__(self, jid=None, node='', domain='', resource=''):
267 """ Constructor. JID can be specified as string (jid argument) or as separate parts. 268 Examples: 269 JID('node@domain/resource') 270 JID(node='node',domain='domain.org') 271 """ 272 if not jid and not domain: raise ValueError('JID must contain at least domain name') 273 elif type(jid)==type(self): self.node,self.domain,self.resource=jid.node,jid.domain,jid.resource 274 elif domain: self.node,self.domain,self.resource=node,domain,resource 275 else: 276 if jid.find('@')+1: self.node,jid=jid.split('@',1) 277 else: self.node='' 278 if jid.find('/')+1: self.domain,self.resource=jid.split('/',1) 279 else: self.domain,self.resource=jid,''
280 - def getNode(self):
281 """ Return the node part of the JID """ 282 return self.node
283 - def setNode(self,node):
284 """ Set the node part of the JID to new value. Specify None to remove the node part.""" 285 self.node=node.lower()
286 - def getDomain(self):
287 """ Return the domain part of the JID """ 288 return self.domain
289 - def setDomain(self,domain):
290 """ Set the domain part of the JID to new value.""" 291 self.domain=domain.lower()
292 - def getResource(self):
293 """ Return the resource part of the JID """ 294 return self.resource
295 - def setResource(self,resource):
296 """ Set the resource part of the JID to new value. Specify None to remove the resource part.""" 297 self.resource=resource
298 - def getStripped(self):
299 """ Return the bare representation of JID. I.e. string value w/o resource. """ 300 return self.__str__(0)
301 - def __eq__(self, other):
302 """ Compare the JID to another instance or to string for equality. """ 303 try: other=JID(other) 304 except ValueError: return 0 305 return self.resource==other.resource and self.__str__(0) == other.__str__(0)
306 - def __ne__(self, other):
307 """ Compare the JID to another instance or to string for non-equality. """ 308 return not self.__eq__(other)
309 - def bareMatch(self, other):
310 """ Compare the node and domain parts of the JID's for equality. """ 311 return self.__str__(0) == JID(other).__str__(0)
312 - def __str__(self,wresource=1):
313 """ Serialise JID into string. """ 314 if self.node: jid=self.node+'@'+self.domain 315 else: jid=self.domain 316 if wresource and self.resource: return jid+'/'+self.resource 317 return jid
318 - def __hash__(self):
319 """ Produce hash of the JID, Allows to use JID objects as keys of the dictionary. """ 320 return hash(self.__str__())
321
322 -class Protocol(Node):
323 """ A "stanza" object class. Contains methods that are common for presences, iqs and messages. """
324 - def __init__(self, name=None, to=None, typ=None, frm=None, attrs={}, payload=[], timestamp=None, xmlns=None, node=None):
325 """ Constructor, name is the name of the stanza i.e. 'message' or 'presence' or 'iq'. 326 to is the value of 'to' attribure, 'typ' - 'type' attribute 327 frn - from attribure, attrs - other attributes mapping, payload - same meaning as for simplexml payload definition 328 timestamp - the time value that needs to be stamped over stanza 329 xmlns - namespace of top stanza node 330 node - parsed or unparsed stana to be taken as prototype. 331 """ 332 if not attrs: attrs={} 333 if to: attrs['to']=to 334 if frm: attrs['from']=frm 335 if typ: attrs['type']=typ 336 Node.__init__(self, tag=name, attrs=attrs, payload=payload, node=node) 337 if not node and xmlns: self.setNamespace(xmlns) 338 if self['to']: self.setTo(self['to']) 339 if self['from']: self.setFrom(self['from']) 340 if node and type(self)==type(node) and self.__class__==node.__class__ and self.attrs.has_key('id'): del self.attrs['id'] 341 self.timestamp=None 342 for x in self.getTags('x',namespace=NS_DELAY): 343 try: 344 if not self.getTimestamp() or x.getAttr('stamp')<self.getTimestamp(): self.setTimestamp(x.getAttr('stamp')) 345 except: pass 346 if timestamp is not None: self.setTimestamp(timestamp) # To auto-timestamp stanza just pass timestamp=''
347 - def getTo(self):
348 """ Return value of the 'to' attribute. """ 349 try: return self['to'] 350 except: return None
351 - def getFrom(self):
352 """ Return value of the 'from' attribute. """ 353 try: return self['from'] 354 except: return None
355 - def getTimestamp(self):
356 """ Return the timestamp in the 'yyyymmddThhmmss' format. """ 357 return self.timestamp
358 - def getID(self):
359 """ Return the value of the 'id' attribute. """ 360 return self.getAttr('id')
361 - def setTo(self,val):
362 """ Set the value of the 'to' attribute. """ 363 self.setAttr('to', JID(val))
364 - def getType(self):
365 """ Return the value of the 'type' attribute. """ 366 return self.getAttr('type')
367 - def setFrom(self,val):
368 """ Set the value of the 'from' attribute. """ 369 self.setAttr('from', JID(val))
370 - def setType(self,val):
371 """ Set the value of the 'type' attribute. """ 372 self.setAttr('type', val)
373 - def setID(self,val):
374 """ Set the value of the 'id' attribute. """ 375 self.setAttr('id', val)
376 - def getError(self):
377 """ Return the error-condition (if present) or the textual description of the error (otherwise). """ 378 errtag=self.getTag('error') 379 if errtag: 380 for tag in errtag.getChildren(): 381 if tag.getName()<>'text': return tag.getName() 382 return errtag.getData()
383 - def getErrorCode(self):
384 """ Return the error code. Obsolette. """ 385 return self.getTagAttr('error','code')
386 - def setError(self,error,code=None):
387 """ Set the error code. Obsolette. Use error-conditions instead. """ 388 if code: 389 if str(code) in _errorcodes.keys(): error=ErrorNode(_errorcodes[str(code)],text=error) 390 else: error=ErrorNode(ERR_UNDEFINED_CONDITION,code=code,typ='cancel',text=error) 391 elif type(error) in [type(''),type(u'')]: error=ErrorNode(error) 392 self.setType('error') 393 self.addChild(node=error)
394 - def setTimestamp(self,val=None):
395 """Set the timestamp. timestamp should be the yyyymmddThhmmss string.""" 396 if not val: val=time.strftime('%Y%m%dT%H:%M:%S', time.gmtime()) 397 self.timestamp=val 398 self.setTag('x',{'stamp':self.timestamp},namespace=NS_DELAY)
399 - def getProperties(self):
400 """ Return the list of namespaces to which belongs the direct childs of element""" 401 props=[] 402 for child in self.getChildren(): 403 prop=child.getNamespace() 404 if prop not in props: props.append(prop) 405 return props
406 - def __setitem__(self,item,val):
407 """ Set the item 'item' to the value 'val'.""" 408 if item in ['to','from']: val=JID(val) 409 return self.setAttr(item,val)
410
411 -class Message(Protocol):
412 """ XMPP Message stanza - "push" mechanism."""
413 - def __init__(self, to=None, body=None, typ=None, subject=None, attrs={}, frm=None, payload=[], timestamp=None, xmlns=NS_CLIENT, node=None):
414 """ Create message object. You can specify recipient, text of message, type of message 415 any additional attributes, sender of the message, any additional payload (f.e. jabber:x:delay element) and namespace in one go. 416 Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as message. """ 417 Protocol.__init__(self, 'message', to=to, typ=typ, attrs=attrs, frm=frm, payload=payload, timestamp=timestamp, xmlns=xmlns, node=node) 418 if body: self.setBody(body) 419 if subject: self.setSubject(subject)
420 - def getBody(self):
421 """ Returns text of the message. """ 422 return self.getTagData('body')
423 - def getSubject(self):
424 """ Returns subject of the message. """ 425 return self.getTagData('subject')
426 - def getThread(self):
427 """ Returns thread of the message. """ 428 return self.getTagData('thread')
429 - def setBody(self,val):
430 """ Sets the text of the message. """ 431 self.setTagData('body',val)
432 - def setSubject(self,val):
433 """ Sets the subject of the message. """ 434 self.setTagData('subject',val)
435 - def setThread(self,val):
436 """ Sets the thread of the message. """ 437 self.setTagData('thread',val)
438 - def buildReply(self,text=None):
439 """ Builds and returns another message object with specified text. 440 The to, from and thread properties of new message are pre-set as reply to this message. """ 441 m=Message(to=self.getFrom(),frm=self.getTo(),body=text) 442 th=self.getThread() 443 if th: m.setThread(th) 444 return m
445
446 -class Presence(Protocol):
447 """ XMPP Presence object."""
448 - def __init__(self, to=None, typ=None, priority=None, show=None, status=None, attrs={}, frm=None, timestamp=None, payload=[], xmlns=NS_CLIENT, node=None):
449 """ Create presence object. You can specify recipient, type of message, priority, show and status values 450 any additional attributes, sender of the presence, timestamp, any additional payload (f.e. jabber:x:delay element) and namespace in one go. 451 Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as presence. """ 452 Protocol.__init__(self, 'presence', to=to, typ=typ, attrs=attrs, frm=frm, payload=payload, timestamp=timestamp, xmlns=xmlns, node=node) 453 if priority: self.setPriority(priority) 454 if show: self.setShow(show) 455 if status: self.setStatus(status)
456 - def getPriority(self):
457 """ Returns the priority of the message. """ 458 return self.getTagData('priority')
459 - def getShow(self):
460 """ Returns the show value of the message. """ 461 return self.getTagData('show')
462 - def getStatus(self):
463 """ Returns the status string of the message. """ 464 return self.getTagData('status')
465 - def setPriority(self,val):
466 """ Sets the priority of the message. """ 467 self.setTagData('priority',val)
468 - def setShow(self,val):
469 """ Sets the show value of the message. """ 470 self.setTagData('show',val)
471 - def setStatus(self,val):
472 """ Sets the status string of the message. """ 473 self.setTagData('status',val)
474
475 - def _muc_getItemAttr(self,tag,attr):
476 for xtag in self.getTags('x'): 477 for child in xtag.getTags(tag): 478 return child.getAttr(attr)
479 - def _muc_getSubTagDataAttr(self,tag,attr):
480 for xtag in self.getTags('x'): 481 for child in xtag.getTags('item'): 482 for cchild in child.getTags(tag): 483 return cchild.getData(),cchild.getAttr(attr) 484 return None,None
485 - def getRole(self):
486 """Returns the presence role (for groupchat)""" 487 return self._muc_getItemAttr('item','role')
488 - def getAffiliation(self):
489 """Returns the presence affiliation (for groupchat)""" 490 return self._muc_getItemAttr('item','affiliation')
491 - def getNick(self):
492 """Returns the nick value (for nick change in groupchat)""" 493 return self._muc_getItemAttr('item','nick')
494 - def getJid(self):
495 """Returns the presence jid (for groupchat)""" 496 return self._muc_getItemAttr('item','jid')
497 - def getReason(self):
498 """Returns the reason of the presence (for groupchat)""" 499 return self._muc_getSubTagDataAttr('reason','')[0]
500 - def getActor(self):
501 """Returns the reason of the presence (for groupchat)""" 502 return self._muc_getSubTagDataAttr('actor','jid')[1]
503 - def getStatusCode(self):
504 """Returns the status code of the presence (for groupchat)""" 505 return self._muc_getItemAttr('status','code')
506
507 -class Iq(Protocol):
508 """ XMPP Iq object - get/set dialog mechanism. """
509 - def __init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns=NS_CLIENT, node=None):
510 """ Create Iq object. You can specify type, query namespace 511 any additional attributes, recipient of the iq, sender of the iq, any additional payload (f.e. jabber:x:data node) and namespace in one go. 512 Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as an iq. """ 513 Protocol.__init__(self, 'iq', to=to, typ=typ, attrs=attrs, frm=frm, xmlns=xmlns, node=node) 514 if payload: self.setQueryPayload(payload) 515 if queryNS: self.setQueryNS(queryNS)
516 - def getQueryNS(self):
517 """ Return the namespace of the 'query' child element.""" 518 tag=self.getTag('query') 519 if tag: return tag.getNamespace()
520 - def getQuerynode(self):
521 """ Return the 'node' attribute value of the 'query' child element.""" 522 return self.getTagAttr('query','node')
523 - def getQueryPayload(self):
524 """ Return the 'query' child element payload.""" 525 tag=self.getTag('query') 526 if tag: return tag.getPayload()
527 - def getQueryChildren(self):
528 """ Return the 'query' child element child nodes.""" 529 tag=self.getTag('query') 530 if tag: return tag.getChildren()
531 - def setQueryNS(self,namespace):
532 """ Set the namespace of the 'query' child element.""" 533 self.setTag('query').setNamespace(namespace)
534 - def setQueryPayload(self,payload):
535 """ Set the 'query' child element payload.""" 536 self.setTag('query').setPayload(payload)
537 - def setQuerynode(self,node):
538 """ Set the 'node' attribute value of the 'query' child element.""" 539 self.setTagAttr('query','node',node)
540 - def buildReply(self,typ):
541 """ Builds and returns another Iq object of specified type. 542 The to, from and query child node of new Iq are pre-set as reply to this Iq. """ 543 iq=Iq(typ,to=self.getFrom(),frm=self.getTo(),attrs={'id':self.getID()}) 544 if self.getTag('query'): iq.setQueryNS(self.getQueryNS()) 545 return iq
546
547 -class ErrorNode(Node):
548 """ XMPP-style error element. 549 In the case of stanza error should be attached to XMPP stanza. 550 In the case of stream-level errors should be used separately. """
551 - def __init__(self,name,code=None,typ=None,text=None):
552 """ Create new error node object. 553 Mandatory parameter: name - name of error condition. 554 Optional parameters: code, typ, text. Used for backwards compartibility with older jabber protocol.""" 555 if ERRORS.has_key(name): 556 cod,type,txt=ERRORS[name] 557 ns=name.split()[0] 558 else: cod,ns,type,txt='500',NS_STANZAS,'cancel','' 559 if typ: type=typ 560 if code: cod=code 561 if text: txt=text 562 Node.__init__(self,'error',{},[Node(name)]) 563 if type: self.setAttr('type',type) 564 if not cod: self.setName('stream:error') 565 if txt: self.addChild(node=Node(ns+' text',{},[txt])) 566 if cod: self.setAttr('code',cod)
567
568 -class Error(Protocol):
569 """ Used to quickly transform received stanza into error reply."""
570 - def __init__(self,node,error,reply=1):
571 """ Create error reply basing on the received 'node' stanza and the 'error' error condition. 572 If the 'node' is not the received stanza but locally created ('to' and 'from' fields needs not swapping) 573 specify the 'reply' argument as false.""" 574 if reply: Protocol.__init__(self,to=node.getFrom(),frm=node.getTo(),node=node) 575 else: Protocol.__init__(self,node=node) 576 self.setError(error) 577 if node.getType()=='error': self.__str__=self.__dupstr__
578 - def __dupstr__(self,dup1=None,dup2=None):
579 """ Dummy function used as preventor of creating error node in reply to error node. 580 I.e. you will not be able to serialise "double" error into string. 581 """ 582 return ''
583
584 -class DataField(Node):
585 """ This class is used in the DataForm class to describe the single data item. 586 If you are working with jabber:x:data (XEP-0004, XEP-0068, XEP-0122) 587 then you will need to work with instances of this class. """
588 - def __init__(self,name=None,value=None,typ=None,required=0,label=None,desc=None,options=[],node=None):
589 """ Create new data field of specified name,value and type. 590 Also 'required','desc' and 'options' fields can be set. 591 Alternatively other XML object can be passed in as the 'node' parameted to replicate it as a new datafiled. 592 """ 593 Node.__init__(self,'field',node=node) 594 if name: self.setVar(name) 595 if type(value) in [list,tuple]: self.setValues(value) 596 elif value: self.setValue(value) 597 if typ: self.setType(typ) 598 elif not typ and not node: self.setType('text-single') 599 if required: self.setRequired(required) 600 if label: self.setLabel(label) 601 if desc: self.setDesc(desc) 602 if options: self.setOptions(options)
603 - def setRequired(self,req=1):
604 """ Change the state of the 'required' flag. """ 605 if req: self.setTag('required') 606 else: 607 try: self.delChild('required') 608 except ValueError: return
609 - def isRequired(self):
610 """ Returns in this field a required one. """ 611 return self.getTag('required')
612 - def setLabel(self,label):
613 """ Set the label of this field. """ 614 self.setAttr('label',label)
615 - def getLabel(self):
616 """ Return the label of this field. """ 617 return self.getAttr('label')
618 - def setDesc(self,desc):
619 """ Set the description of this field. """ 620 self.setTagData('desc',desc)
621 - def getDesc(self):
622 """ Return the description of this field. """ 623 return self.getTagData('desc')
624 - def setValue(self,val):
625 """ Set the value of this field. """ 626 self.setTagData('value',val)
627 - def getValue(self):
628 return self.getTagData('value')
629 - def setValues(self,lst):
630 """ Set the values of this field as values-list. 631 Replaces all previous filed values! If you need to just add a value - use addValue method.""" 632 while self.getTag('value'): self.delChild('value') 633 for val in lst: self.addValue(val)
634 - def addValue(self,val):
635 """ Add one more value to this field. Used in 'get' iq's or such.""" 636 self.addChild('value',{},[val])
637 - def getValues(self):
638 """ Return the list of values associated with this field.""" 639 ret=[] 640 for tag in self.getTags('value'): ret.append(tag.getData()) 641 return ret
642 - def getOptions(self):
643 """ Return label-option pairs list associated with this field.""" 644 ret=[] 645 for tag in self.getTags('option'): ret.append([tag.getAttr('label'),tag.getTagData('value')]) 646 return ret
647 - def setOptions(self,lst):
648 """ Set label-option pairs list associated with this field.""" 649 while self.getTag('option'): self.delChild('option') 650 for opt in lst: self.addOption(opt)
651 - def addOption(self,opt):
652 """ Add one more label-option pair to this field.""" 653 if type(opt) in [str,unicode]: self.addChild('option').setTagData('value',opt) 654 else: self.addChild('option',{'label':opt[0]}).setTagData('value',opt[1])
655 - def getType(self):
656 """ Get type of this field. """ 657 return self.getAttr('type')
658 - def setType(self,val):
659 """ Set type of this field. """ 660 return self.setAttr('type',val)
661 - def getVar(self):
662 """ Get 'var' attribute value of this field. """ 663 return self.getAttr('var')
664 - def setVar(self,val):
665 """ Set 'var' attribute value of this field. """ 666 return self.setAttr('var',val)
667
668 -class DataForm(Node):
669 """ DataForm class. Used for manipulating dataforms in XMPP. 670 Relevant XEPs: 0004, 0068, 0122. 671 Can be used in disco, pub-sub and many other applications."""
672 - def __init__(self, typ=None, data=[], title=None, node=None):
673 """ 674 Create new dataform of type 'typ'. 'data' is the list of DataField 675 instances that this dataform contains, 'title' - the title string. 676 You can specify the 'node' argument as the other node to be used as 677 base for constructing this dataform. 678 679 title and instructions is optional and SHOULD NOT contain newlines. 680 Several instructions MAY be present. 681 'typ' can be one of ('form' | 'submit' | 'cancel' | 'result' ) 682 'typ' of reply iq can be ( 'result' | 'set' | 'set' | 'result' ) respectively. 683 'cancel' form can not contain any fields. All other forms contains AT LEAST one field. 684 'title' MAY be included in forms of type "form" and "result" 685 """ 686 Node.__init__(self,'x',node=node) 687 if node: 688 newkids=[] 689 for n in self.getChildren(): 690 if n.getName()=='field': newkids.append(DataField(node=n)) 691 else: newkids.append(n) 692 self.kids=newkids 693 if typ: self.setType(typ) 694 self.setNamespace(NS_DATA) 695 if title: self.setTitle(title) 696 if type(data)==type({}): 697 newdata=[] 698 for name in data.keys(): newdata.append(DataField(name,data[name])) 699 data=newdata 700 for child in data: 701 if type(child) in [type(''),type(u'')]: self.addInstructions(child) 702 elif child.__class__.__name__=='DataField': self.kids.append(child) 703 else: self.kids.append(DataField(node=child))
704 - def getType(self):
705 """ Return the type of dataform. """ 706 return self.getAttr('type')
707 - def setType(self,typ):
708 """ Set the type of dataform. """ 709 self.setAttr('type',typ)
710 - def getTitle(self):
711 """ Return the title of dataform. """ 712 return self.getTagData('title')
713 - def setTitle(self,text):
714 """ Set the title of dataform. """ 715 self.setTagData('title',text)
716 - def getInstructions(self):
717 """ Return the instructions of dataform. """ 718 return self.getTagData('instructions')
719 - def setInstructions(self,text):
720 """ Set the instructions of dataform. """ 721 self.setTagData('instructions',text)
722 - def addInstructions(self,text):
723 """ Add one more instruction to the dataform. """ 724 self.addChild('instructions',{},[text])
725 - def getField(self,name):
726 """ Return the datafield object with name 'name' (if exists). """ 727 return self.getTag('field',attrs={'var':name})
728 - def setField(self,name):
729 """ Create if nessessary or get the existing datafield object with name 'name' and return it. """ 730 f=self.getField(name) 731 if f: return f 732 return self.addChild(node=DataField(name))
733 - def asDict(self):
734 """ Represent dataform as simple dictionary mapping of datafield names to their values.""" 735 ret={} 736 for field in self.getTags('field'): 737 name=field.getAttr('var') 738 typ=field.getType() 739 if isinstance(typ,(str,unicode)) and typ[-6:]=='-multi': 740 val=[] 741 for i in field.getTags('value'): val.append(i.getData()) 742 else: val=field.getTagData('value') 743 ret[name]=val 744 if self.getTag('instructions'): ret['instructions']=self.getInstructions() 745 return ret
746 - def __getitem__(self,name):
747 """ Simple dictionary interface for getting datafields values by their names.""" 748 item=self.getField(name) 749 if item: return item.getValue() 750 raise IndexError('No such field')
751 - def __setitem__(self,name,val):
752 """ Simple dictionary interface for setting datafields values by their names.""" 753 return self.setField(name).setValue(val)
754

xmpppy-0.4.1/doc/apidocs/xmpp.auth-pysrc.html0000644000175000000500000050421210731034075020047 0ustar normansrc xmpp.auth
Package xmpp :: Module auth
[hide private]
[frames] | no frames]

Source Code for Module xmpp.auth

  1  ##   auth.py 
  2  ## 
  3  ##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: auth.py,v 1.38 2007/08/28 10:03:33 normanr Exp $ 
 16   
 17  """ 
 18  Provides library with all Non-SASL and SASL authentication mechanisms. 
 19  Can be used both for client and transport authentication. 
 20  """ 
 21   
 22  from protocol import * 
 23  from client import PlugIn 
 24  import sha,base64,random,dispatcher,re 
 25   
 26  import md5 
27 -def HH(some): return md5.new(some).hexdigest()
28 -def H(some): return md5.new(some).digest()
29 -def C(some): return ':'.join(some)
30
31 -class NonSASL(PlugIn):
32 """ Implements old Non-SASL (JEP-0078) authentication used in jabberd1.4 and transport authentication."""
33 - def __init__(self,user,password,resource):
34 """ Caches username, password and resource for auth. """ 35 PlugIn.__init__(self) 36 self.DBG_LINE='gen_auth' 37 self.user=user 38 self.password=password 39 self.resource=resource
40
41 - def plugin(self,owner):
42 """ Determine the best auth method (digest/0k/plain) and use it for auth. 43 Returns used method name on success. Used internally. """ 44 if not self.resource: return self.authComponent(owner) 45 self.DEBUG('Querying server about possible auth methods','start') 46 resp=owner.Dispatcher.SendAndWaitForResponse(Iq('get',NS_AUTH,payload=[Node('username',payload=[self.user])])) 47 if not isResultNode(resp): 48 self.DEBUG('No result node arrived! Aborting...','error') 49 return 50 iq=Iq(typ='set',node=resp) 51 query=iq.getTag('query') 52 query.setTagData('username',self.user) 53 query.setTagData('resource',self.resource) 54 55 if query.getTag('digest'): 56 self.DEBUG("Performing digest authentication",'ok') 57 query.setTagData('digest',sha.new(owner.Dispatcher.Stream._document_attrs['id']+self.password).hexdigest()) 58 if query.getTag('password'): query.delChild('password') 59 method='digest' 60 elif query.getTag('token'): 61 token=query.getTagData('token') 62 seq=query.getTagData('sequence') 63 self.DEBUG("Performing zero-k authentication",'ok') 64 hash = sha.new(sha.new(self.password).hexdigest()+token).hexdigest() 65 for foo in xrange(int(seq)): hash = sha.new(hash).hexdigest() 66 query.setTagData('hash',hash) 67 method='0k' 68 else: 69 self.DEBUG("Sequre methods unsupported, performing plain text authentication",'warn') 70 query.setTagData('password',self.password) 71 method='plain' 72 resp=owner.Dispatcher.SendAndWaitForResponse(iq) 73 if isResultNode(resp): 74 self.DEBUG('Sucessfully authenticated with remove host.','ok') 75 owner.User=self.user 76 owner.Resource=self.resource 77 owner._registered_name=owner.User+'@'+owner.Server+'/'+owner.Resource 78 return method 79 self.DEBUG('Authentication failed!','error')
80
81 - def authComponent(self,owner):
82 """ Authenticate component. Send handshake stanza and wait for result. Returns "ok" on success. """ 83 self.handshake=0 84 owner.send(Node(NS_COMPONENT_ACCEPT+' handshake',payload=[sha.new(owner.Dispatcher.Stream._document_attrs['id']+self.password).hexdigest()])) 85 owner.RegisterHandler('handshake',self.handshakeHandler,xmlns=NS_COMPONENT_ACCEPT) 86 while not self.handshake: 87 self.DEBUG("waiting on handshake",'notify') 88 owner.Process(1) 89 owner._registered_name=self.user 90 if self.handshake+1: return 'ok'
91
92 - def handshakeHandler(self,disp,stanza):
93 """ Handler for registering in dispatcher for accepting transport authentication. """ 94 if stanza.getName()=='handshake': self.handshake=1 95 else: self.handshake=-1
96
97 -class SASL(PlugIn):
98 """ Implements SASL authentication. """
99 - def __init__(self,username,password):
100 PlugIn.__init__(self) 101 self.username=username 102 self.password=password
103
104 - def plugin(self,owner):
105 if not self._owner.Dispatcher.Stream._document_attrs.has_key('version'): self.startsasl='not-supported' 106 elif self._owner.Dispatcher.Stream.features: 107 try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) 108 except NodeProcessed: pass 109 else: self.startsasl=None
110
111 - def auth(self):
112 """ Start authentication. Result can be obtained via "SASL.startsasl" attribute and will be 113 either "success" or "failure". Note that successfull auth will take at least 114 two Dispatcher.Process() calls. """ 115 if self.startsasl: pass 116 elif self._owner.Dispatcher.Stream.features: 117 try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) 118 except NodeProcessed: pass 119 else: self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS)
120
121 - def plugout(self):
122 """ Remove SASL handlers from owner's dispatcher. Used internally. """ 123 if self._owner.__dict__.has_key('features'): self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) 124 if self._owner.__dict__.has_key('challenge'): self._owner.UnregisterHandler('challenge',self.SASLHandler,xmlns=NS_SASL) 125 if self._owner.__dict__.has_key('failure'): self._owner.UnregisterHandler('failure',self.SASLHandler,xmlns=NS_SASL) 126 if self._owner.__dict__.has_key('success'): self._owner.UnregisterHandler('success',self.SASLHandler,xmlns=NS_SASL)
127
128 - def FeaturesHandler(self,conn,feats):
129 """ Used to determine if server supports SASL auth. Used internally. """ 130 if not feats.getTag('mechanisms',namespace=NS_SASL): 131 self.startsasl='not-supported' 132 self.DEBUG('SASL not supported by server','error') 133 return 134 mecs=[] 135 for mec in feats.getTag('mechanisms',namespace=NS_SASL).getTags('mechanism'): 136 mecs.append(mec.getData()) 137 self._owner.RegisterHandler('challenge',self.SASLHandler,xmlns=NS_SASL) 138 self._owner.RegisterHandler('failure',self.SASLHandler,xmlns=NS_SASL) 139 self._owner.RegisterHandler('success',self.SASLHandler,xmlns=NS_SASL) 140 if "DIGEST-MD5" in mecs: 141 node=Node('auth',attrs={'xmlns':NS_SASL,'mechanism':'DIGEST-MD5'}) 142 elif "PLAIN" in mecs: 143 sasl_data='%s\x00%s\x00%s'%(self.username+'@'+self._owner.Server,self.username,self.password) 144 node=Node('auth',attrs={'xmlns':NS_SASL,'mechanism':'PLAIN'},payload=[base64.encodestring(sasl_data)]) 145 else: 146 self.startsasl='failure' 147 self.DEBUG('I can only use DIGEST-MD5 and PLAIN mecanisms.','error') 148 return 149 self.startsasl='in-process' 150 self._owner.send(node.__str__()) 151 raise NodeProcessed
152
153 - def SASLHandler(self,conn,challenge):
154 """ Perform next SASL auth step. Used internally. """ 155 if challenge.getNamespace()<>NS_SASL: return 156 if challenge.getName()=='failure': 157 self.startsasl='failure' 158 try: reason=challenge.getChildren()[0] 159 except: reason=challenge 160 self.DEBUG('Failed SASL authentification: %s'%reason,'error') 161 raise NodeProcessed 162 elif challenge.getName()=='success': 163 self.startsasl='success' 164 self.DEBUG('Successfully authenticated with remote server.','ok') 165 handlers=self._owner.Dispatcher.dumpHandlers() 166 self._owner.Dispatcher.PlugOut() 167 dispatcher.Dispatcher().PlugIn(self._owner) 168 self._owner.Dispatcher.restoreHandlers(handlers) 169 self._owner.User=self.username 170 raise NodeProcessed 171 ########################################3333 172 incoming_data=challenge.getData() 173 chal={} 174 data=base64.decodestring(incoming_data) 175 self.DEBUG('Got challenge:'+data,'ok') 176 for pair in re.findall('(\w+=(?:"[^"]+")|(?:[^,]+))',data): 177 key,value=pair.split('=', 1) 178 if value[:1]=='"' and value[-1:]=='"': value=value[1:-1] 179 chal[key]=value 180 if chal.has_key('qop') and 'auth' in chal['qop'].split(','): 181 resp={} 182 resp['username']=self.username 183 resp['realm']=self._owner.Server 184 resp['nonce']=chal['nonce'] 185 cnonce='' 186 for i in range(7): 187 cnonce+=hex(int(random.random()*65536*4096))[2:] 188 resp['cnonce']=cnonce 189 resp['nc']=('00000001') 190 resp['qop']='auth' 191 resp['digest-uri']='xmpp/'+self._owner.Server 192 A1=C([H(C([resp['username'],resp['realm'],self.password])),resp['nonce'],resp['cnonce']]) 193 A2=C(['AUTHENTICATE',resp['digest-uri']]) 194 response= HH(C([HH(A1),resp['nonce'],resp['nc'],resp['cnonce'],resp['qop'],HH(A2)])) 195 resp['response']=response 196 resp['charset']='utf-8' 197 sasl_data='' 198 for key in ['charset','username','realm','nonce','nc','cnonce','digest-uri','response','qop']: 199 if key in ['nc','qop','response','charset']: sasl_data+="%s=%s,"%(key,resp[key]) 200 else: sasl_data+='%s="%s",'%(key,resp[key]) 201 ########################################3333 202 node=Node('response',attrs={'xmlns':NS_SASL},payload=[base64.encodestring(sasl_data[:-1]).replace('\r','').replace('\n','')]) 203 self._owner.send(node.__str__()) 204 elif chal.has_key('rspauth'): self._owner.send(Node('response',attrs={'xmlns':NS_SASL}).__str__()) 205 else: 206 self.startsasl='failure' 207 self.DEBUG('Failed SASL authentification: unknown challenge','error') 208 raise NodeProcessed
209
210 -class Bind(PlugIn):
211 """ Bind some JID to the current connection to allow router know of our location."""
212 - def __init__(self):
213 PlugIn.__init__(self) 214 self.DBG_LINE='bind' 215 self.bound=None
216
217 - def plugin(self,owner):
218 """ Start resource binding, if allowed at this time. Used internally. """ 219 if self._owner.Dispatcher.Stream.features: 220 try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) 221 except NodeProcessed: pass 222 else: self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS)
223
224 - def plugout(self):
225 """ Remove Bind handler from owner's dispatcher. Used internally. """ 226 self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS)
227
228 - def FeaturesHandler(self,conn,feats):
229 """ Determine if server supports resource binding and set some internal attributes accordingly. """ 230 if not feats.getTag('bind',namespace=NS_BIND): 231 self.bound='failure' 232 self.DEBUG('Server does not requested binding.','error') 233 return 234 if feats.getTag('session',namespace=NS_SESSION): self.session=1 235 else: self.session=-1 236 self.bound=[]
237
238 - def Bind(self,resource=None):
239 """ Perform binding. Use provided resource name or random (if not provided). """ 240 while self.bound is None and self._owner.Process(1): pass 241 if resource: resource=[Node('resource',payload=[resource])] 242 else: resource=[] 243 resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('bind',attrs={'xmlns':NS_BIND},payload=resource)])) 244 if isResultNode(resp): 245 self.bound.append(resp.getTag('bind').getTagData('jid')) 246 self.DEBUG('Successfully bound %s.'%self.bound[-1],'ok') 247 jid=JID(resp.getTag('bind').getTagData('jid')) 248 self._owner.User=jid.getNode() 249 self._owner.Resource=jid.getResource() 250 resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('session',attrs={'xmlns':NS_SESSION})])) 251 if isResultNode(resp): 252 self.DEBUG('Successfully opened session.','ok') 253 self.session=1 254 return 'ok' 255 else: 256 self.DEBUG('Session open failed.','error') 257 self.session=0 258 elif resp: self.DEBUG('Binding failed: %s.'%resp.getTag('error'),'error') 259 else: 260 self.DEBUG('Binding failed: timeout expired.','error') 261 return ''
262
263 -class ComponentBind(PlugIn):
264 """ ComponentBind some JID to the current connection to allow router know of our location."""
265 - def __init__(self, sasl):
266 PlugIn.__init__(self) 267 self.DBG_LINE='bind' 268 self.bound=None 269 self.needsUnregister=None 270 self.sasl = sasl
271
272 - def plugin(self,owner):
273 """ Start resource binding, if allowed at this time. Used internally. """ 274 if not self.sasl: 275 self.bound=[] 276 return 277 if self._owner.Dispatcher.Stream.features: 278 try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) 279 except NodeProcessed: pass 280 else: 281 self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) 282 self.needsUnregister=1
283
284 - def plugout(self):
285 """ Remove ComponentBind handler from owner's dispatcher. Used internally. """ 286 if self.needsUnregister: 287 self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS)
288
289 - def FeaturesHandler(self,conn,feats):
290 """ Determine if server supports resource binding and set some internal attributes accordingly. """ 291 if not feats.getTag('bind',namespace=NS_BIND): 292 self.bound='failure' 293 self.DEBUG('Server does not requested binding.','error') 294 return 295 if feats.getTag('session',namespace=NS_SESSION): self.session=1 296 else: self.session=-1 297 self.bound=[]
298
299 - def Bind(self,domain=None):
300 """ Perform binding. Use provided domain name (if not provided). """ 301 while self.bound is None and self._owner.Process(1): pass 302 if self.sasl: 303 xmlns = NS_COMPONENT_1 304 else: 305 xmlns = None 306 self.bindresponse = None 307 ttl = dispatcher.DefaultTimeout 308 self._owner.RegisterHandler('bind',self.BindHandler,xmlns=xmlns) 309 self._owner.send(Protocol('bind',attrs={'name':domain},xmlns=NS_COMPONENT_1)) 310 while self.bindresponse is None and self._owner.Process(1) and ttl > 0: ttl-=1 311 self._owner.UnregisterHandler('bind',self.BindHandler,xmlns=xmlns) 312 resp=self.bindresponse 313 if resp and resp.getAttr('error'): 314 self.DEBUG('Binding failed: %s.'%resp.getAttr('error'),'error') 315 elif resp: 316 self.DEBUG('Successfully bound.','ok') 317 return 'ok' 318 else: 319 self.DEBUG('Binding failed: timeout expired.','error') 320 return ''
321
322 - def BindHandler(self,conn,bind):
323 self.bindresponse = bind 324 pass
325

xmpppy-0.4.1/doc/apidocs/xmpp.features-pysrc.html0000644000175000000500000024200610731034075020724 0ustar normansrc xmpp.features
Package xmpp :: Module features
[hide private]
[frames] | no frames]

Source Code for Module xmpp.features

  1  ##   features.py  
  2  ## 
  3  ##   Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov 
  4  ## 
  5  ##   This program is free software; you can redistribute it and/or modify 
  6  ##   it under the terms of the GNU General Public License as published by 
  7  ##   the Free Software Foundation; either version 2, or (at your option) 
  8  ##   any later version. 
  9  ## 
 10  ##   This program is distributed in the hope that it will be useful, 
 11  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 12  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 13  ##   GNU General Public License for more details. 
 14   
 15  # $Id: features.py,v 1.24 2006/03/25 05:47:22 snakeru Exp $ 
 16   
 17  """ 
 18  This module contains variable stuff that is not worth splitting into separate modules. 
 19  Here is: 
 20      DISCO client and agents-to-DISCO and browse-to-DISCO emulators. 
 21      IBR and password manager. 
 22      jabber:iq:privacy methods 
 23  All these methods takes 'disp' first argument that should be already connected 
 24  (and in most cases already authorised) dispatcher instance. 
 25  """ 
 26   
 27  from protocol import * 
 28   
 29  REGISTER_DATA_RECEIVED='REGISTER DATA RECEIVED' 
 30   
 31  ### DISCO ### http://jabber.org/protocol/disco ### JEP-0030 #################### 
 32  ### Browse ### jabber:iq:browse ### JEP-0030 ################################### 
 33  ### Agents ### jabber:iq:agents ### JEP-0030 ################################### 
34 -def _discover(disp,ns,jid,node=None,fb2b=0,fb2a=1):
35 """ Try to obtain info from the remote object. 36 If remote object doesn't support disco fall back to browse (if fb2b is true) 37 and if it doesnt support browse (or fb2b is not true) fall back to agents protocol 38 (if gb2a is true). Returns obtained info. Used internally. """ 39 iq=Iq(to=jid,typ='get',queryNS=ns) 40 if node: iq.setQuerynode(node) 41 rep=disp.SendAndWaitForResponse(iq) 42 if fb2b and not isResultNode(rep): rep=disp.SendAndWaitForResponse(Iq(to=jid,typ='get',queryNS=NS_BROWSE)) # Fallback to browse 43 if fb2a and not isResultNode(rep): rep=disp.SendAndWaitForResponse(Iq(to=jid,typ='get',queryNS=NS_AGENTS)) # Fallback to agents 44 if isResultNode(rep): return rep.getQueryPayload() 45 return []
46
47 -def discoverItems(disp,jid,node=None):
48 """ Query remote object about any items that it contains. Return items list. """ 49 """ According to JEP-0030: 50 query MAY have node attribute 51 item: MUST HAVE jid attribute and MAY HAVE name, node, action attributes. 52 action attribute of item can be either of remove or update value.""" 53 ret=[] 54 for i in _discover(disp,NS_DISCO_ITEMS,jid,node): 55 if i.getName()=='agent' and i.getTag('name'): i.setAttr('name',i.getTagData('name')) 56 ret.append(i.attrs) 57 return ret
58
59 -def discoverInfo(disp,jid,node=None):
60 """ Query remote object about info that it publishes. Returns identities and features lists.""" 61 """ According to JEP-0030: 62 query MAY have node attribute 63 identity: MUST HAVE category and name attributes and MAY HAVE type attribute. 64 feature: MUST HAVE var attribute""" 65 identities , features = [] , [] 66 for i in _discover(disp,NS_DISCO_INFO,jid,node): 67 if i.getName()=='identity': identities.append(i.attrs) 68 elif i.getName()=='feature': features.append(i.getAttr('var')) 69 elif i.getName()=='agent': 70 if i.getTag('name'): i.setAttr('name',i.getTagData('name')) 71 if i.getTag('description'): i.setAttr('name',i.getTagData('description')) 72 identities.append(i.attrs) 73 if i.getTag('groupchat'): features.append(NS_GROUPCHAT) 74 if i.getTag('register'): features.append(NS_REGISTER) 75 if i.getTag('search'): features.append(NS_SEARCH) 76 return identities , features
77 78 ### Registration ### jabber:iq:register ### JEP-0077 ###########################
79 -def getRegInfo(disp,host,info={},sync=True):
80 """ Gets registration form from remote host. 81 You can pre-fill the info dictionary. 82 F.e. if you are requesting info on registering user joey than specify 83 info as {'username':'joey'}. See JEP-0077 for details. 84 'disp' must be connected dispatcher instance.""" 85 iq=Iq('get',NS_REGISTER,to=host) 86 for i in info.keys(): iq.setTagData(i,info[i]) 87 if sync: 88 resp=disp.SendAndWaitForResponse(iq) 89 _ReceivedRegInfo(disp.Dispatcher,resp, host) 90 return resp 91 else: disp.SendAndCallForResponse(iq,_ReceivedRegInfo, {'agent': host})
92
93 -def _ReceivedRegInfo(con, resp, agent):
94 iq=Iq('get',NS_REGISTER,to=agent) 95 if not isResultNode(resp): return 96 df=resp.getTag('query',namespace=NS_REGISTER).getTag('x',namespace=NS_DATA) 97 if df: 98 con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent, DataForm(node=df))) 99 return 100 df=DataForm(typ='form') 101 for i in resp.getQueryPayload(): 102 if type(i)<>type(iq): pass 103 elif i.getName()=='instructions': df.addInstructions(i.getData()) 104 else: df.setField(i.getName()).setValue(i.getData()) 105 con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent, df))
106
107 -def register(disp,host,info):
108 """ Perform registration on remote server with provided info. 109 disp must be connected dispatcher instance. 110 Returns true or false depending on registration result. 111 If registration fails you can get additional info from the dispatcher's owner 112 attributes lastErrNode, lastErr and lastErrCode. 113 """ 114 iq=Iq('set',NS_REGISTER,to=host) 115 if type(info)<>type({}): info=info.asDict() 116 for i in info.keys(): iq.setTag('query').setTagData(i,info[i]) 117 resp=disp.SendAndWaitForResponse(iq) 118 if isResultNode(resp): return 1
119
120 -def unregister(disp,host):
121 """ Unregisters with host (permanently removes account). 122 disp must be connected and authorized dispatcher instance. 123 Returns true on success.""" 124 resp=disp.SendAndWaitForResponse(Iq('set',NS_REGISTER,to=host,payload=[Node('remove')])) 125 if isResultNode(resp): return 1
126
127 -def changePasswordTo(disp,newpassword,host=None):
128 """ Changes password on specified or current (if not specified) server. 129 disp must be connected and authorized dispatcher instance. 130 Returns true on success.""" 131 if not host: host=disp._owner.Server 132 resp=disp.SendAndWaitForResponse(Iq('set',NS_REGISTER,to=host,payload=[Node('username',payload=[disp._owner.Server]),Node('password',payload=[newpassword])])) 133 if isResultNode(resp): return 1
134 135 ### Privacy ### jabber:iq:privacy ### draft-ietf-xmpp-im-19 #################### 136 #type=[jid|group|subscription] 137 #action=[allow|deny] 138
139 -def getPrivacyLists(disp):
140 """ Requests privacy lists from connected server. 141 Returns dictionary of existing lists on success.""" 142 try: 143 dict={'lists':[]} 144 resp=disp.SendAndWaitForResponse(Iq('get',NS_PRIVACY)) 145 if not isResultNode(resp): return 146 for list in resp.getQueryPayload(): 147 if list.getName()=='list': dict['lists'].append(list.getAttr('name')) 148 else: dict[list.getName()]=list.getAttr('name') 149 return dict 150 except: pass
151
152 -def getPrivacyList(disp,listname):
153 """ Requests specific privacy list listname. Returns list of XML nodes (rules) 154 taken from the server responce.""" 155 try: 156 resp=disp.SendAndWaitForResponse(Iq('get',NS_PRIVACY,payload=[Node('list',{'name':listname})])) 157 if isResultNode(resp): return resp.getQueryPayload()[0] 158 except: pass
159
160 -def setActivePrivacyList(disp,listname=None,typ='active'):
161 """ Switches privacy list 'listname' to specified type. 162 By default the type is 'active'. Returns true on success.""" 163 if listname: attrs={'name':listname} 164 else: attrs={} 165 resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[Node(typ,attrs)])) 166 if isResultNode(resp): return 1
167
168 -def setDefaultPrivacyList(disp,listname=None):
169 """ Sets the default privacy list as 'listname'. Returns true on success.""" 170 return setActivePrivacyList(disp,listname,'default')
171
172 -def setPrivacyList(disp,list):
173 """ Set the ruleset. 'list' should be the simpleXML node formatted 174 according to RFC 3921 (XMPP-IM) (I.e. Node('list',{'name':listname},payload=[...]) ) 175 Returns true on success.""" 176 resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[list])) 177 if isResultNode(resp): return 1
178
179 -def delPrivacyList(disp,listname):
180 """ Deletes privacy list 'listname'. Returns true on success.""" 181 resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[Node('list',{'name':listname})])) 182 if isResultNode(resp): return 1
183

xmpppy-0.4.1/doc/apidocs/redirect.html0000644000175000000500000000603110731034075016562 0ustar normansrcEpydoc Redirect Page

Epydoc Auto-redirect page

When javascript is enabled, this page will redirect URLs of the form redirect.html#dotted.name to the documentation for the object with the given fully-qualified dotted name.

 

xmpppy-0.4.1/doc/apidocs/api-objects.txt0000644000175000000500000036356510731034076017057 0ustar normansrcxmpp xmpp-module.html xmpp.STREAM_NOT_AUTHORIZED xmpp-module.html#STREAM_NOT_AUTHORIZED xmpp.STREAM_CONNECTION_TIMEOUT xmpp-module.html#STREAM_CONNECTION_TIMEOUT xmpp.STREAM_IMPROPER_ADDRESSING xmpp-module.html#STREAM_IMPROPER_ADDRESSING xmpp.ERR_GONE xmpp-module.html#ERR_GONE xmpp.ERR_NOT_AUTHORIZED xmpp-module.html#ERR_NOT_AUTHORIZED xmpp.ERR_REGISTRATION_REQUIRED xmpp-module.html#ERR_REGISTRATION_REQUIRED xmpp.ERR_INTERNAL_SERVER_ERROR xmpp-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.SASL_INCORRECT_ENCODING xmpp-module.html#SASL_INCORRECT_ENCODING xmpp.STREAM_UNSUPPORTED_ENCODING xmpp-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.ERR_REDIRECT xmpp-module.html#ERR_REDIRECT xmpp.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.ERR_FEATURE_NOT_IMPLEMENTED xmpp-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.name xmpp-module.html#name xmpp.ERR_RESOURCE_CONSTRAINT xmpp-module.html#ERR_RESOURCE_CONSTRAINT xmpp.SASL_INVALID_AUTHZID xmpp-module.html#SASL_INVALID_AUTHZID xmpp.ERR_JID_MALFORMED xmpp-module.html#ERR_JID_MALFORMED xmpp.STREAM_UNSUPPORTED_VERSION xmpp-module.html#STREAM_UNSUPPORTED_VERSION xmpp.STREAM_CONFLICT xmpp-module.html#STREAM_CONFLICT xmpp.isResultNode xmpp.protocol-module.html#isResultNode xmpp.ERR_SERVICE_UNAVAILABLE xmpp-module.html#ERR_SERVICE_UNAVAILABLE xmpp.STREAM_UNDEFINED_CONDITION xmpp-module.html#STREAM_UNDEFINED_CONDITION xmpp.ERRORS xmpp-module.html#ERRORS xmpp.STREAM_BAD_FORMAT xmpp-module.html#STREAM_BAD_FORMAT xmpp.SASL_ABORTED xmpp-module.html#SASL_ABORTED xmpp.STREAM_HOST_GONE xmpp-module.html#STREAM_HOST_GONE xmpp.ERR_UNDEFINED_CONDITION xmpp-module.html#ERR_UNDEFINED_CONDITION xmpp.STREAM_INVALID_FROM xmpp-module.html#STREAM_INVALID_FROM xmpp.ERR_REMOTE_SERVER_TIMEOUT xmpp-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.ERR_CONFLICT xmpp-module.html#ERR_CONFLICT xmpp.STREAM_SYSTEM_SHUTDOWN xmpp-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.STREAM_INVALID_NAMESPACE xmpp-module.html#STREAM_INVALID_NAMESPACE xmpp.SASL_NOT_AUTHORIZED xmpp-module.html#SASL_NOT_AUTHORIZED xmpp.ERR_REMOTE_SERVER_NOT_FOUND xmpp-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.ERR_SUBSCRIPTION_REQUIRED xmpp-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.STREAM_INTERNAL_SERVER_ERROR xmpp-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.STREAM_INVALID_XML xmpp-module.html#STREAM_INVALID_XML xmpp.ERR_NOT_ALLOWED xmpp-module.html#ERR_NOT_ALLOWED xmpp.STREAM_HOST_UNKNOWN xmpp-module.html#STREAM_HOST_UNKNOWN xmpp.ERR_BAD_REQUEST xmpp-module.html#ERR_BAD_REQUEST xmpp.SASL_MECHANISM_TOO_WEAK xmpp-module.html#SASL_MECHANISM_TOO_WEAK xmpp.STREAM_XML_NOT_WELL_FORMED xmpp-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.STREAM_POLICY_VIOLATION xmpp-module.html#STREAM_POLICY_VIOLATION xmpp.STREAM_SEE_OTHER_HOST xmpp-module.html#STREAM_SEE_OTHER_HOST xmpp.STREAM_BAD_NAMESPACE_PREFIX xmpp-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.SASL_INVALID_MECHANISM xmpp-module.html#SASL_INVALID_MECHANISM xmpp.ERR_UNEXPECTED_REQUEST xmpp-module.html#ERR_UNEXPECTED_REQUEST xmpp.ERR_RECIPIENT_UNAVAILABLE xmpp-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.SASL_TEMPORARY_AUTH_FAILURE xmpp-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.ERR_PAYMENT_REQUIRED xmpp-module.html#ERR_PAYMENT_REQUIRED xmpp.STREAM_RESTRICTED_XML xmpp-module.html#STREAM_RESTRICTED_XML xmpp.STREAM_RESOURCE_CONSTRAINT xmpp-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.ERR_ITEM_NOT_FOUND xmpp-module.html#ERR_ITEM_NOT_FOUND xmpp.STREAM_REMOTE_CONNECTION_FAILED xmpp-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.STREAM_INVALID_ID xmpp-module.html#STREAM_INVALID_ID xmpp.ustr xmpp.simplexml-module.html#ustr xmpp.ERR_NOT_ACCEPTABLE xmpp-module.html#ERR_NOT_ACCEPTABLE xmpp.STREAM_UNSUPPORTED_STANZA_TYPE xmpp-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.ERR_FORBIDDEN xmpp-module.html#ERR_FORBIDDEN xmpp.auth xmpp.auth-module.html xmpp.auth.STREAM_NOT_AUTHORIZED xmpp.auth-module.html#STREAM_NOT_AUTHORIZED xmpp.auth.STREAM_CONNECTION_TIMEOUT xmpp.auth-module.html#STREAM_CONNECTION_TIMEOUT xmpp.auth.STREAM_IMPROPER_ADDRESSING xmpp.auth-module.html#STREAM_IMPROPER_ADDRESSING xmpp.auth.ERR_GONE xmpp.auth-module.html#ERR_GONE xmpp.auth.ERR_CONFLICT xmpp.auth-module.html#ERR_CONFLICT xmpp.auth.ERR_NOT_AUTHORIZED xmpp.auth-module.html#ERR_NOT_AUTHORIZED xmpp.auth.ERR_REGISTRATION_REQUIRED xmpp.auth-module.html#ERR_REGISTRATION_REQUIRED xmpp.auth.ERR_INTERNAL_SERVER_ERROR xmpp.auth-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.auth.SASL_INCORRECT_ENCODING xmpp.auth-module.html#SASL_INCORRECT_ENCODING xmpp.auth.H xmpp.auth-module.html#H xmpp.auth.STREAM_UNSUPPORTED_ENCODING xmpp.auth-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.auth.ERR_REDIRECT xmpp.auth-module.html#ERR_REDIRECT xmpp.auth.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.auth.ERR_FEATURE_NOT_IMPLEMENTED xmpp.auth-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.auth.name xmpp.auth-module.html#name xmpp.auth.ERR_RESOURCE_CONSTRAINT xmpp.auth-module.html#ERR_RESOURCE_CONSTRAINT xmpp.auth.SASL_INVALID_AUTHZID xmpp.auth-module.html#SASL_INVALID_AUTHZID xmpp.auth.ERR_JID_MALFORMED xmpp.auth-module.html#ERR_JID_MALFORMED xmpp.auth.STREAM_CONFLICT xmpp.auth-module.html#STREAM_CONFLICT xmpp.auth.isResultNode xmpp.protocol-module.html#isResultNode xmpp.auth.HH xmpp.auth-module.html#HH xmpp.auth.ERR_SERVICE_UNAVAILABLE xmpp.auth-module.html#ERR_SERVICE_UNAVAILABLE xmpp.auth.STREAM_UNDEFINED_CONDITION xmpp.auth-module.html#STREAM_UNDEFINED_CONDITION xmpp.auth.ERRORS xmpp.auth-module.html#ERRORS xmpp.auth.STREAM_INVALID_NAMESPACE xmpp.auth-module.html#STREAM_INVALID_NAMESPACE xmpp.auth.STREAM_BAD_FORMAT xmpp.auth-module.html#STREAM_BAD_FORMAT xmpp.auth.SASL_ABORTED xmpp.auth-module.html#SASL_ABORTED xmpp.auth.STREAM_HOST_GONE xmpp.auth-module.html#STREAM_HOST_GONE xmpp.auth.C xmpp.auth-module.html#C xmpp.auth.ERR_UNDEFINED_CONDITION xmpp.auth-module.html#ERR_UNDEFINED_CONDITION xmpp.auth.STREAM_INVALID_FROM xmpp.auth-module.html#STREAM_INVALID_FROM xmpp.auth.ERR_REMOTE_SERVER_TIMEOUT xmpp.auth-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.auth.STREAM_SYSTEM_SHUTDOWN xmpp.auth-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.auth.STREAM_UNSUPPORTED_VERSION xmpp.auth-module.html#STREAM_UNSUPPORTED_VERSION xmpp.auth.SASL_NOT_AUTHORIZED xmpp.auth-module.html#SASL_NOT_AUTHORIZED xmpp.auth.ERR_REMOTE_SERVER_NOT_FOUND xmpp.auth-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.auth.ERR_SUBSCRIPTION_REQUIRED xmpp.auth-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.auth.STREAM_INTERNAL_SERVER_ERROR xmpp.auth-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.auth.STREAM_INVALID_XML xmpp.auth-module.html#STREAM_INVALID_XML xmpp.auth.ERR_NOT_ALLOWED xmpp.auth-module.html#ERR_NOT_ALLOWED xmpp.auth.STREAM_HOST_UNKNOWN xmpp.auth-module.html#STREAM_HOST_UNKNOWN xmpp.auth.ERR_BAD_REQUEST xmpp.auth-module.html#ERR_BAD_REQUEST xmpp.auth.SASL_MECHANISM_TOO_WEAK xmpp.auth-module.html#SASL_MECHANISM_TOO_WEAK xmpp.auth.STREAM_XML_NOT_WELL_FORMED xmpp.auth-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.auth.STREAM_POLICY_VIOLATION xmpp.auth-module.html#STREAM_POLICY_VIOLATION xmpp.auth.STREAM_SEE_OTHER_HOST xmpp.auth-module.html#STREAM_SEE_OTHER_HOST xmpp.auth.STREAM_BAD_NAMESPACE_PREFIX xmpp.auth-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.auth.SASL_INVALID_MECHANISM xmpp.auth-module.html#SASL_INVALID_MECHANISM xmpp.auth.ERR_UNEXPECTED_REQUEST xmpp.auth-module.html#ERR_UNEXPECTED_REQUEST xmpp.auth.ERR_RECIPIENT_UNAVAILABLE xmpp.auth-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.auth.SASL_TEMPORARY_AUTH_FAILURE xmpp.auth-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.auth.ERR_PAYMENT_REQUIRED xmpp.auth-module.html#ERR_PAYMENT_REQUIRED xmpp.auth.STREAM_RESTRICTED_XML xmpp.auth-module.html#STREAM_RESTRICTED_XML xmpp.auth.STREAM_RESOURCE_CONSTRAINT xmpp.auth-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.auth.ERR_ITEM_NOT_FOUND xmpp.auth-module.html#ERR_ITEM_NOT_FOUND xmpp.auth.STREAM_REMOTE_CONNECTION_FAILED xmpp.auth-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.auth.STREAM_INVALID_ID xmpp.auth-module.html#STREAM_INVALID_ID xmpp.auth.ustr xmpp.simplexml-module.html#ustr xmpp.auth.ERR_NOT_ACCEPTABLE xmpp.auth-module.html#ERR_NOT_ACCEPTABLE xmpp.auth.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.auth-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.auth.ERR_FORBIDDEN xmpp.auth-module.html#ERR_FORBIDDEN xmpp.browser xmpp.browser-module.html xmpp.browser.STREAM_NOT_AUTHORIZED xmpp.browser-module.html#STREAM_NOT_AUTHORIZED xmpp.browser.STREAM_CONNECTION_TIMEOUT xmpp.browser-module.html#STREAM_CONNECTION_TIMEOUT xmpp.browser.STREAM_IMPROPER_ADDRESSING xmpp.browser-module.html#STREAM_IMPROPER_ADDRESSING xmpp.browser.ERR_GONE xmpp.browser-module.html#ERR_GONE xmpp.browser.ERR_NOT_AUTHORIZED xmpp.browser-module.html#ERR_NOT_AUTHORIZED xmpp.browser.ERR_REGISTRATION_REQUIRED xmpp.browser-module.html#ERR_REGISTRATION_REQUIRED xmpp.browser.ERR_INTERNAL_SERVER_ERROR xmpp.browser-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.browser.SASL_INCORRECT_ENCODING xmpp.browser-module.html#SASL_INCORRECT_ENCODING xmpp.browser.STREAM_UNSUPPORTED_ENCODING xmpp.browser-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.browser.ERR_REDIRECT xmpp.browser-module.html#ERR_REDIRECT xmpp.browser.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.browser.ERR_FEATURE_NOT_IMPLEMENTED xmpp.browser-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.browser.name xmpp.browser-module.html#name xmpp.browser.ERR_RESOURCE_CONSTRAINT xmpp.browser-module.html#ERR_RESOURCE_CONSTRAINT xmpp.browser.SASL_INVALID_AUTHZID xmpp.browser-module.html#SASL_INVALID_AUTHZID xmpp.browser.ERR_JID_MALFORMED xmpp.browser-module.html#ERR_JID_MALFORMED xmpp.browser.STREAM_CONFLICT xmpp.browser-module.html#STREAM_CONFLICT xmpp.browser.isResultNode xmpp.protocol-module.html#isResultNode xmpp.browser.STREAM_HOST_UNKNOWN xmpp.browser-module.html#STREAM_HOST_UNKNOWN xmpp.browser.ERR_SERVICE_UNAVAILABLE xmpp.browser-module.html#ERR_SERVICE_UNAVAILABLE xmpp.browser.STREAM_UNDEFINED_CONDITION xmpp.browser-module.html#STREAM_UNDEFINED_CONDITION xmpp.browser.ERRORS xmpp.browser-module.html#ERRORS xmpp.browser.STREAM_BAD_FORMAT xmpp.browser-module.html#STREAM_BAD_FORMAT xmpp.browser.SASL_ABORTED xmpp.browser-module.html#SASL_ABORTED xmpp.browser.STREAM_HOST_GONE xmpp.browser-module.html#STREAM_HOST_GONE xmpp.browser.ERR_UNDEFINED_CONDITION xmpp.browser-module.html#ERR_UNDEFINED_CONDITION xmpp.browser.STREAM_INVALID_FROM xmpp.browser-module.html#STREAM_INVALID_FROM xmpp.browser.ERR_REMOTE_SERVER_TIMEOUT xmpp.browser-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.browser.ERR_CONFLICT xmpp.browser-module.html#ERR_CONFLICT xmpp.browser.STREAM_SYSTEM_SHUTDOWN xmpp.browser-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.browser.STREAM_INVALID_NAMESPACE xmpp.browser-module.html#STREAM_INVALID_NAMESPACE xmpp.browser.STREAM_UNSUPPORTED_VERSION xmpp.browser-module.html#STREAM_UNSUPPORTED_VERSION xmpp.browser.SASL_NOT_AUTHORIZED xmpp.browser-module.html#SASL_NOT_AUTHORIZED xmpp.browser.ERR_REMOTE_SERVER_NOT_FOUND xmpp.browser-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.browser.ERR_SUBSCRIPTION_REQUIRED xmpp.browser-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.browser.STREAM_INTERNAL_SERVER_ERROR xmpp.browser-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.browser.STREAM_INVALID_XML xmpp.browser-module.html#STREAM_INVALID_XML xmpp.browser.ERR_NOT_ALLOWED xmpp.browser-module.html#ERR_NOT_ALLOWED xmpp.browser.ERR_BAD_REQUEST xmpp.browser-module.html#ERR_BAD_REQUEST xmpp.browser.SASL_MECHANISM_TOO_WEAK xmpp.browser-module.html#SASL_MECHANISM_TOO_WEAK xmpp.browser.STREAM_XML_NOT_WELL_FORMED xmpp.browser-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.browser.STREAM_POLICY_VIOLATION xmpp.browser-module.html#STREAM_POLICY_VIOLATION xmpp.browser.STREAM_SEE_OTHER_HOST xmpp.browser-module.html#STREAM_SEE_OTHER_HOST xmpp.browser.STREAM_BAD_NAMESPACE_PREFIX xmpp.browser-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.browser.SASL_INVALID_MECHANISM xmpp.browser-module.html#SASL_INVALID_MECHANISM xmpp.browser.ERR_UNEXPECTED_REQUEST xmpp.browser-module.html#ERR_UNEXPECTED_REQUEST xmpp.browser.ERR_RECIPIENT_UNAVAILABLE xmpp.browser-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.browser.SASL_TEMPORARY_AUTH_FAILURE xmpp.browser-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.browser.ERR_PAYMENT_REQUIRED xmpp.browser-module.html#ERR_PAYMENT_REQUIRED xmpp.browser.STREAM_RESTRICTED_XML xmpp.browser-module.html#STREAM_RESTRICTED_XML xmpp.browser.STREAM_RESOURCE_CONSTRAINT xmpp.browser-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.browser.ERR_ITEM_NOT_FOUND xmpp.browser-module.html#ERR_ITEM_NOT_FOUND xmpp.browser.STREAM_REMOTE_CONNECTION_FAILED xmpp.browser-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.browser.STREAM_INVALID_ID xmpp.browser-module.html#STREAM_INVALID_ID xmpp.browser.ustr xmpp.simplexml-module.html#ustr xmpp.browser.ERR_NOT_ACCEPTABLE xmpp.browser-module.html#ERR_NOT_ACCEPTABLE xmpp.browser.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.browser-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.browser.ERR_FORBIDDEN xmpp.browser-module.html#ERR_FORBIDDEN xmpp.client xmpp.client-module.html xmpp.client.DBG_COMPONENT xmpp.client-module.html#DBG_COMPONENT xmpp.client.DBG_CLIENT xmpp.client-module.html#DBG_CLIENT xmpp.commands xmpp.commands-module.html xmpp.commands.STREAM_NOT_AUTHORIZED xmpp.commands-module.html#STREAM_NOT_AUTHORIZED xmpp.commands.STREAM_CONNECTION_TIMEOUT xmpp.commands-module.html#STREAM_CONNECTION_TIMEOUT xmpp.commands.STREAM_IMPROPER_ADDRESSING xmpp.commands-module.html#STREAM_IMPROPER_ADDRESSING xmpp.commands.ERR_GONE xmpp.commands-module.html#ERR_GONE xmpp.commands.ERR_CONFLICT xmpp.commands-module.html#ERR_CONFLICT xmpp.commands.ERR_NOT_AUTHORIZED xmpp.commands-module.html#ERR_NOT_AUTHORIZED xmpp.commands.ERR_REGISTRATION_REQUIRED xmpp.commands-module.html#ERR_REGISTRATION_REQUIRED xmpp.commands.ERR_INTERNAL_SERVER_ERROR xmpp.commands-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.commands.SASL_INCORRECT_ENCODING xmpp.commands-module.html#SASL_INCORRECT_ENCODING xmpp.commands.STREAM_UNSUPPORTED_ENCODING xmpp.commands-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.commands.ERR_REDIRECT xmpp.commands-module.html#ERR_REDIRECT xmpp.commands.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.commands.ERR_FEATURE_NOT_IMPLEMENTED xmpp.commands-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.commands.name xmpp.commands-module.html#name xmpp.commands.ERR_RESOURCE_CONSTRAINT xmpp.commands-module.html#ERR_RESOURCE_CONSTRAINT xmpp.commands.SASL_INVALID_AUTHZID xmpp.commands-module.html#SASL_INVALID_AUTHZID xmpp.commands.ERR_JID_MALFORMED xmpp.commands-module.html#ERR_JID_MALFORMED xmpp.commands.STREAM_CONFLICT xmpp.commands-module.html#STREAM_CONFLICT xmpp.commands.isResultNode xmpp.protocol-module.html#isResultNode xmpp.commands.ERR_SERVICE_UNAVAILABLE xmpp.commands-module.html#ERR_SERVICE_UNAVAILABLE xmpp.commands.STREAM_UNDEFINED_CONDITION xmpp.commands-module.html#STREAM_UNDEFINED_CONDITION xmpp.commands.ERRORS xmpp.commands-module.html#ERRORS xmpp.commands.STREAM_BAD_FORMAT xmpp.commands-module.html#STREAM_BAD_FORMAT xmpp.commands.SASL_ABORTED xmpp.commands-module.html#SASL_ABORTED xmpp.commands.STREAM_HOST_GONE xmpp.commands-module.html#STREAM_HOST_GONE xmpp.commands.ERR_UNDEFINED_CONDITION xmpp.commands-module.html#ERR_UNDEFINED_CONDITION xmpp.commands.STREAM_INVALID_FROM xmpp.commands-module.html#STREAM_INVALID_FROM xmpp.commands.ERR_REMOTE_SERVER_TIMEOUT xmpp.commands-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.commands.STREAM_SYSTEM_SHUTDOWN xmpp.commands-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.commands.STREAM_INVALID_NAMESPACE xmpp.commands-module.html#STREAM_INVALID_NAMESPACE xmpp.commands.STREAM_UNSUPPORTED_VERSION xmpp.commands-module.html#STREAM_UNSUPPORTED_VERSION xmpp.commands.SASL_NOT_AUTHORIZED xmpp.commands-module.html#SASL_NOT_AUTHORIZED xmpp.commands.ERR_REMOTE_SERVER_NOT_FOUND xmpp.commands-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.commands.ERR_SUBSCRIPTION_REQUIRED xmpp.commands-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.commands.STREAM_INTERNAL_SERVER_ERROR xmpp.commands-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.commands.STREAM_INVALID_XML xmpp.commands-module.html#STREAM_INVALID_XML xmpp.commands.ERR_NOT_ALLOWED xmpp.commands-module.html#ERR_NOT_ALLOWED xmpp.commands.STREAM_HOST_UNKNOWN xmpp.commands-module.html#STREAM_HOST_UNKNOWN xmpp.commands.ERR_BAD_REQUEST xmpp.commands-module.html#ERR_BAD_REQUEST xmpp.commands.SASL_MECHANISM_TOO_WEAK xmpp.commands-module.html#SASL_MECHANISM_TOO_WEAK xmpp.commands.STREAM_XML_NOT_WELL_FORMED xmpp.commands-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.commands.STREAM_POLICY_VIOLATION xmpp.commands-module.html#STREAM_POLICY_VIOLATION xmpp.commands.STREAM_SEE_OTHER_HOST xmpp.commands-module.html#STREAM_SEE_OTHER_HOST xmpp.commands.STREAM_BAD_NAMESPACE_PREFIX xmpp.commands-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.commands.SASL_INVALID_MECHANISM xmpp.commands-module.html#SASL_INVALID_MECHANISM xmpp.commands.ERR_UNEXPECTED_REQUEST xmpp.commands-module.html#ERR_UNEXPECTED_REQUEST xmpp.commands.ERR_RECIPIENT_UNAVAILABLE xmpp.commands-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.commands.SASL_TEMPORARY_AUTH_FAILURE xmpp.commands-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.commands.ERR_PAYMENT_REQUIRED xmpp.commands-module.html#ERR_PAYMENT_REQUIRED xmpp.commands.STREAM_RESTRICTED_XML xmpp.commands-module.html#STREAM_RESTRICTED_XML xmpp.commands.STREAM_RESOURCE_CONSTRAINT xmpp.commands-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.commands.ERR_ITEM_NOT_FOUND xmpp.commands-module.html#ERR_ITEM_NOT_FOUND xmpp.commands.STREAM_REMOTE_CONNECTION_FAILED xmpp.commands-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.commands.STREAM_INVALID_ID xmpp.commands-module.html#STREAM_INVALID_ID xmpp.commands.ustr xmpp.simplexml-module.html#ustr xmpp.commands.ERR_NOT_ACCEPTABLE xmpp.commands-module.html#ERR_NOT_ACCEPTABLE xmpp.commands.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.commands-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.commands.ERR_FORBIDDEN xmpp.commands-module.html#ERR_FORBIDDEN xmpp.debug xmpp.debug-module.html xmpp.debug.color_blue xmpp.debug-module.html#color_blue xmpp.debug.color_brown xmpp.debug-module.html#color_brown xmpp.debug.colors_enabled xmpp.debug-module.html#colors_enabled xmpp.debug.color_white xmpp.debug-module.html#color_white xmpp.debug.color_bright_blue xmpp.debug-module.html#color_bright_blue xmpp.debug.color_light_gray xmpp.debug-module.html#color_light_gray xmpp.debug.color_bright_red xmpp.debug-module.html#color_bright_red xmpp.debug.color_cyan xmpp.debug-module.html#color_cyan xmpp.debug.color_magenta xmpp.debug-module.html#color_magenta xmpp.debug.DBG_ALWAYS xmpp.debug-module.html#DBG_ALWAYS xmpp.debug.color_bright_green xmpp.debug-module.html#color_bright_green xmpp.debug.color_yellow xmpp.debug-module.html#color_yellow xmpp.debug._version_ xmpp.debug-module.html#_version_ xmpp.debug.color_bright_cyan xmpp.debug-module.html#color_bright_cyan xmpp.debug.color_green xmpp.debug-module.html#color_green xmpp.debug.color_black xmpp.debug-module.html#color_black xmpp.debug.LINE_FEED xmpp.debug-module.html#LINE_FEED xmpp.debug.DEBUGGING_IS_ON xmpp.debug-module.html#DEBUGGING_IS_ON xmpp.debug.color_purple xmpp.debug-module.html#color_purple xmpp.debug.color_none xmpp.debug-module.html#color_none xmpp.debug.color_red xmpp.debug-module.html#color_red xmpp.debug.color_dark_gray xmpp.debug-module.html#color_dark_gray xmpp.dispatcher xmpp.dispatcher-module.html xmpp.dispatcher.STREAM_NOT_AUTHORIZED xmpp.dispatcher-module.html#STREAM_NOT_AUTHORIZED xmpp.dispatcher.STREAM_CONNECTION_TIMEOUT xmpp.dispatcher-module.html#STREAM_CONNECTION_TIMEOUT xmpp.dispatcher.STREAM_IMPROPER_ADDRESSING xmpp.dispatcher-module.html#STREAM_IMPROPER_ADDRESSING xmpp.dispatcher.ERR_GONE xmpp.dispatcher-module.html#ERR_GONE xmpp.dispatcher.ERR_NOT_AUTHORIZED xmpp.dispatcher-module.html#ERR_NOT_AUTHORIZED xmpp.dispatcher.ERR_REGISTRATION_REQUIRED xmpp.dispatcher-module.html#ERR_REGISTRATION_REQUIRED xmpp.dispatcher.ERR_INTERNAL_SERVER_ERROR xmpp.dispatcher-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.dispatcher.SASL_INCORRECT_ENCODING xmpp.dispatcher-module.html#SASL_INCORRECT_ENCODING xmpp.dispatcher.STREAM_UNSUPPORTED_ENCODING xmpp.dispatcher-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.dispatcher.DefaultTimeout xmpp.dispatcher-module.html#DefaultTimeout xmpp.dispatcher.ERR_REDIRECT xmpp.dispatcher-module.html#ERR_REDIRECT xmpp.dispatcher.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.dispatcher.ERR_FEATURE_NOT_IMPLEMENTED xmpp.dispatcher-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.dispatcher.name xmpp.dispatcher-module.html#name xmpp.dispatcher.ERR_RESOURCE_CONSTRAINT xmpp.dispatcher-module.html#ERR_RESOURCE_CONSTRAINT xmpp.dispatcher.SASL_INVALID_AUTHZID xmpp.dispatcher-module.html#SASL_INVALID_AUTHZID xmpp.dispatcher.ERR_JID_MALFORMED xmpp.dispatcher-module.html#ERR_JID_MALFORMED xmpp.dispatcher.STREAM_CONFLICT xmpp.dispatcher-module.html#STREAM_CONFLICT xmpp.dispatcher.isResultNode xmpp.protocol-module.html#isResultNode xmpp.dispatcher.ERR_SERVICE_UNAVAILABLE xmpp.dispatcher-module.html#ERR_SERVICE_UNAVAILABLE xmpp.dispatcher.STREAM_UNDEFINED_CONDITION xmpp.dispatcher-module.html#STREAM_UNDEFINED_CONDITION xmpp.dispatcher.ERRORS xmpp.dispatcher-module.html#ERRORS xmpp.dispatcher.STREAM_BAD_FORMAT xmpp.dispatcher-module.html#STREAM_BAD_FORMAT xmpp.dispatcher.SASL_ABORTED xmpp.dispatcher-module.html#SASL_ABORTED xmpp.dispatcher.STREAM_HOST_GONE xmpp.dispatcher-module.html#STREAM_HOST_GONE xmpp.dispatcher.ERR_UNDEFINED_CONDITION xmpp.dispatcher-module.html#ERR_UNDEFINED_CONDITION xmpp.dispatcher.STREAM_INVALID_FROM xmpp.dispatcher-module.html#STREAM_INVALID_FROM xmpp.dispatcher.ERR_REMOTE_SERVER_TIMEOUT xmpp.dispatcher-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.dispatcher.ERR_CONFLICT xmpp.dispatcher-module.html#ERR_CONFLICT xmpp.dispatcher.STREAM_SYSTEM_SHUTDOWN xmpp.dispatcher-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.dispatcher.STREAM_INVALID_NAMESPACE xmpp.dispatcher-module.html#STREAM_INVALID_NAMESPACE xmpp.dispatcher.STREAM_UNSUPPORTED_VERSION xmpp.dispatcher-module.html#STREAM_UNSUPPORTED_VERSION xmpp.dispatcher.SASL_NOT_AUTHORIZED xmpp.dispatcher-module.html#SASL_NOT_AUTHORIZED xmpp.dispatcher.ERR_REMOTE_SERVER_NOT_FOUND xmpp.dispatcher-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.dispatcher.ERR_SUBSCRIPTION_REQUIRED xmpp.dispatcher-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.dispatcher.STREAM_INTERNAL_SERVER_ERROR xmpp.dispatcher-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.dispatcher.STREAM_INVALID_XML xmpp.dispatcher-module.html#STREAM_INVALID_XML xmpp.dispatcher.ERR_NOT_ALLOWED xmpp.dispatcher-module.html#ERR_NOT_ALLOWED xmpp.dispatcher.STREAM_HOST_UNKNOWN xmpp.dispatcher-module.html#STREAM_HOST_UNKNOWN xmpp.dispatcher.ERR_BAD_REQUEST xmpp.dispatcher-module.html#ERR_BAD_REQUEST xmpp.dispatcher.SASL_MECHANISM_TOO_WEAK xmpp.dispatcher-module.html#SASL_MECHANISM_TOO_WEAK xmpp.dispatcher.STREAM_XML_NOT_WELL_FORMED xmpp.dispatcher-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.dispatcher.STREAM_POLICY_VIOLATION xmpp.dispatcher-module.html#STREAM_POLICY_VIOLATION xmpp.dispatcher.STREAM_SEE_OTHER_HOST xmpp.dispatcher-module.html#STREAM_SEE_OTHER_HOST xmpp.dispatcher.STREAM_BAD_NAMESPACE_PREFIX xmpp.dispatcher-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.dispatcher.SASL_INVALID_MECHANISM xmpp.dispatcher-module.html#SASL_INVALID_MECHANISM xmpp.dispatcher.ERR_UNEXPECTED_REQUEST xmpp.dispatcher-module.html#ERR_UNEXPECTED_REQUEST xmpp.dispatcher.ERR_RECIPIENT_UNAVAILABLE xmpp.dispatcher-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.dispatcher.SASL_TEMPORARY_AUTH_FAILURE xmpp.dispatcher-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.dispatcher.ERR_PAYMENT_REQUIRED xmpp.dispatcher-module.html#ERR_PAYMENT_REQUIRED xmpp.dispatcher.STREAM_RESTRICTED_XML xmpp.dispatcher-module.html#STREAM_RESTRICTED_XML xmpp.dispatcher.STREAM_RESOURCE_CONSTRAINT xmpp.dispatcher-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.dispatcher.ERR_ITEM_NOT_FOUND xmpp.dispatcher-module.html#ERR_ITEM_NOT_FOUND xmpp.dispatcher.STREAM_REMOTE_CONNECTION_FAILED xmpp.dispatcher-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.dispatcher.ID xmpp.dispatcher-module.html#ID xmpp.dispatcher.STREAM_INVALID_ID xmpp.dispatcher-module.html#STREAM_INVALID_ID xmpp.dispatcher.ustr xmpp.simplexml-module.html#ustr xmpp.dispatcher.ERR_NOT_ACCEPTABLE xmpp.dispatcher-module.html#ERR_NOT_ACCEPTABLE xmpp.dispatcher.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.dispatcher-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.dispatcher.ERR_FORBIDDEN xmpp.dispatcher-module.html#ERR_FORBIDDEN xmpp.features xmpp.features-module.html xmpp.features.getPrivacyList xmpp.features-module.html#getPrivacyList xmpp.features.STREAM_NOT_AUTHORIZED xmpp.features-module.html#STREAM_NOT_AUTHORIZED xmpp.features.STREAM_CONNECTION_TIMEOUT xmpp.features-module.html#STREAM_CONNECTION_TIMEOUT xmpp.features.STREAM_IMPROPER_ADDRESSING xmpp.features-module.html#STREAM_IMPROPER_ADDRESSING xmpp.features._ReceivedRegInfo xmpp.features-module.html#_ReceivedRegInfo xmpp.features.ERR_GONE xmpp.features-module.html#ERR_GONE xmpp.features.register xmpp.features-module.html#register xmpp.features.ERR_CONFLICT xmpp.features-module.html#ERR_CONFLICT xmpp.features.ERR_NOT_AUTHORIZED xmpp.features-module.html#ERR_NOT_AUTHORIZED xmpp.features.ERR_REGISTRATION_REQUIRED xmpp.features-module.html#ERR_REGISTRATION_REQUIRED xmpp.features.ERR_INTERNAL_SERVER_ERROR xmpp.features-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.features.SASL_INCORRECT_ENCODING xmpp.features-module.html#SASL_INCORRECT_ENCODING xmpp.features.STREAM_UNSUPPORTED_ENCODING xmpp.features-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.features.ERR_REDIRECT xmpp.features-module.html#ERR_REDIRECT xmpp.features.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.features.ERR_FEATURE_NOT_IMPLEMENTED xmpp.features-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.features.getRegInfo xmpp.features-module.html#getRegInfo xmpp.features.name xmpp.features-module.html#name xmpp.features.ERR_RESOURCE_CONSTRAINT xmpp.features-module.html#ERR_RESOURCE_CONSTRAINT xmpp.features.unregister xmpp.features-module.html#unregister xmpp.features.SASL_INVALID_AUTHZID xmpp.features-module.html#SASL_INVALID_AUTHZID xmpp.features.ERR_JID_MALFORMED xmpp.features-module.html#ERR_JID_MALFORMED xmpp.features.STREAM_CONFLICT xmpp.features-module.html#STREAM_CONFLICT xmpp.features.isResultNode xmpp.protocol-module.html#isResultNode xmpp.features.ERR_SERVICE_UNAVAILABLE xmpp.features-module.html#ERR_SERVICE_UNAVAILABLE xmpp.features.STREAM_UNDEFINED_CONDITION xmpp.features-module.html#STREAM_UNDEFINED_CONDITION xmpp.features.ERRORS xmpp.features-module.html#ERRORS xmpp.features.STREAM_BAD_FORMAT xmpp.features-module.html#STREAM_BAD_FORMAT xmpp.features.SASL_ABORTED xmpp.features-module.html#SASL_ABORTED xmpp.features.delPrivacyList xmpp.features-module.html#delPrivacyList xmpp.features.STREAM_HOST_GONE xmpp.features-module.html#STREAM_HOST_GONE xmpp.features.ERR_UNDEFINED_CONDITION xmpp.features-module.html#ERR_UNDEFINED_CONDITION xmpp.features.STREAM_INVALID_FROM xmpp.features-module.html#STREAM_INVALID_FROM xmpp.features.REGISTER_DATA_RECEIVED xmpp.features-module.html#REGISTER_DATA_RECEIVED xmpp.features._discover xmpp.features-module.html#_discover xmpp.features.ERR_REMOTE_SERVER_TIMEOUT xmpp.features-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.features.STREAM_SYSTEM_SHUTDOWN xmpp.features-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.features.STREAM_INVALID_NAMESPACE xmpp.features-module.html#STREAM_INVALID_NAMESPACE xmpp.features.discoverItems xmpp.features-module.html#discoverItems xmpp.features.setDefaultPrivacyList xmpp.features-module.html#setDefaultPrivacyList xmpp.features.STREAM_UNSUPPORTED_VERSION xmpp.features-module.html#STREAM_UNSUPPORTED_VERSION xmpp.features.SASL_NOT_AUTHORIZED xmpp.features-module.html#SASL_NOT_AUTHORIZED xmpp.features.ERR_REMOTE_SERVER_NOT_FOUND xmpp.features-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.features.ERR_SUBSCRIPTION_REQUIRED xmpp.features-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.features.STREAM_INTERNAL_SERVER_ERROR xmpp.features-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.features.STREAM_INVALID_XML xmpp.features-module.html#STREAM_INVALID_XML xmpp.features.ERR_NOT_ALLOWED xmpp.features-module.html#ERR_NOT_ALLOWED xmpp.features.getPrivacyLists xmpp.features-module.html#getPrivacyLists xmpp.features.STREAM_HOST_UNKNOWN xmpp.features-module.html#STREAM_HOST_UNKNOWN xmpp.features.ERR_BAD_REQUEST xmpp.features-module.html#ERR_BAD_REQUEST xmpp.features.changePasswordTo xmpp.features-module.html#changePasswordTo xmpp.features.SASL_MECHANISM_TOO_WEAK xmpp.features-module.html#SASL_MECHANISM_TOO_WEAK xmpp.features.STREAM_XML_NOT_WELL_FORMED xmpp.features-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.features.STREAM_POLICY_VIOLATION xmpp.features-module.html#STREAM_POLICY_VIOLATION xmpp.features.STREAM_SEE_OTHER_HOST xmpp.features-module.html#STREAM_SEE_OTHER_HOST xmpp.features.STREAM_BAD_NAMESPACE_PREFIX xmpp.features-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.features.SASL_INVALID_MECHANISM xmpp.features-module.html#SASL_INVALID_MECHANISM xmpp.features.ERR_UNEXPECTED_REQUEST xmpp.features-module.html#ERR_UNEXPECTED_REQUEST xmpp.features.ERR_RECIPIENT_UNAVAILABLE xmpp.features-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.features.SASL_TEMPORARY_AUTH_FAILURE xmpp.features-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.features.setActivePrivacyList xmpp.features-module.html#setActivePrivacyList xmpp.features.ERR_PAYMENT_REQUIRED xmpp.features-module.html#ERR_PAYMENT_REQUIRED xmpp.features.STREAM_RESOURCE_CONSTRAINT xmpp.features-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.features.ERR_ITEM_NOT_FOUND xmpp.features-module.html#ERR_ITEM_NOT_FOUND xmpp.features.discoverInfo xmpp.features-module.html#discoverInfo xmpp.features.STREAM_REMOTE_CONNECTION_FAILED xmpp.features-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.features.STREAM_INVALID_ID xmpp.features-module.html#STREAM_INVALID_ID xmpp.features.setPrivacyList xmpp.features-module.html#setPrivacyList xmpp.features.ustr xmpp.simplexml-module.html#ustr xmpp.features.STREAM_RESTRICTED_XML xmpp.features-module.html#STREAM_RESTRICTED_XML xmpp.features.ERR_NOT_ACCEPTABLE xmpp.features-module.html#ERR_NOT_ACCEPTABLE xmpp.features.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.features-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.features.ERR_FORBIDDEN xmpp.features-module.html#ERR_FORBIDDEN xmpp.filetransfer xmpp.filetransfer-module.html xmpp.filetransfer.STREAM_NOT_AUTHORIZED xmpp.filetransfer-module.html#STREAM_NOT_AUTHORIZED xmpp.filetransfer.STREAM_CONNECTION_TIMEOUT xmpp.filetransfer-module.html#STREAM_CONNECTION_TIMEOUT xmpp.filetransfer.STREAM_IMPROPER_ADDRESSING xmpp.filetransfer-module.html#STREAM_IMPROPER_ADDRESSING xmpp.filetransfer.ERR_GONE xmpp.filetransfer-module.html#ERR_GONE xmpp.filetransfer.ERR_CONFLICT xmpp.filetransfer-module.html#ERR_CONFLICT xmpp.filetransfer.ERR_NOT_AUTHORIZED xmpp.filetransfer-module.html#ERR_NOT_AUTHORIZED xmpp.filetransfer.ERR_REGISTRATION_REQUIRED xmpp.filetransfer-module.html#ERR_REGISTRATION_REQUIRED xmpp.filetransfer.ERR_INTERNAL_SERVER_ERROR xmpp.filetransfer-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.filetransfer.SASL_INCORRECT_ENCODING xmpp.filetransfer-module.html#SASL_INCORRECT_ENCODING xmpp.filetransfer.STREAM_UNSUPPORTED_ENCODING xmpp.filetransfer-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.filetransfer.ERR_REDIRECT xmpp.filetransfer-module.html#ERR_REDIRECT xmpp.filetransfer.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.filetransfer.ERR_FEATURE_NOT_IMPLEMENTED xmpp.filetransfer-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.filetransfer.name xmpp.filetransfer-module.html#name xmpp.filetransfer.ERR_RESOURCE_CONSTRAINT xmpp.filetransfer-module.html#ERR_RESOURCE_CONSTRAINT xmpp.filetransfer.SASL_INVALID_AUTHZID xmpp.filetransfer-module.html#SASL_INVALID_AUTHZID xmpp.filetransfer.ERR_JID_MALFORMED xmpp.filetransfer-module.html#ERR_JID_MALFORMED xmpp.filetransfer.STREAM_CONFLICT xmpp.filetransfer-module.html#STREAM_CONFLICT xmpp.filetransfer.isResultNode xmpp.protocol-module.html#isResultNode xmpp.filetransfer.ERR_SERVICE_UNAVAILABLE xmpp.filetransfer-module.html#ERR_SERVICE_UNAVAILABLE xmpp.filetransfer.STREAM_UNDEFINED_CONDITION xmpp.filetransfer-module.html#STREAM_UNDEFINED_CONDITION xmpp.filetransfer.ERRORS xmpp.filetransfer-module.html#ERRORS xmpp.filetransfer.STREAM_BAD_FORMAT xmpp.filetransfer-module.html#STREAM_BAD_FORMAT xmpp.filetransfer.SASL_ABORTED xmpp.filetransfer-module.html#SASL_ABORTED xmpp.filetransfer.STREAM_HOST_GONE xmpp.filetransfer-module.html#STREAM_HOST_GONE xmpp.filetransfer.ERR_UNDEFINED_CONDITION xmpp.filetransfer-module.html#ERR_UNDEFINED_CONDITION xmpp.filetransfer.STREAM_INVALID_FROM xmpp.filetransfer-module.html#STREAM_INVALID_FROM xmpp.filetransfer.ERR_REMOTE_SERVER_TIMEOUT xmpp.filetransfer-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.filetransfer.STREAM_SYSTEM_SHUTDOWN xmpp.filetransfer-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.filetransfer.STREAM_INVALID_NAMESPACE xmpp.filetransfer-module.html#STREAM_INVALID_NAMESPACE xmpp.filetransfer.STREAM_UNSUPPORTED_VERSION xmpp.filetransfer-module.html#STREAM_UNSUPPORTED_VERSION xmpp.filetransfer.SASL_NOT_AUTHORIZED xmpp.filetransfer-module.html#SASL_NOT_AUTHORIZED xmpp.filetransfer.ERR_REMOTE_SERVER_NOT_FOUND xmpp.filetransfer-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.filetransfer.ERR_SUBSCRIPTION_REQUIRED xmpp.filetransfer-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.filetransfer.STREAM_INTERNAL_SERVER_ERROR xmpp.filetransfer-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.filetransfer.STREAM_INVALID_XML xmpp.filetransfer-module.html#STREAM_INVALID_XML xmpp.filetransfer.ERR_NOT_ALLOWED xmpp.filetransfer-module.html#ERR_NOT_ALLOWED xmpp.filetransfer.STREAM_HOST_UNKNOWN xmpp.filetransfer-module.html#STREAM_HOST_UNKNOWN xmpp.filetransfer.ERR_BAD_REQUEST xmpp.filetransfer-module.html#ERR_BAD_REQUEST xmpp.filetransfer.STREAM_POLICY_VIOLATION xmpp.filetransfer-module.html#STREAM_POLICY_VIOLATION xmpp.filetransfer.SASL_MECHANISM_TOO_WEAK xmpp.filetransfer-module.html#SASL_MECHANISM_TOO_WEAK xmpp.filetransfer.STREAM_XML_NOT_WELL_FORMED xmpp.filetransfer-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.filetransfer.STREAM_SEE_OTHER_HOST xmpp.filetransfer-module.html#STREAM_SEE_OTHER_HOST xmpp.filetransfer.STREAM_BAD_NAMESPACE_PREFIX xmpp.filetransfer-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.filetransfer.SASL_INVALID_MECHANISM xmpp.filetransfer-module.html#SASL_INVALID_MECHANISM xmpp.filetransfer.ERR_UNEXPECTED_REQUEST xmpp.filetransfer-module.html#ERR_UNEXPECTED_REQUEST xmpp.filetransfer.ERR_RECIPIENT_UNAVAILABLE xmpp.filetransfer-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.filetransfer.SASL_TEMPORARY_AUTH_FAILURE xmpp.filetransfer-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.filetransfer.ERR_PAYMENT_REQUIRED xmpp.filetransfer-module.html#ERR_PAYMENT_REQUIRED xmpp.filetransfer.STREAM_RESTRICTED_XML xmpp.filetransfer-module.html#STREAM_RESTRICTED_XML xmpp.filetransfer.STREAM_RESOURCE_CONSTRAINT xmpp.filetransfer-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.filetransfer.ERR_ITEM_NOT_FOUND xmpp.filetransfer-module.html#ERR_ITEM_NOT_FOUND xmpp.filetransfer.STREAM_REMOTE_CONNECTION_FAILED xmpp.filetransfer-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.filetransfer.STREAM_INVALID_ID xmpp.filetransfer-module.html#STREAM_INVALID_ID xmpp.filetransfer.ustr xmpp.simplexml-module.html#ustr xmpp.filetransfer.ERR_NOT_ACCEPTABLE xmpp.filetransfer-module.html#ERR_NOT_ACCEPTABLE xmpp.filetransfer.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.filetransfer-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.filetransfer.ERR_FORBIDDEN xmpp.filetransfer-module.html#ERR_FORBIDDEN xmpp.jep0106 xmpp.jep0106-module.html xmpp.jep0106.JIDEncode xmpp.jep0106-module.html#JIDEncode xmpp.jep0106.xep0106mapping xmpp.jep0106-module.html#xep0106mapping xmpp.jep0106.JIDDecode xmpp.jep0106-module.html#JIDDecode xmpp.protocol xmpp.protocol-module.html xmpp.protocol.NS_MUC_ADMIN xmpp.protocol-module.html#NS_MUC_ADMIN xmpp.protocol.STREAM_NOT_AUTHORIZED xmpp.protocol-module.html#STREAM_NOT_AUTHORIZED xmpp.protocol.NS_ADMIN_IDLE_USERS_NUM xmpp.protocol-module.html#NS_ADMIN_IDLE_USERS_NUM xmpp.protocol.NS_ADMIN_ADD_USER xmpp.protocol-module.html#NS_ADMIN_ADD_USER xmpp.protocol.STREAM_CONNECTION_TIMEOUT xmpp.protocol-module.html#STREAM_CONNECTION_TIMEOUT xmpp.protocol.STREAM_IMPROPER_ADDRESSING xmpp.protocol-module.html#STREAM_IMPROPER_ADDRESSING xmpp.protocol.NS_ADMIN_DISABLED_USERS_NUM xmpp.protocol-module.html#NS_ADMIN_DISABLED_USERS_NUM xmpp.protocol.ERR_GONE xmpp.protocol-module.html#ERR_GONE xmpp.protocol.NS_PHYSLOC xmpp.protocol-module.html#NS_PHYSLOC xmpp.protocol.ERR_CONFLICT xmpp.protocol-module.html#ERR_CONFLICT xmpp.protocol.NS_COMPRESS xmpp.protocol-module.html#NS_COMPRESS xmpp.protocol.NS_AGENTS xmpp.protocol-module.html#NS_AGENTS xmpp.protocol.NS_MOOD xmpp.protocol-module.html#NS_MOOD xmpp.protocol.ERR_NOT_AUTHORIZED xmpp.protocol-module.html#ERR_NOT_AUTHORIZED xmpp.protocol.NS_FILE xmpp.protocol-module.html#NS_FILE xmpp.protocol.ERR_REGISTRATION_REQUIRED xmpp.protocol-module.html#ERR_REGISTRATION_REQUIRED xmpp.protocol.ERR_INTERNAL_SERVER_ERROR xmpp.protocol-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.protocol.SASL_INCORRECT_ENCODING xmpp.protocol-module.html#SASL_INCORRECT_ENCODING xmpp.protocol.NS_MUC_OWNER xmpp.protocol-module.html#NS_MUC_OWNER xmpp.protocol.NS_ADMIN_ACTIVE_USERS_NUM xmpp.protocol-module.html#NS_ADMIN_ACTIVE_USERS_NUM xmpp.protocol.NS_ACTIVITY xmpp.protocol-module.html#NS_ACTIVITY xmpp.protocol.NS_ADMIN_GET_USER_ROSTER xmpp.protocol-module.html#NS_ADMIN_GET_USER_ROSTER xmpp.protocol.NS_MUC_ROOMINFO xmpp.protocol-module.html#NS_MUC_ROOMINFO xmpp.protocol.NS_PRESENCE xmpp.protocol-module.html#NS_PRESENCE xmpp.protocol.STREAM_UNSUPPORTED_ENCODING xmpp.protocol-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.protocol.NS_ADMIN_EDIT_BLACKLIST xmpp.protocol-module.html#NS_ADMIN_EDIT_BLACKLIST xmpp.protocol.NS_ADMIN_ONLINE_USERS_NUM xmpp.protocol-module.html#NS_ADMIN_ONLINE_USERS_NUM xmpp.protocol.NS_CHATSTATES xmpp.protocol-module.html#NS_CHATSTATES xmpp.protocol.ERR_REDIRECT xmpp.protocol-module.html#ERR_REDIRECT xmpp.protocol.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.protocol.NS_GROUPCHAT xmpp.protocol-module.html#NS_GROUPCHAT xmpp.protocol.ERR_FEATURE_NOT_IMPLEMENTED xmpp.protocol-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.protocol.NS_GATEWAY xmpp.protocol-module.html#NS_GATEWAY xmpp.protocol.NS_DISCO_ITEMS xmpp.protocol-module.html#NS_DISCO_ITEMS xmpp.protocol.name xmpp.protocol-module.html#name xmpp.protocol.NS_BIND xmpp.protocol-module.html#NS_BIND xmpp.protocol.NS_XHTML_IM xmpp.protocol-module.html#NS_XHTML_IM xmpp.protocol.NS_XMPP_STREAMS xmpp.protocol-module.html#NS_XMPP_STREAMS xmpp.protocol.NS_IQ xmpp.protocol-module.html#NS_IQ xmpp.protocol.ERR_RESOURCE_CONSTRAINT xmpp.protocol-module.html#ERR_RESOURCE_CONSTRAINT xmpp.protocol.NS_CLIENT xmpp.protocol-module.html#NS_CLIENT xmpp.protocol.SASL_INVALID_AUTHZID xmpp.protocol-module.html#SASL_INVALID_AUTHZID xmpp.protocol.NS_EVENT xmpp.protocol-module.html#NS_EVENT xmpp.protocol.NS_AVATAR xmpp.protocol-module.html#NS_AVATAR xmpp.protocol.NS_DATA_LAYOUT xmpp.protocol-module.html#NS_DATA_LAYOUT xmpp.protocol.NS_ADMIN_DELETE_WELCOME xmpp.protocol-module.html#NS_ADMIN_DELETE_WELCOME xmpp.protocol.stream_exceptions xmpp.protocol-module.html#stream_exceptions xmpp.protocol.xmpp_stanza_error_conditions xmpp.protocol-module.html#xmpp_stanza_error_conditions xmpp.protocol.NS_ROSTER xmpp.protocol-module.html#NS_ROSTER xmpp.protocol.NS_STANZAS xmpp.protocol-module.html#NS_STANZAS xmpp.protocol.NS_ADMIN_EDIT_ADMIN xmpp.protocol-module.html#NS_ADMIN_EDIT_ADMIN xmpp.protocol.ERR_JID_MALFORMED xmpp.protocol-module.html#ERR_JID_MALFORMED xmpp.protocol.STREAM_CONFLICT xmpp.protocol-module.html#STREAM_CONFLICT xmpp.protocol.isResultNode xmpp.protocol-module.html#isResultNode xmpp.protocol.NS_MUC_REQUEST xmpp.protocol-module.html#NS_MUC_REQUEST xmpp.protocol.NS_ADMIN_DELETE_MOTD xmpp.protocol-module.html#NS_ADMIN_DELETE_MOTD xmpp.protocol.ERR_SERVICE_UNAVAILABLE xmpp.protocol-module.html#ERR_SERVICE_UNAVAILABLE xmpp.protocol.NS_AMP xmpp.protocol-module.html#NS_AMP xmpp.protocol.STREAM_UNDEFINED_CONDITION xmpp.protocol-module.html#STREAM_UNDEFINED_CONDITION xmpp.protocol.NS_DISCO xmpp.protocol-module.html#NS_DISCO xmpp.protocol.NS_MUC_ROOMS xmpp.protocol-module.html#NS_MUC_ROOMS xmpp.protocol.ERRORS xmpp.protocol-module.html#ERRORS xmpp.protocol.NS_ADMIN_ACTIVE_USERS_LIST xmpp.protocol-module.html#NS_ADMIN_ACTIVE_USERS_LIST xmpp.protocol.STREAM_BAD_FORMAT xmpp.protocol-module.html#STREAM_BAD_FORMAT xmpp.protocol.NS_PUBSUB xmpp.protocol-module.html#NS_PUBSUB xmpp.protocol.NS_DIALBACK xmpp.protocol-module.html#NS_DIALBACK xmpp.protocol.SASL_ABORTED xmpp.protocol-module.html#SASL_ABORTED xmpp.protocol.NS_AUTH xmpp.protocol-module.html#NS_AUTH xmpp.protocol.NS_VCARD xmpp.protocol-module.html#NS_VCARD xmpp.protocol.STREAM_HOST_GONE xmpp.protocol-module.html#STREAM_HOST_GONE xmpp.protocol.NS_SI xmpp.protocol-module.html#NS_SI xmpp.protocol.NS_SASL xmpp.protocol-module.html#NS_SASL xmpp.protocol.NS_ADMIN_END_USER_SESSION xmpp.protocol-module.html#NS_ADMIN_END_USER_SESSION xmpp.protocol.ERR_UNDEFINED_CONDITION xmpp.protocol-module.html#ERR_UNDEFINED_CONDITION xmpp.protocol.STREAM_INVALID_FROM xmpp.protocol-module.html#STREAM_INVALID_FROM xmpp.protocol.NS_CAPS xmpp.protocol-module.html#NS_CAPS xmpp.protocol.NS_ADMIN_SHUTDOWN xmpp.protocol-module.html#NS_ADMIN_SHUTDOWN xmpp.protocol.NS_AMP_ERRORS xmpp.protocol-module.html#NS_AMP_ERRORS xmpp.protocol.NS_BROWSE xmpp.protocol-module.html#NS_BROWSE xmpp.protocol.NS_ROSTERX xmpp.protocol-module.html#NS_ROSTERX xmpp.protocol.NS_TLS xmpp.protocol-module.html#NS_TLS xmpp.protocol.NS_DATA xmpp.protocol-module.html#NS_DATA xmpp.protocol.NS_SERVER xmpp.protocol-module.html#NS_SERVER xmpp.protocol.NS_SESSION xmpp.protocol-module.html#NS_SESSION xmpp.protocol.ERR_REMOTE_SERVER_TIMEOUT xmpp.protocol-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.protocol.NS_IBB xmpp.protocol-module.html#NS_IBB xmpp.protocol.NS_ADMIN_GET_USER_PASSWORD xmpp.protocol-module.html#NS_ADMIN_GET_USER_PASSWORD xmpp.protocol.NS_ADMIN_ONLINE_USERS_LIST xmpp.protocol-module.html#NS_ADMIN_ONLINE_USERS_LIST xmpp.protocol.NS_ADMIN_ANNOUNCE xmpp.protocol-module.html#NS_ADMIN_ANNOUNCE xmpp.protocol.NS_ADMIN_USER_STATS xmpp.protocol-module.html#NS_ADMIN_USER_STATS xmpp.protocol.NS_PRIVACY xmpp.protocol-module.html#NS_PRIVACY xmpp.protocol.STREAM_SYSTEM_SHUTDOWN xmpp.protocol-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.protocol.STREAM_INVALID_NAMESPACE xmpp.protocol-module.html#STREAM_INVALID_NAMESPACE xmpp.protocol.NS_FEATURE xmpp.protocol-module.html#NS_FEATURE xmpp.protocol.STREAM_UNSUPPORTED_VERSION xmpp.protocol-module.html#STREAM_UNSUPPORTED_VERSION xmpp.protocol.SASL_NOT_AUTHORIZED xmpp.protocol-module.html#SASL_NOT_AUTHORIZED xmpp.protocol.ERR_REMOTE_SERVER_NOT_FOUND xmpp.protocol-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.protocol.NS_ADMIN_DISABLED_USERS_LIST xmpp.protocol-module.html#NS_ADMIN_DISABLED_USERS_LIST xmpp.protocol.NS_ADMIN_RESTART xmpp.protocol-module.html#NS_ADMIN_RESTART xmpp.protocol.NS_WAITINGLIST xmpp.protocol-module.html#NS_WAITINGLIST xmpp.protocol.NS_VERSION xmpp.protocol-module.html#NS_VERSION xmpp.protocol.ERR_SUBSCRIPTION_REQUIRED xmpp.protocol-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.protocol.STREAM_INTERNAL_SERVER_ERROR xmpp.protocol-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.protocol.NS_COMPONENT_1 xmpp.protocol-module.html#NS_COMPONENT_1 xmpp.protocol.NS_MUC_TRAFIC xmpp.protocol-module.html#NS_MUC_TRAFIC xmpp.protocol.NS_HTTP_BIND xmpp.protocol-module.html#NS_HTTP_BIND xmpp.protocol.NS_MUC_ROOMCONFIG xmpp.protocol-module.html#NS_MUC_ROOMCONFIG xmpp.protocol.STREAM_INVALID_XML xmpp.protocol-module.html#STREAM_INVALID_XML xmpp.protocol.NS_INVISIBLE xmpp.protocol-module.html#NS_INVISIBLE xmpp.protocol.NS_ADMIN_REGISTERED_USERS_NUM xmpp.protocol-module.html#NS_ADMIN_REGISTERED_USERS_NUM xmpp.protocol.NS_PRIVATE xmpp.protocol-module.html#NS_PRIVATE xmpp.protocol.NS_ADMIN_DISABLE_USER xmpp.protocol-module.html#NS_ADMIN_DISABLE_USER xmpp.protocol.ERR_NOT_ALLOWED xmpp.protocol-module.html#ERR_NOT_ALLOWED xmpp.protocol._errorcodes xmpp.protocol-module.html#_errorcodes xmpp.protocol.sasl_error_conditions xmpp.protocol-module.html#sasl_error_conditions xmpp.protocol.NS_OFFLINE xmpp.protocol-module.html#NS_OFFLINE xmpp.protocol.NS_MUC_USER xmpp.protocol-module.html#NS_MUC_USER xmpp.protocol.NS_STREAMS xmpp.protocol-module.html#NS_STREAMS xmpp.protocol.NS_ADMIN_REGISTERED_USERS_LIST xmpp.protocol-module.html#NS_ADMIN_REGISTERED_USERS_LIST xmpp.protocol.STREAM_HOST_UNKNOWN xmpp.protocol-module.html#STREAM_HOST_UNKNOWN xmpp.protocol.ERR_BAD_REQUEST xmpp.protocol-module.html#ERR_BAD_REQUEST xmpp.protocol.NS_ADMIN_SET_WELCOME xmpp.protocol-module.html#NS_ADMIN_SET_WELCOME xmpp.protocol.NS_ADMIN_CHANGE_USER_PASSWORD xmpp.protocol-module.html#NS_ADMIN_CHANGE_USER_PASSWORD xmpp.protocol.NS_DELAY xmpp.protocol-module.html#NS_DELAY xmpp.protocol.NS_ENCRYPTED xmpp.protocol-module.html#NS_ENCRYPTED xmpp.protocol.NS_RPC xmpp.protocol-module.html#NS_RPC xmpp.protocol.NS_SIGNED xmpp.protocol-module.html#NS_SIGNED xmpp.protocol.NS_ADMIN_REENABLE_USER xmpp.protocol-module.html#NS_ADMIN_REENABLE_USER xmpp.protocol.NS_ADMIN xmpp.protocol-module.html#NS_ADMIN xmpp.protocol.NS_MESSAGE xmpp.protocol-module.html#NS_MESSAGE xmpp.protocol.NS_ADMIN_DELETE_USER xmpp.protocol-module.html#NS_ADMIN_DELETE_USER xmpp.protocol.SASL_MECHANISM_TOO_WEAK xmpp.protocol-module.html#SASL_MECHANISM_TOO_WEAK xmpp.protocol.STREAM_XML_NOT_WELL_FORMED xmpp.protocol-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.protocol.STREAM_POLICY_VIOLATION xmpp.protocol-module.html#STREAM_POLICY_VIOLATION xmpp.protocol.NS_REGISTER xmpp.protocol-module.html#NS_REGISTER xmpp.protocol.STREAM_SEE_OTHER_HOST xmpp.protocol-module.html#STREAM_SEE_OTHER_HOST xmpp.protocol.NS_BYTESTREAM xmpp.protocol-module.html#NS_BYTESTREAM xmpp.protocol.NS_VACATION xmpp.protocol-module.html#NS_VACATION xmpp.protocol.STREAM_BAD_NAMESPACE_PREFIX xmpp.protocol-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.protocol.NS_GEOLOC xmpp.protocol-module.html#NS_GEOLOC xmpp.protocol.SASL_INVALID_MECHANISM xmpp.protocol-module.html#SASL_INVALID_MECHANISM xmpp.protocol.NS_MUC_REGISTER xmpp.protocol-module.html#NS_MUC_REGISTER xmpp.protocol.ERR_UNEXPECTED_REQUEST xmpp.protocol-module.html#ERR_UNEXPECTED_REQUEST xmpp.protocol.NS_ADMIN_IDLE_USERS_LIST xmpp.protocol-module.html#NS_ADMIN_IDLE_USERS_LIST xmpp.protocol.NS_DATA_VALIDATE xmpp.protocol-module.html#NS_DATA_VALIDATE xmpp.protocol.ERR_RECIPIENT_UNAVAILABLE xmpp.protocol-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.protocol.SASL_TEMPORARY_AUTH_FAILURE xmpp.protocol-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.protocol.xmpp_stream_error_conditions xmpp.protocol-module.html#xmpp_stream_error_conditions xmpp.protocol.NS_COMMANDS xmpp.protocol-module.html#NS_COMMANDS xmpp.protocol.ERR_PAYMENT_REQUIRED xmpp.protocol-module.html#ERR_PAYMENT_REQUIRED xmpp.protocol.NS_ADMIN_SET_MOTD xmpp.protocol-module.html#NS_ADMIN_SET_MOTD xmpp.protocol.STREAM_RESOURCE_CONSTRAINT xmpp.protocol-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.protocol.NS_SI_PUB xmpp.protocol-module.html#NS_SI_PUB xmpp.protocol.NS_MUC xmpp.protocol-module.html#NS_MUC xmpp.protocol.NS_ADMIN_EDIT_MOTD xmpp.protocol-module.html#NS_ADMIN_EDIT_MOTD xmpp.protocol.ERR_ITEM_NOT_FOUND xmpp.protocol-module.html#ERR_ITEM_NOT_FOUND xmpp.protocol.NS_TIME xmpp.protocol-module.html#NS_TIME xmpp.protocol.NS_SEARCH xmpp.protocol-module.html#NS_SEARCH xmpp.protocol.STREAM_REMOTE_CONNECTION_FAILED xmpp.protocol-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.protocol.NS_ADMIN_EDIT_WHITELIST xmpp.protocol-module.html#NS_ADMIN_EDIT_WHITELIST xmpp.protocol.NS_ADDRESS xmpp.protocol-module.html#NS_ADDRESS xmpp.protocol.NS_COMPONENT_ACCEPT xmpp.protocol-module.html#NS_COMPONENT_ACCEPT xmpp.protocol.STREAM_INVALID_ID xmpp.protocol-module.html#STREAM_INVALID_ID xmpp.protocol.NS_MUC_UNIQUE xmpp.protocol-module.html#NS_MUC_UNIQUE xmpp.protocol.ustr xmpp.simplexml-module.html#ustr xmpp.protocol.STREAM_RESTRICTED_XML xmpp.protocol-module.html#STREAM_RESTRICTED_XML xmpp.protocol.NS_DISCO_INFO xmpp.protocol-module.html#NS_DISCO_INFO xmpp.protocol.NS_LAST xmpp.protocol-module.html#NS_LAST xmpp.protocol.NS_ADMIN_GET_USER_LASTLOGIN xmpp.protocol-module.html#NS_ADMIN_GET_USER_LASTLOGIN xmpp.protocol.ERR_NOT_ACCEPTABLE xmpp.protocol-module.html#ERR_NOT_ACCEPTABLE xmpp.protocol.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.protocol-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.protocol.ERR_FORBIDDEN xmpp.protocol-module.html#ERR_FORBIDDEN xmpp.roster xmpp.roster-module.html xmpp.roster.STREAM_NOT_AUTHORIZED xmpp.roster-module.html#STREAM_NOT_AUTHORIZED xmpp.roster.STREAM_CONNECTION_TIMEOUT xmpp.roster-module.html#STREAM_CONNECTION_TIMEOUT xmpp.roster.STREAM_IMPROPER_ADDRESSING xmpp.roster-module.html#STREAM_IMPROPER_ADDRESSING xmpp.roster.ERR_GONE xmpp.roster-module.html#ERR_GONE xmpp.roster.ERR_CONFLICT xmpp.roster-module.html#ERR_CONFLICT xmpp.roster.ERR_NOT_AUTHORIZED xmpp.roster-module.html#ERR_NOT_AUTHORIZED xmpp.roster.ERR_REGISTRATION_REQUIRED xmpp.roster-module.html#ERR_REGISTRATION_REQUIRED xmpp.roster.ERR_INTERNAL_SERVER_ERROR xmpp.roster-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.roster.SASL_INCORRECT_ENCODING xmpp.roster-module.html#SASL_INCORRECT_ENCODING xmpp.roster.STREAM_UNSUPPORTED_ENCODING xmpp.roster-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.roster.ERR_REDIRECT xmpp.roster-module.html#ERR_REDIRECT xmpp.roster.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.roster.ERR_FEATURE_NOT_IMPLEMENTED xmpp.roster-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.roster.name xmpp.roster-module.html#name xmpp.roster.ERR_RESOURCE_CONSTRAINT xmpp.roster-module.html#ERR_RESOURCE_CONSTRAINT xmpp.roster.SASL_INVALID_AUTHZID xmpp.roster-module.html#SASL_INVALID_AUTHZID xmpp.roster.ERR_JID_MALFORMED xmpp.roster-module.html#ERR_JID_MALFORMED xmpp.roster.STREAM_CONFLICT xmpp.roster-module.html#STREAM_CONFLICT xmpp.roster.isResultNode xmpp.protocol-module.html#isResultNode xmpp.roster.ERR_SERVICE_UNAVAILABLE xmpp.roster-module.html#ERR_SERVICE_UNAVAILABLE xmpp.roster.STREAM_UNDEFINED_CONDITION xmpp.roster-module.html#STREAM_UNDEFINED_CONDITION xmpp.roster.ERRORS xmpp.roster-module.html#ERRORS xmpp.roster.STREAM_BAD_FORMAT xmpp.roster-module.html#STREAM_BAD_FORMAT xmpp.roster.SASL_ABORTED xmpp.roster-module.html#SASL_ABORTED xmpp.roster.STREAM_HOST_GONE xmpp.roster-module.html#STREAM_HOST_GONE xmpp.roster.ERR_UNDEFINED_CONDITION xmpp.roster-module.html#ERR_UNDEFINED_CONDITION xmpp.roster.STREAM_INVALID_FROM xmpp.roster-module.html#STREAM_INVALID_FROM xmpp.roster.ERR_REMOTE_SERVER_TIMEOUT xmpp.roster-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.roster.STREAM_SYSTEM_SHUTDOWN xmpp.roster-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.roster.STREAM_INVALID_NAMESPACE xmpp.roster-module.html#STREAM_INVALID_NAMESPACE xmpp.roster.STREAM_UNSUPPORTED_VERSION xmpp.roster-module.html#STREAM_UNSUPPORTED_VERSION xmpp.roster.SASL_NOT_AUTHORIZED xmpp.roster-module.html#SASL_NOT_AUTHORIZED xmpp.roster.ERR_REMOTE_SERVER_NOT_FOUND xmpp.roster-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.roster.ERR_SUBSCRIPTION_REQUIRED xmpp.roster-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.roster.STREAM_INTERNAL_SERVER_ERROR xmpp.roster-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.roster.STREAM_INVALID_XML xmpp.roster-module.html#STREAM_INVALID_XML xmpp.roster.ERR_NOT_ALLOWED xmpp.roster-module.html#ERR_NOT_ALLOWED xmpp.roster.STREAM_HOST_UNKNOWN xmpp.roster-module.html#STREAM_HOST_UNKNOWN xmpp.roster.ERR_BAD_REQUEST xmpp.roster-module.html#ERR_BAD_REQUEST xmpp.roster.SASL_MECHANISM_TOO_WEAK xmpp.roster-module.html#SASL_MECHANISM_TOO_WEAK xmpp.roster.STREAM_XML_NOT_WELL_FORMED xmpp.roster-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.roster.STREAM_POLICY_VIOLATION xmpp.roster-module.html#STREAM_POLICY_VIOLATION xmpp.roster.STREAM_SEE_OTHER_HOST xmpp.roster-module.html#STREAM_SEE_OTHER_HOST xmpp.roster.STREAM_BAD_NAMESPACE_PREFIX xmpp.roster-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.roster.SASL_INVALID_MECHANISM xmpp.roster-module.html#SASL_INVALID_MECHANISM xmpp.roster.ERR_UNEXPECTED_REQUEST xmpp.roster-module.html#ERR_UNEXPECTED_REQUEST xmpp.roster.ERR_RECIPIENT_UNAVAILABLE xmpp.roster-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.roster.SASL_TEMPORARY_AUTH_FAILURE xmpp.roster-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.roster.ERR_PAYMENT_REQUIRED xmpp.roster-module.html#ERR_PAYMENT_REQUIRED xmpp.roster.STREAM_RESTRICTED_XML xmpp.roster-module.html#STREAM_RESTRICTED_XML xmpp.roster.STREAM_RESOURCE_CONSTRAINT xmpp.roster-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.roster.ERR_ITEM_NOT_FOUND xmpp.roster-module.html#ERR_ITEM_NOT_FOUND xmpp.roster.STREAM_REMOTE_CONNECTION_FAILED xmpp.roster-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.roster.STREAM_INVALID_ID xmpp.roster-module.html#STREAM_INVALID_ID xmpp.roster.ustr xmpp.simplexml-module.html#ustr xmpp.roster.ERR_NOT_ACCEPTABLE xmpp.roster-module.html#ERR_NOT_ACCEPTABLE xmpp.roster.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.roster-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.roster.ERR_FORBIDDEN xmpp.roster-module.html#ERR_FORBIDDEN xmpp.session xmpp.session-module.html xmpp.session.STREAM_NOT_AUTHORIZED xmpp.session-module.html#STREAM_NOT_AUTHORIZED xmpp.session.STREAM_CONNECTION_TIMEOUT xmpp.session-module.html#STREAM_CONNECTION_TIMEOUT xmpp.session.STREAM_IMPROPER_ADDRESSING xmpp.session-module.html#STREAM_IMPROPER_ADDRESSING xmpp.session.ERR_GONE xmpp.session-module.html#ERR_GONE xmpp.session.ERR_CONFLICT xmpp.session-module.html#ERR_CONFLICT xmpp.session.ERR_NOT_AUTHORIZED xmpp.session-module.html#ERR_NOT_AUTHORIZED xmpp.session.STREAM__NOT_OPENED xmpp.session-module.html#STREAM__NOT_OPENED xmpp.session.ERR_REGISTRATION_REQUIRED xmpp.session-module.html#ERR_REGISTRATION_REQUIRED xmpp.session.ERR_INTERNAL_SERVER_ERROR xmpp.session-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.session.SASL_INCORRECT_ENCODING xmpp.session-module.html#SASL_INCORRECT_ENCODING xmpp.session.STREAM_UNSUPPORTED_ENCODING xmpp.session-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.session.ERR_REDIRECT xmpp.session-module.html#ERR_REDIRECT xmpp.session.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.session.ERR_FEATURE_NOT_IMPLEMENTED xmpp.session-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.session.name xmpp.session-module.html#name xmpp.session.ERR_RESOURCE_CONSTRAINT xmpp.session-module.html#ERR_RESOURCE_CONSTRAINT xmpp.session.SASL_INVALID_AUTHZID xmpp.session-module.html#SASL_INVALID_AUTHZID xmpp.session.ERR_JID_MALFORMED xmpp.session-module.html#ERR_JID_MALFORMED xmpp.session.SESSION_CLOSED xmpp.session-module.html#SESSION_CLOSED xmpp.session.isResultNode xmpp.protocol-module.html#isResultNode xmpp.session.STREAM_HOST_UNKNOWN xmpp.session-module.html#STREAM_HOST_UNKNOWN xmpp.session.ERR_SERVICE_UNAVAILABLE xmpp.session-module.html#ERR_SERVICE_UNAVAILABLE xmpp.session.STREAM_UNDEFINED_CONDITION xmpp.session-module.html#STREAM_UNDEFINED_CONDITION xmpp.session.ERRORS xmpp.session-module.html#ERRORS xmpp.session.STREAM_BAD_FORMAT xmpp.session-module.html#STREAM_BAD_FORMAT xmpp.session.SASL_ABORTED xmpp.session-module.html#SASL_ABORTED xmpp.session.STREAM__CLOSING xmpp.session-module.html#STREAM__CLOSING xmpp.session.STREAM_HOST_GONE xmpp.session-module.html#STREAM_HOST_GONE xmpp.session.ERR_UNDEFINED_CONDITION xmpp.session-module.html#ERR_UNDEFINED_CONDITION xmpp.session.STREAM_INVALID_FROM xmpp.session-module.html#STREAM_INVALID_FROM xmpp.session.SESSION_AUTHED xmpp.session-module.html#SESSION_AUTHED xmpp.session.SESSION_BOUND xmpp.session-module.html#SESSION_BOUND xmpp.session.ERR_REMOTE_SERVER_TIMEOUT xmpp.session-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.session.STREAM_SYSTEM_SHUTDOWN xmpp.session-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.session.STREAM_INVALID_NAMESPACE xmpp.session-module.html#STREAM_INVALID_NAMESPACE xmpp.session.STREAM_UNSUPPORTED_VERSION xmpp.session-module.html#STREAM_UNSUPPORTED_VERSION xmpp.session.SASL_NOT_AUTHORIZED xmpp.session-module.html#SASL_NOT_AUTHORIZED xmpp.session.ERR_REMOTE_SERVER_NOT_FOUND xmpp.session-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.session.ERR_SUBSCRIPTION_REQUIRED xmpp.session-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.session.STREAM_INTERNAL_SERVER_ERROR xmpp.session-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.session.SESSION_OPENED xmpp.session-module.html#SESSION_OPENED xmpp.session.STREAM_INVALID_XML xmpp.session-module.html#STREAM_INVALID_XML xmpp.session.ERR_NOT_ALLOWED xmpp.session-module.html#ERR_NOT_ALLOWED xmpp.session.STREAM__CLOSED xmpp.session-module.html#STREAM__CLOSED xmpp.session.STREAM_CONFLICT xmpp.session-module.html#STREAM_CONFLICT xmpp.session.SOCKET_ALIVE xmpp.session-module.html#SOCKET_ALIVE xmpp.session.ERR_BAD_REQUEST xmpp.session-module.html#ERR_BAD_REQUEST xmpp.session.SASL_MECHANISM_TOO_WEAK xmpp.session-module.html#SASL_MECHANISM_TOO_WEAK xmpp.session.STREAM_XML_NOT_WELL_FORMED xmpp.session-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.session.STREAM_POLICY_VIOLATION xmpp.session-module.html#STREAM_POLICY_VIOLATION xmpp.session.STREAM_SEE_OTHER_HOST xmpp.session-module.html#STREAM_SEE_OTHER_HOST xmpp.session.SOCKET_UNCONNECTED xmpp.session-module.html#SOCKET_UNCONNECTED xmpp.session.STREAM_BAD_NAMESPACE_PREFIX xmpp.session-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.session.SASL_INVALID_MECHANISM xmpp.session-module.html#SASL_INVALID_MECHANISM xmpp.session.SESSION_NOT_AUTHED xmpp.session-module.html#SESSION_NOT_AUTHED xmpp.session.ERR_UNEXPECTED_REQUEST xmpp.session-module.html#ERR_UNEXPECTED_REQUEST xmpp.session.ERR_RECIPIENT_UNAVAILABLE xmpp.session-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.session.SASL_TEMPORARY_AUTH_FAILURE xmpp.session-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.session.__version__ xmpp.session-module.html#__version__ xmpp.session.ERR_PAYMENT_REQUIRED xmpp.session-module.html#ERR_PAYMENT_REQUIRED xmpp.session.STREAM_RESOURCE_CONSTRAINT xmpp.session-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.session.ERR_ITEM_NOT_FOUND xmpp.session-module.html#ERR_ITEM_NOT_FOUND xmpp.session.STREAM__OPENED xmpp.session-module.html#STREAM__OPENED xmpp.session.STREAM_REMOTE_CONNECTION_FAILED xmpp.session-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.session.STREAM_INVALID_ID xmpp.session-module.html#STREAM_INVALID_ID xmpp.session.ustr xmpp.simplexml-module.html#ustr xmpp.session.STREAM_RESTRICTED_XML xmpp.session-module.html#STREAM_RESTRICTED_XML xmpp.session.ERR_NOT_ACCEPTABLE xmpp.session-module.html#ERR_NOT_ACCEPTABLE xmpp.session.SOCKET_DEAD xmpp.session-module.html#SOCKET_DEAD xmpp.session.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.session-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.session.ERR_FORBIDDEN xmpp.session-module.html#ERR_FORBIDDEN xmpp.simplexml xmpp.simplexml-module.html xmpp.simplexml.BadXML2Node xmpp.simplexml-module.html#BadXML2Node xmpp.simplexml.ustr xmpp.simplexml-module.html#ustr xmpp.simplexml.ENCODING xmpp.simplexml-module.html#ENCODING xmpp.simplexml.DBG_NODEBUILDER xmpp.simplexml-module.html#DBG_NODEBUILDER xmpp.simplexml.XMLescape xmpp.simplexml-module.html#XMLescape xmpp.simplexml.XML2Node xmpp.simplexml-module.html#XML2Node xmpp.transports xmpp.transports-module.html xmpp.transports.STREAM_NOT_AUTHORIZED xmpp.transports-module.html#STREAM_NOT_AUTHORIZED xmpp.transports.DATA_SENT xmpp.transports-module.html#DATA_SENT xmpp.transports.STREAM_CONNECTION_TIMEOUT xmpp.transports-module.html#STREAM_CONNECTION_TIMEOUT xmpp.transports.STREAM_IMPROPER_ADDRESSING xmpp.transports-module.html#STREAM_IMPROPER_ADDRESSING xmpp.transports.ERR_GONE xmpp.transports-module.html#ERR_GONE xmpp.transports.ERR_CONFLICT xmpp.transports-module.html#ERR_CONFLICT xmpp.transports.ERR_NOT_AUTHORIZED xmpp.transports-module.html#ERR_NOT_AUTHORIZED xmpp.transports.ERR_REGISTRATION_REQUIRED xmpp.transports-module.html#ERR_REGISTRATION_REQUIRED xmpp.transports.ERR_INTERNAL_SERVER_ERROR xmpp.transports-module.html#ERR_INTERNAL_SERVER_ERROR xmpp.transports.SASL_INCORRECT_ENCODING xmpp.transports-module.html#SASL_INCORRECT_ENCODING xmpp.transports.STREAM_UNSUPPORTED_ENCODING xmpp.transports-module.html#STREAM_UNSUPPORTED_ENCODING xmpp.transports.ERR_REDIRECT xmpp.transports-module.html#ERR_REDIRECT xmpp.transports.isErrorNode xmpp.protocol-module.html#isErrorNode xmpp.transports.ERR_FEATURE_NOT_IMPLEMENTED xmpp.transports-module.html#ERR_FEATURE_NOT_IMPLEMENTED xmpp.transports.name xmpp.transports-module.html#name xmpp.transports.HAVE_PYDNS xmpp.transports-module.html#HAVE_PYDNS xmpp.transports.ERR_RESOURCE_CONSTRAINT xmpp.transports-module.html#ERR_RESOURCE_CONSTRAINT xmpp.transports.SASL_INVALID_AUTHZID xmpp.transports-module.html#SASL_INVALID_AUTHZID xmpp.transports.ERR_JID_MALFORMED xmpp.transports-module.html#ERR_JID_MALFORMED xmpp.transports.STREAM_CONFLICT xmpp.transports-module.html#STREAM_CONFLICT xmpp.transports.isResultNode xmpp.protocol-module.html#isResultNode xmpp.transports.ERR_SERVICE_UNAVAILABLE xmpp.transports-module.html#ERR_SERVICE_UNAVAILABLE xmpp.transports.STREAM_UNDEFINED_CONDITION xmpp.transports-module.html#STREAM_UNDEFINED_CONDITION xmpp.transports.ERRORS xmpp.transports-module.html#ERRORS xmpp.transports.STREAM_BAD_FORMAT xmpp.transports-module.html#STREAM_BAD_FORMAT xmpp.transports.SASL_ABORTED xmpp.transports-module.html#SASL_ABORTED xmpp.transports.STREAM_HOST_GONE xmpp.transports-module.html#STREAM_HOST_GONE xmpp.transports.ERR_UNDEFINED_CONDITION xmpp.transports-module.html#ERR_UNDEFINED_CONDITION xmpp.transports.STREAM_INVALID_FROM xmpp.transports-module.html#STREAM_INVALID_FROM xmpp.transports.DATA_RECEIVED xmpp.transports-module.html#DATA_RECEIVED xmpp.transports.ERR_REMOTE_SERVER_TIMEOUT xmpp.transports-module.html#ERR_REMOTE_SERVER_TIMEOUT xmpp.transports.STREAM_SYSTEM_SHUTDOWN xmpp.transports-module.html#STREAM_SYSTEM_SHUTDOWN xmpp.transports.STREAM_INVALID_NAMESPACE xmpp.transports-module.html#STREAM_INVALID_NAMESPACE xmpp.transports.STREAM_UNSUPPORTED_VERSION xmpp.transports-module.html#STREAM_UNSUPPORTED_VERSION xmpp.transports.SASL_NOT_AUTHORIZED xmpp.transports-module.html#SASL_NOT_AUTHORIZED xmpp.transports.DBG_CONNECT_PROXY xmpp.transports-module.html#DBG_CONNECT_PROXY xmpp.transports.ERR_REMOTE_SERVER_NOT_FOUND xmpp.transports-module.html#ERR_REMOTE_SERVER_NOT_FOUND xmpp.transports.ERR_SUBSCRIPTION_REQUIRED xmpp.transports-module.html#ERR_SUBSCRIPTION_REQUIRED xmpp.transports.STREAM_INTERNAL_SERVER_ERROR xmpp.transports-module.html#STREAM_INTERNAL_SERVER_ERROR xmpp.transports.BUFLEN xmpp.transports-module.html#BUFLEN xmpp.transports.STREAM_INVALID_XML xmpp.transports-module.html#STREAM_INVALID_XML xmpp.transports.ERR_NOT_ALLOWED xmpp.transports-module.html#ERR_NOT_ALLOWED xmpp.transports.STREAM_HOST_UNKNOWN xmpp.transports-module.html#STREAM_HOST_UNKNOWN xmpp.transports.ERR_BAD_REQUEST xmpp.transports-module.html#ERR_BAD_REQUEST xmpp.transports.SASL_MECHANISM_TOO_WEAK xmpp.transports-module.html#SASL_MECHANISM_TOO_WEAK xmpp.transports.STREAM_XML_NOT_WELL_FORMED xmpp.transports-module.html#STREAM_XML_NOT_WELL_FORMED xmpp.transports.STREAM_POLICY_VIOLATION xmpp.transports-module.html#STREAM_POLICY_VIOLATION xmpp.transports.STREAM_SEE_OTHER_HOST xmpp.transports-module.html#STREAM_SEE_OTHER_HOST xmpp.transports.STREAM_BAD_NAMESPACE_PREFIX xmpp.transports-module.html#STREAM_BAD_NAMESPACE_PREFIX xmpp.transports.SASL_INVALID_MECHANISM xmpp.transports-module.html#SASL_INVALID_MECHANISM xmpp.transports.ERR_UNEXPECTED_REQUEST xmpp.transports-module.html#ERR_UNEXPECTED_REQUEST xmpp.transports.ERR_RECIPIENT_UNAVAILABLE xmpp.transports-module.html#ERR_RECIPIENT_UNAVAILABLE xmpp.transports.SASL_TEMPORARY_AUTH_FAILURE xmpp.transports-module.html#SASL_TEMPORARY_AUTH_FAILURE xmpp.transports.ERR_PAYMENT_REQUIRED xmpp.transports-module.html#ERR_PAYMENT_REQUIRED xmpp.transports.STREAM_RESTRICTED_XML xmpp.transports-module.html#STREAM_RESTRICTED_XML xmpp.transports.STREAM_RESOURCE_CONSTRAINT xmpp.transports-module.html#STREAM_RESOURCE_CONSTRAINT xmpp.transports.HAVE_DNSPYTHON xmpp.transports-module.html#HAVE_DNSPYTHON xmpp.transports.ERR_ITEM_NOT_FOUND xmpp.transports-module.html#ERR_ITEM_NOT_FOUND xmpp.transports.STREAM_REMOTE_CONNECTION_FAILED xmpp.transports-module.html#STREAM_REMOTE_CONNECTION_FAILED xmpp.transports.STREAM_INVALID_ID xmpp.transports-module.html#STREAM_INVALID_ID xmpp.transports.ustr xmpp.simplexml-module.html#ustr xmpp.transports.ERR_NOT_ACCEPTABLE xmpp.transports-module.html#ERR_NOT_ACCEPTABLE xmpp.transports.STREAM_UNSUPPORTED_STANZA_TYPE xmpp.transports-module.html#STREAM_UNSUPPORTED_STANZA_TYPE xmpp.transports.ERR_FORBIDDEN xmpp.transports-module.html#ERR_FORBIDDEN xmpp.auth.Bind xmpp.auth.Bind-class.html xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.auth.Bind.plugin xmpp.auth.Bind-class.html#plugin xmpp.auth.Bind.Bind xmpp.auth.Bind-class.html#Bind xmpp.auth.Bind.plugout xmpp.auth.Bind-class.html#plugout xmpp.auth.Bind.FeaturesHandler xmpp.auth.Bind-class.html#FeaturesHandler xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.auth.Bind.__init__ xmpp.auth.Bind-class.html#__init__ xmpp.auth.ComponentBind xmpp.auth.ComponentBind-class.html xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.auth.ComponentBind.plugin xmpp.auth.ComponentBind-class.html#plugin xmpp.auth.ComponentBind.Bind xmpp.auth.ComponentBind-class.html#Bind xmpp.auth.ComponentBind.plugout xmpp.auth.ComponentBind-class.html#plugout xmpp.auth.ComponentBind.BindHandler xmpp.auth.ComponentBind-class.html#BindHandler xmpp.auth.ComponentBind.FeaturesHandler xmpp.auth.ComponentBind-class.html#FeaturesHandler xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.auth.ComponentBind.__init__ xmpp.auth.ComponentBind-class.html#__init__ xmpp.auth.NonSASL xmpp.auth.NonSASL-class.html xmpp.auth.NonSASL.authComponent xmpp.auth.NonSASL-class.html#authComponent xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.auth.NonSASL.plugin xmpp.auth.NonSASL-class.html#plugin xmpp.auth.NonSASL.handshakeHandler xmpp.auth.NonSASL-class.html#handshakeHandler xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.auth.NonSASL.__init__ xmpp.auth.NonSASL-class.html#__init__ xmpp.auth.SASL xmpp.auth.SASL-class.html xmpp.auth.SASL.SASLHandler xmpp.auth.SASL-class.html#SASLHandler xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.auth.SASL.plugin xmpp.auth.SASL-class.html#plugin xmpp.auth.SASL.plugout xmpp.auth.SASL-class.html#plugout xmpp.auth.SASL.auth xmpp.auth.SASL-class.html#auth xmpp.auth.SASL.FeaturesHandler xmpp.auth.SASL-class.html#FeaturesHandler xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.auth.SASL.__init__ xmpp.auth.SASL-class.html#__init__ xmpp.browser.Browser xmpp.browser.Browser-class.html xmpp.browser.Browser.plugout xmpp.browser.Browser-class.html#plugout xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.browser.Browser.getDiscoHandler xmpp.browser.Browser-class.html#getDiscoHandler xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.browser.Browser.plugin xmpp.browser.Browser-class.html#plugin xmpp.browser.Browser._traversePath xmpp.browser.Browser-class.html#_traversePath xmpp.browser.Browser.setDiscoHandler xmpp.browser.Browser-class.html#setDiscoHandler xmpp.browser.Browser._DiscoveryHandler xmpp.browser.Browser-class.html#_DiscoveryHandler xmpp.browser.Browser.delDiscoHandler xmpp.browser.Browser-class.html#delDiscoHandler xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.browser.Browser.__init__ xmpp.browser.Browser-class.html#__init__ xmpp.client.Client xmpp.client.Client-class.html xmpp.client.Client.getRoster xmpp.client.Client-class.html#getRoster xmpp.client.CommonClient.disconnected xmpp.client.CommonClient-class.html#disconnected xmpp.client.CommonClient.UnregisterDisconnectHandler xmpp.client.CommonClient-class.html#UnregisterDisconnectHandler xmpp.client.CommonClient.RegisterDisconnectHandler xmpp.client.CommonClient-class.html#RegisterDisconnectHandler xmpp.client.Client.sendPresence xmpp.client.Client-class.html#sendPresence xmpp.client.Client.auth xmpp.client.Client-class.html#auth xmpp.client.CommonClient.event xmpp.client.CommonClient-class.html#event xmpp.client.CommonClient.isConnected xmpp.client.CommonClient-class.html#isConnected xmpp.client.Client.connect xmpp.client.Client-class.html#connect xmpp.client.CommonClient.DisconnectHandler xmpp.client.CommonClient-class.html#DisconnectHandler xmpp.client.Client.sendInitPresence xmpp.client.Client-class.html#sendInitPresence xmpp.client.CommonClient.reconnectAndReauth xmpp.client.CommonClient-class.html#reconnectAndReauth xmpp.client.CommonClient.__init__ xmpp.client.CommonClient-class.html#__init__ xmpp.client.CommonClient xmpp.client.CommonClient-class.html xmpp.client.CommonClient.disconnected xmpp.client.CommonClient-class.html#disconnected xmpp.client.CommonClient.UnregisterDisconnectHandler xmpp.client.CommonClient-class.html#UnregisterDisconnectHandler xmpp.client.CommonClient.RegisterDisconnectHandler xmpp.client.CommonClient-class.html#RegisterDisconnectHandler xmpp.client.CommonClient.isConnected xmpp.client.CommonClient-class.html#isConnected xmpp.client.CommonClient.reconnectAndReauth xmpp.client.CommonClient-class.html#reconnectAndReauth xmpp.client.CommonClient.connect xmpp.client.CommonClient-class.html#connect xmpp.client.CommonClient.DisconnectHandler xmpp.client.CommonClient-class.html#DisconnectHandler xmpp.client.CommonClient.event xmpp.client.CommonClient-class.html#event xmpp.client.CommonClient.__init__ xmpp.client.CommonClient-class.html#__init__ xmpp.client.Component xmpp.client.Component-class.html xmpp.client.Component.dobind xmpp.client.Component-class.html#dobind xmpp.client.CommonClient.disconnected xmpp.client.CommonClient-class.html#disconnected xmpp.client.CommonClient.UnregisterDisconnectHandler xmpp.client.CommonClient-class.html#UnregisterDisconnectHandler xmpp.client.CommonClient.RegisterDisconnectHandler xmpp.client.CommonClient-class.html#RegisterDisconnectHandler xmpp.client.Component.auth xmpp.client.Component-class.html#auth xmpp.client.CommonClient.event xmpp.client.CommonClient-class.html#event xmpp.client.CommonClient.isConnected xmpp.client.CommonClient-class.html#isConnected xmpp.client.Component.connect xmpp.client.Component-class.html#connect xmpp.client.CommonClient.DisconnectHandler xmpp.client.CommonClient-class.html#DisconnectHandler xmpp.client.CommonClient.reconnectAndReauth xmpp.client.CommonClient-class.html#reconnectAndReauth xmpp.client.Component.__init__ xmpp.client.Component-class.html#__init__ xmpp.client.PlugIn xmpp.client.PlugIn-class.html xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.client.PlugIn.__init__ xmpp.client.PlugIn-class.html#__init__ xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.commands.Command_Handler_Prototype xmpp.commands.Command_Handler_Prototype-class.html xmpp.commands.Command_Handler_Prototype.count xmpp.commands.Command_Handler_Prototype-class.html#count xmpp.commands.Command_Handler_Prototype._DiscoHandler xmpp.commands.Command_Handler_Prototype-class.html#_DiscoHandler xmpp.commands.Command_Handler_Prototype.Execute xmpp.commands.Command_Handler_Prototype-class.html#Execute xmpp.commands.Command_Handler_Prototype.description xmpp.commands.Command_Handler_Prototype-class.html#description xmpp.commands.Command_Handler_Prototype.plugout xmpp.commands.Command_Handler_Prototype-class.html#plugout xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.commands.Command_Handler_Prototype.plugin xmpp.commands.Command_Handler_Prototype-class.html#plugin xmpp.commands.Command_Handler_Prototype.discofeatures xmpp.commands.Command_Handler_Prototype-class.html#discofeatures xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.commands.Command_Handler_Prototype.getSessionID xmpp.commands.Command_Handler_Prototype-class.html#getSessionID xmpp.commands.Command_Handler_Prototype.__init__ xmpp.commands.Command_Handler_Prototype-class.html#__init__ xmpp.commands.Command_Handler_Prototype.name xmpp.commands.Command_Handler_Prototype-class.html#name xmpp.commands.Commands xmpp.commands.Commands-class.html xmpp.commands.Commands._DiscoHandler xmpp.commands.Commands-class.html#_DiscoHandler xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.commands.Commands.plugin xmpp.commands.Commands-class.html#plugin xmpp.commands.Commands.addCommand xmpp.commands.Commands-class.html#addCommand xmpp.commands.Commands.plugout xmpp.commands.Commands-class.html#plugout xmpp.commands.Commands.delCommand xmpp.commands.Commands-class.html#delCommand xmpp.commands.Commands.getCommand xmpp.commands.Commands-class.html#getCommand xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.commands.Commands._CommandHandler xmpp.commands.Commands-class.html#_CommandHandler xmpp.commands.Commands.__init__ xmpp.commands.Commands-class.html#__init__ xmpp.commands.TestCommand xmpp.commands.TestCommand-class.html xmpp.commands.Command_Handler_Prototype.count xmpp.commands.Command_Handler_Prototype-class.html#count xmpp.commands.Command_Handler_Prototype._DiscoHandler xmpp.commands.Command_Handler_Prototype-class.html#_DiscoHandler xmpp.commands.Command_Handler_Prototype.Execute xmpp.commands.Command_Handler_Prototype-class.html#Execute xmpp.commands.TestCommand.description xmpp.commands.TestCommand-class.html#description xmpp.commands.Command_Handler_Prototype.plugout xmpp.commands.Command_Handler_Prototype-class.html#plugout xmpp.commands.TestCommand.cmdSecondStage xmpp.commands.TestCommand-class.html#cmdSecondStage xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.commands.Command_Handler_Prototype.plugin xmpp.commands.Command_Handler_Prototype-class.html#plugin xmpp.commands.TestCommand.cmdThirdStage xmpp.commands.TestCommand-class.html#cmdThirdStage xmpp.commands.TestCommand.cmdCancel xmpp.commands.TestCommand-class.html#cmdCancel xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.commands.Command_Handler_Prototype.discofeatures xmpp.commands.Command_Handler_Prototype-class.html#discofeatures xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.commands.TestCommand.cmdSecondStageReply xmpp.commands.TestCommand-class.html#cmdSecondStageReply xmpp.commands.Command_Handler_Prototype.getSessionID xmpp.commands.Command_Handler_Prototype-class.html#getSessionID xmpp.commands.TestCommand.cmdFirstStage xmpp.commands.TestCommand-class.html#cmdFirstStage xmpp.commands.TestCommand.__init__ xmpp.commands.TestCommand-class.html#__init__ xmpp.commands.TestCommand.name xmpp.commands.TestCommand-class.html#name xmpp.debug.Debug xmpp.debug.Debug-class.html xmpp.debug.Debug._append_unique_str xmpp.debug.Debug-class.html#_append_unique_str xmpp.debug.Debug._validate_flag xmpp.debug.Debug-class.html#_validate_flag xmpp.debug.Debug.Show xmpp.debug.Debug-class.html#Show xmpp.debug.Debug.active_get xmpp.debug.Debug-class.html#active_get xmpp.debug.Debug.show xmpp.debug.Debug-class.html#show xmpp.debug.Debug.is_active xmpp.debug.Debug-class.html#is_active xmpp.debug.Debug.active_set xmpp.debug.Debug-class.html#active_set xmpp.debug.Debug.colors xmpp.debug.Debug-class.html#colors xmpp.debug.Debug._remove_dupe_flags xmpp.debug.Debug-class.html#_remove_dupe_flags xmpp.debug.Debug._as_one_list xmpp.debug.Debug-class.html#_as_one_list xmpp.debug.Debug.__init__ xmpp.debug.Debug-class.html#__init__ xmpp.debug.NoDebug xmpp.debug.NoDebug-class.html xmpp.debug.NoDebug.show xmpp.debug.NoDebug-class.html#show xmpp.debug.NoDebug.Show xmpp.debug.NoDebug-class.html#Show xmpp.debug.NoDebug.is_active xmpp.debug.NoDebug-class.html#is_active xmpp.debug.NoDebug.active_set xmpp.debug.NoDebug-class.html#active_set xmpp.debug.NoDebug.colors xmpp.debug.NoDebug-class.html#colors xmpp.debug.NoDebug.__init__ xmpp.debug.NoDebug-class.html#__init__ xmpp.dispatcher.Dispatcher xmpp.dispatcher.Dispatcher-class.html xmpp.dispatcher.Dispatcher.restoreHandlers xmpp.dispatcher.Dispatcher-class.html#restoreHandlers xmpp.dispatcher.Dispatcher.plugout xmpp.dispatcher.Dispatcher-class.html#plugout xmpp.dispatcher.Dispatcher._init xmpp.dispatcher.Dispatcher-class.html#_init xmpp.dispatcher.Dispatcher.dispatch xmpp.dispatcher.Dispatcher-class.html#dispatch xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.dispatcher.Dispatcher.RegisterHandlerOnce xmpp.dispatcher.Dispatcher-class.html#RegisterHandlerOnce xmpp.dispatcher.Dispatcher.__init__ xmpp.dispatcher.Dispatcher-class.html#__init__ xmpp.dispatcher.Dispatcher.RegisterDefaultHandler xmpp.dispatcher.Dispatcher-class.html#RegisterDefaultHandler xmpp.dispatcher.Dispatcher.SendAndCallForResponse xmpp.dispatcher.Dispatcher-class.html#SendAndCallForResponse xmpp.dispatcher.Dispatcher.UnregisterHandler xmpp.dispatcher.Dispatcher-class.html#UnregisterHandler xmpp.dispatcher.Dispatcher.disconnect xmpp.dispatcher.Dispatcher-class.html#disconnect xmpp.dispatcher.Dispatcher.RegisterNamespace xmpp.dispatcher.Dispatcher-class.html#RegisterNamespace xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.dispatcher.Dispatcher.dumpHandlers xmpp.dispatcher.Dispatcher-class.html#dumpHandlers xmpp.dispatcher.Dispatcher.UnregisterCycleHandler xmpp.dispatcher.Dispatcher-class.html#UnregisterCycleHandler xmpp.dispatcher.Dispatcher.SendAndWaitForResponse xmpp.dispatcher.Dispatcher-class.html#SendAndWaitForResponse xmpp.dispatcher.Dispatcher.send xmpp.dispatcher.Dispatcher-class.html#send xmpp.dispatcher.Dispatcher.RegisterEventHandler xmpp.dispatcher.Dispatcher-class.html#RegisterEventHandler xmpp.dispatcher.Dispatcher.StreamInit xmpp.dispatcher.Dispatcher-class.html#StreamInit xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.dispatcher.Dispatcher.RegisterCycleHandler xmpp.dispatcher.Dispatcher-class.html#RegisterCycleHandler xmpp.dispatcher.Dispatcher.streamErrorHandler xmpp.dispatcher.Dispatcher-class.html#streamErrorHandler xmpp.dispatcher.Dispatcher.RegisterNamespaceHandler xmpp.dispatcher.Dispatcher-class.html#RegisterNamespaceHandler xmpp.dispatcher.Dispatcher.RegisterProtocol xmpp.dispatcher.Dispatcher-class.html#RegisterProtocol xmpp.dispatcher.Dispatcher._check_stream_start xmpp.dispatcher.Dispatcher-class.html#_check_stream_start xmpp.dispatcher.Dispatcher.plugin xmpp.dispatcher.Dispatcher-class.html#plugin xmpp.dispatcher.Dispatcher.Process xmpp.dispatcher.Dispatcher-class.html#Process xmpp.dispatcher.Dispatcher.WaitForResponse xmpp.dispatcher.Dispatcher-class.html#WaitForResponse xmpp.dispatcher.Dispatcher.returnStanzaHandler xmpp.dispatcher.Dispatcher-class.html#returnStanzaHandler xmpp.dispatcher.Dispatcher.RegisterHandler xmpp.dispatcher.Dispatcher-class.html#RegisterHandler xmpp.dispatcher.Dispatcher.Event xmpp.dispatcher.Dispatcher-class.html#Event xmpp.filetransfer.IBB xmpp.filetransfer.IBB-class.html xmpp.filetransfer.IBB.OpenStream xmpp.filetransfer.IBB-class.html#OpenStream xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.filetransfer.IBB.StreamOpenReplyHandler xmpp.filetransfer.IBB-class.html#StreamOpenReplyHandler xmpp.filetransfer.IBB.plugin xmpp.filetransfer.IBB-class.html#plugin xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.filetransfer.IBB.SendHandler xmpp.filetransfer.IBB-class.html#SendHandler xmpp.filetransfer.IBB.StreamBrokenHandler xmpp.filetransfer.IBB-class.html#StreamBrokenHandler xmpp.filetransfer.IBB.IqHandler xmpp.filetransfer.IBB-class.html#IqHandler xmpp.filetransfer.IBB.ReceiveHandler xmpp.filetransfer.IBB-class.html#ReceiveHandler xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.filetransfer.IBB.StreamCloseHandler xmpp.filetransfer.IBB-class.html#StreamCloseHandler xmpp.filetransfer.IBB.StreamOpenHandler xmpp.filetransfer.IBB-class.html#StreamOpenHandler xmpp.filetransfer.IBB.__init__ xmpp.filetransfer.IBB-class.html#__init__ xmpp.protocol.BadFormat xmpp.protocol.BadFormat-class.html xmpp.protocol.BadNamespacePrefix xmpp.protocol.BadNamespacePrefix-class.html xmpp.protocol.Conflict xmpp.protocol.Conflict-class.html xmpp.protocol.ConnectionTimeout xmpp.protocol.ConnectionTimeout-class.html xmpp.protocol.DataField xmpp.protocol.DataField-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.protocol.DataField.setLabel xmpp.protocol.DataField-class.html#setLabel xmpp.protocol.DataField.addOption xmpp.protocol.DataField-class.html#addOption xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.protocol.DataField.getValues xmpp.protocol.DataField-class.html#getValues xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.DataField.getLabel xmpp.protocol.DataField-class.html#getLabel xmpp.protocol.DataField.getOptions xmpp.protocol.DataField-class.html#getOptions xmpp.protocol.DataField.setVar xmpp.protocol.DataField-class.html#setVar xmpp.protocol.DataField.__init__ xmpp.protocol.DataField-class.html#__init__ xmpp.protocol.DataField.setType xmpp.protocol.DataField-class.html#setType xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.protocol.DataField.getDesc xmpp.protocol.DataField-class.html#getDesc xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.protocol.DataField.getVar xmpp.protocol.DataField-class.html#getVar xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.protocol.DataField.setDesc xmpp.protocol.DataField-class.html#setDesc xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.protocol.DataField.setValue xmpp.protocol.DataField-class.html#setValue xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.DataField.setRequired xmpp.protocol.DataField-class.html#setRequired xmpp.protocol.DataField.getType xmpp.protocol.DataField-class.html#getType xmpp.protocol.DataField.setOptions xmpp.protocol.DataField-class.html#setOptions xmpp.protocol.DataField.isRequired xmpp.protocol.DataField-class.html#isRequired xmpp.simplexml.Node.__setitem__ xmpp.simplexml.Node-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.protocol.DataField.setValues xmpp.protocol.DataField-class.html#setValues xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.protocol.DataField.getValue xmpp.protocol.DataField-class.html#getValue xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.protocol.DataField.addValue xmpp.protocol.DataField-class.html#addValue xmpp.protocol.DataForm xmpp.protocol.DataForm-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.protocol.DataForm.setTitle xmpp.protocol.DataForm-class.html#setTitle xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.DataForm.setField xmpp.protocol.DataForm-class.html#setField xmpp.protocol.DataForm.__init__ xmpp.protocol.DataForm-class.html#__init__ xmpp.protocol.DataForm.setType xmpp.protocol.DataForm-class.html#setType xmpp.protocol.DataForm.asDict xmpp.protocol.DataForm-class.html#asDict xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.protocol.DataForm.setInstructions xmpp.protocol.DataForm-class.html#setInstructions xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.protocol.DataForm.__getitem__ xmpp.protocol.DataForm-class.html#__getitem__ xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.DataForm.getType xmpp.protocol.DataForm-class.html#getType xmpp.protocol.DataForm.__setitem__ xmpp.protocol.DataForm-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.protocol.DataForm.getTitle xmpp.protocol.DataForm-class.html#getTitle xmpp.protocol.DataForm.getInstructions xmpp.protocol.DataForm-class.html#getInstructions xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.protocol.DataForm.getField xmpp.protocol.DataForm-class.html#getField xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.protocol.DataForm.addInstructions xmpp.protocol.DataForm-class.html#addInstructions xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.protocol.Error xmpp.protocol.Error-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.protocol.Protocol.setFrom xmpp.protocol.Protocol-class.html#setFrom xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.protocol.Protocol.getID xmpp.protocol.Protocol-class.html#getID xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.Protocol.setTo xmpp.protocol.Protocol-class.html#setTo xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.protocol.Protocol.setError xmpp.protocol.Protocol-class.html#setError xmpp.protocol.Error.__init__ xmpp.protocol.Error-class.html#__init__ xmpp.protocol.Protocol.setType xmpp.protocol.Protocol-class.html#setType xmpp.protocol.Protocol.getTo xmpp.protocol.Protocol-class.html#getTo xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.protocol.Protocol.getError xmpp.protocol.Protocol-class.html#getError xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.protocol.Protocol.getFrom xmpp.protocol.Protocol-class.html#getFrom xmpp.protocol.Protocol.setTimestamp xmpp.protocol.Protocol-class.html#setTimestamp xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.protocol.Protocol.getTimestamp xmpp.protocol.Protocol-class.html#getTimestamp xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.protocol.Protocol.getErrorCode xmpp.protocol.Protocol-class.html#getErrorCode xmpp.protocol.Error.__dupstr__ xmpp.protocol.Error-class.html#__dupstr__ xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.Protocol.getType xmpp.protocol.Protocol-class.html#getType xmpp.protocol.Protocol.__setitem__ xmpp.protocol.Protocol-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.protocol.Protocol.setID xmpp.protocol.Protocol-class.html#setID xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.protocol.Protocol.getProperties xmpp.protocol.Protocol-class.html#getProperties xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.protocol.ErrorNode xmpp.protocol.ErrorNode-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.ErrorNode.__init__ xmpp.protocol.ErrorNode-class.html#__init__ xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.simplexml.Node.__setitem__ xmpp.simplexml.Node-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.protocol.HostGone xmpp.protocol.HostGone-class.html xmpp.protocol.HostUnknown xmpp.protocol.HostUnknown-class.html xmpp.protocol.ImproperAddressing xmpp.protocol.ImproperAddressing-class.html xmpp.protocol.InternalServerError xmpp.protocol.InternalServerError-class.html xmpp.protocol.InvalidFrom xmpp.protocol.InvalidFrom-class.html xmpp.protocol.InvalidID xmpp.protocol.InvalidID-class.html xmpp.protocol.InvalidNamespace xmpp.protocol.InvalidNamespace-class.html xmpp.protocol.InvalidXML xmpp.protocol.InvalidXML-class.html xmpp.protocol.Iq xmpp.protocol.Iq-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.protocol.Protocol.setFrom xmpp.protocol.Protocol-class.html#setFrom xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.protocol.Protocol.getID xmpp.protocol.Protocol-class.html#getID xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.Protocol.setTo xmpp.protocol.Protocol-class.html#setTo xmpp.protocol.Iq.getQueryNS xmpp.protocol.Iq-class.html#getQueryNS xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.protocol.Protocol.setError xmpp.protocol.Protocol-class.html#setError xmpp.protocol.Iq.__init__ xmpp.protocol.Iq-class.html#__init__ xmpp.protocol.Protocol.setType xmpp.protocol.Protocol-class.html#setType xmpp.protocol.Protocol.getTo xmpp.protocol.Protocol-class.html#getTo xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.protocol.Protocol.getError xmpp.protocol.Protocol-class.html#getError xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.protocol.Protocol.getFrom xmpp.protocol.Protocol-class.html#getFrom xmpp.protocol.Protocol.setTimestamp xmpp.protocol.Protocol-class.html#setTimestamp xmpp.protocol.Iq.getQueryPayload xmpp.protocol.Iq-class.html#getQueryPayload xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.protocol.Protocol.getTimestamp xmpp.protocol.Protocol-class.html#getTimestamp xmpp.protocol.Iq.setQueryPayload xmpp.protocol.Iq-class.html#setQueryPayload xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.protocol.Protocol.getErrorCode xmpp.protocol.Protocol-class.html#getErrorCode xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.protocol.Iq.buildReply xmpp.protocol.Iq-class.html#buildReply xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.Protocol.getType xmpp.protocol.Protocol-class.html#getType xmpp.protocol.Iq.getQueryChildren xmpp.protocol.Iq-class.html#getQueryChildren xmpp.protocol.Protocol.__setitem__ xmpp.protocol.Protocol-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.protocol.Protocol.setID xmpp.protocol.Protocol-class.html#setID xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.protocol.Iq.getQuerynode xmpp.protocol.Iq-class.html#getQuerynode xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.protocol.Protocol.getProperties xmpp.protocol.Protocol-class.html#getProperties xmpp.protocol.Iq.setQueryNS xmpp.protocol.Iq-class.html#setQueryNS xmpp.protocol.Iq.setQuerynode xmpp.protocol.Iq-class.html#setQuerynode xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.protocol.JID xmpp.protocol.JID-class.html xmpp.protocol.JID.getDomain xmpp.protocol.JID-class.html#getDomain xmpp.protocol.JID.bareMatch xmpp.protocol.JID-class.html#bareMatch xmpp.protocol.JID.setNode xmpp.protocol.JID-class.html#setNode xmpp.protocol.JID.getStripped xmpp.protocol.JID-class.html#getStripped xmpp.protocol.JID.setResource xmpp.protocol.JID-class.html#setResource xmpp.protocol.JID.__str__ xmpp.protocol.JID-class.html#__str__ xmpp.protocol.JID.getResource xmpp.protocol.JID-class.html#getResource xmpp.protocol.JID.setDomain xmpp.protocol.JID-class.html#setDomain xmpp.protocol.JID.__hash__ xmpp.protocol.JID-class.html#__hash__ xmpp.protocol.JID.__ne__ xmpp.protocol.JID-class.html#__ne__ xmpp.protocol.JID.__eq__ xmpp.protocol.JID-class.html#__eq__ xmpp.protocol.JID.__init__ xmpp.protocol.JID-class.html#__init__ xmpp.protocol.JID.getNode xmpp.protocol.JID-class.html#getNode xmpp.protocol.Message xmpp.protocol.Message-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.protocol.Message.getSubject xmpp.protocol.Message-class.html#getSubject xmpp.protocol.Protocol.setFrom xmpp.protocol.Protocol-class.html#setFrom xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.protocol.Protocol.getID xmpp.protocol.Protocol-class.html#getID xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.Protocol.setTo xmpp.protocol.Protocol-class.html#setTo xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.protocol.Protocol.setError xmpp.protocol.Protocol-class.html#setError xmpp.protocol.Message.__init__ xmpp.protocol.Message-class.html#__init__ xmpp.protocol.Protocol.setType xmpp.protocol.Protocol-class.html#setType xmpp.protocol.Protocol.getTo xmpp.protocol.Protocol-class.html#getTo xmpp.protocol.Message.setBody xmpp.protocol.Message-class.html#setBody xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.protocol.Protocol.getError xmpp.protocol.Protocol-class.html#getError xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.protocol.Protocol.getFrom xmpp.protocol.Protocol-class.html#getFrom xmpp.protocol.Protocol.setTimestamp xmpp.protocol.Protocol-class.html#setTimestamp xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.protocol.Protocol.getTimestamp xmpp.protocol.Protocol-class.html#getTimestamp xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.protocol.Protocol.getErrorCode xmpp.protocol.Protocol-class.html#getErrorCode xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.protocol.Message.buildReply xmpp.protocol.Message-class.html#buildReply xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.Message.setThread xmpp.protocol.Message-class.html#setThread xmpp.protocol.Protocol.getType xmpp.protocol.Protocol-class.html#getType xmpp.protocol.Protocol.__setitem__ xmpp.protocol.Protocol-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.protocol.Protocol.setID xmpp.protocol.Protocol-class.html#setID xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.protocol.Message.getThread xmpp.protocol.Message-class.html#getThread xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.protocol.Message.setSubject xmpp.protocol.Message-class.html#setSubject xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.protocol.Protocol.getProperties xmpp.protocol.Protocol-class.html#getProperties xmpp.protocol.Message.getBody xmpp.protocol.Message-class.html#getBody xmpp.protocol.NodeProcessed xmpp.protocol.NodeProcessed-class.html xmpp.protocol.NotAuthorized xmpp.protocol.NotAuthorized-class.html xmpp.protocol.PolicyViolation xmpp.protocol.PolicyViolation-class.html xmpp.protocol.Presence xmpp.protocol.Presence-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.protocol.Protocol.getFrom xmpp.protocol.Protocol-class.html#getFrom xmpp.protocol.Presence.getStatusCode xmpp.protocol.Presence-class.html#getStatusCode xmpp.protocol.Presence.getPriority xmpp.protocol.Presence-class.html#getPriority xmpp.protocol.Presence.getAffiliation xmpp.protocol.Presence-class.html#getAffiliation xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.protocol.Protocol.getID xmpp.protocol.Protocol-class.html#getID xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.protocol.Presence.setPriority xmpp.protocol.Presence-class.html#setPriority xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.Protocol.setTo xmpp.protocol.Protocol-class.html#setTo xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.protocol.Presence.getActor xmpp.protocol.Presence-class.html#getActor xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.protocol.Protocol.setError xmpp.protocol.Protocol-class.html#setError xmpp.protocol.Presence.__init__ xmpp.protocol.Presence-class.html#__init__ xmpp.protocol.Protocol.setType xmpp.protocol.Protocol-class.html#setType xmpp.protocol.Presence.getShow xmpp.protocol.Presence-class.html#getShow xmpp.protocol.Protocol.getTo xmpp.protocol.Protocol-class.html#getTo xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.protocol.Protocol.getError xmpp.protocol.Protocol-class.html#getError xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.protocol.Presence.getStatus xmpp.protocol.Presence-class.html#getStatus xmpp.protocol.Protocol.setTimestamp xmpp.protocol.Protocol-class.html#setTimestamp xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.protocol.Presence.setStatus xmpp.protocol.Presence-class.html#setStatus xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.protocol.Protocol.getTimestamp xmpp.protocol.Protocol-class.html#getTimestamp xmpp.protocol.Presence.getRole xmpp.protocol.Presence-class.html#getRole xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.protocol.Protocol.getErrorCode xmpp.protocol.Protocol-class.html#getErrorCode xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.Protocol.getType xmpp.protocol.Protocol-class.html#getType xmpp.protocol.Protocol.__setitem__ xmpp.protocol.Protocol-class.html#__setitem__ xmpp.protocol.Presence.getJid xmpp.protocol.Presence-class.html#getJid xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.protocol.Protocol.setID xmpp.protocol.Protocol-class.html#setID xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.protocol.Presence.setShow xmpp.protocol.Presence-class.html#setShow xmpp.protocol.Presence.getNick xmpp.protocol.Presence-class.html#getNick xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.protocol.Presence._muc_getSubTagDataAttr xmpp.protocol.Presence-class.html#_muc_getSubTagDataAttr xmpp.protocol.Presence.getReason xmpp.protocol.Presence-class.html#getReason xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.protocol.Protocol.getProperties xmpp.protocol.Protocol-class.html#getProperties xmpp.protocol.Protocol.setFrom xmpp.protocol.Protocol-class.html#setFrom xmpp.protocol.Presence._muc_getItemAttr xmpp.protocol.Presence-class.html#_muc_getItemAttr xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.protocol.Protocol xmpp.protocol.Protocol-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.protocol.Protocol.setFrom xmpp.protocol.Protocol-class.html#setFrom xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.protocol.Protocol.getID xmpp.protocol.Protocol-class.html#getID xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.protocol.Protocol.setTo xmpp.protocol.Protocol-class.html#setTo xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.protocol.Protocol.setError xmpp.protocol.Protocol-class.html#setError xmpp.protocol.Protocol.__init__ xmpp.protocol.Protocol-class.html#__init__ xmpp.protocol.Protocol.setType xmpp.protocol.Protocol-class.html#setType xmpp.protocol.Protocol.getTo xmpp.protocol.Protocol-class.html#getTo xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.protocol.Protocol.getError xmpp.protocol.Protocol-class.html#getError xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.protocol.Protocol.getFrom xmpp.protocol.Protocol-class.html#getFrom xmpp.protocol.Protocol.setTimestamp xmpp.protocol.Protocol-class.html#setTimestamp xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.protocol.Protocol.getTimestamp xmpp.protocol.Protocol-class.html#getTimestamp xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.protocol.Protocol.getErrorCode xmpp.protocol.Protocol-class.html#getErrorCode xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.protocol.Protocol.getType xmpp.protocol.Protocol-class.html#getType xmpp.protocol.Protocol.__setitem__ xmpp.protocol.Protocol-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.protocol.Protocol.setID xmpp.protocol.Protocol-class.html#setID xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.protocol.Protocol.getProperties xmpp.protocol.Protocol-class.html#getProperties xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.protocol.RemoteConnectionFailed xmpp.protocol.RemoteConnectionFailed-class.html xmpp.protocol.ResourceConstraint xmpp.protocol.ResourceConstraint-class.html xmpp.protocol.RestrictedXML xmpp.protocol.RestrictedXML-class.html xmpp.protocol.SeeOtherHost xmpp.protocol.SeeOtherHost-class.html xmpp.protocol.StreamError xmpp.protocol.StreamError-class.html xmpp.protocol.SystemShutdown xmpp.protocol.SystemShutdown-class.html xmpp.protocol.UndefinedCondition xmpp.protocol.UndefinedCondition-class.html xmpp.protocol.UnsupportedEncoding xmpp.protocol.UnsupportedEncoding-class.html xmpp.protocol.UnsupportedStanzaType xmpp.protocol.UnsupportedStanzaType-class.html xmpp.protocol.UnsupportedVersion xmpp.protocol.UnsupportedVersion-class.html xmpp.protocol.XMLNotWellFormed xmpp.protocol.XMLNotWellFormed-class.html xmpp.roster.Roster xmpp.roster.Roster-class.html xmpp.roster.Roster._getResourceData xmpp.roster.Roster-class.html#_getResourceData xmpp.roster.Roster.getGroups xmpp.roster.Roster-class.html#getGroups xmpp.roster.Roster.getPriority xmpp.roster.Roster-class.html#getPriority xmpp.roster.Roster.getRawRoster xmpp.roster.Roster-class.html#getRawRoster xmpp.roster.Roster.PresenceHandler xmpp.roster.Roster-class.html#PresenceHandler xmpp.roster.Roster._getItemData xmpp.roster.Roster-class.html#_getItemData xmpp.roster.Roster.__init__ xmpp.roster.Roster-class.html#__init__ xmpp.roster.Roster.getShow xmpp.roster.Roster-class.html#getShow xmpp.roster.Roster.getRoster xmpp.roster.Roster-class.html#getRoster xmpp.roster.Roster.Unauthorize xmpp.roster.Roster-class.html#Unauthorize xmpp.roster.Roster.getName xmpp.roster.Roster-class.html#getName xmpp.roster.Roster.getStatus xmpp.roster.Roster-class.html#getStatus xmpp.roster.Roster.getItems xmpp.roster.Roster-class.html#getItems xmpp.roster.Roster.Unsubscribe xmpp.roster.Roster-class.html#Unsubscribe xmpp.roster.Roster.RosterIqHandler xmpp.roster.Roster-class.html#RosterIqHandler xmpp.roster.Roster.getRawItem xmpp.roster.Roster-class.html#getRawItem xmpp.roster.Roster.__getitem__ xmpp.roster.Roster-class.html#__getitem__ xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.roster.Roster.keys xmpp.roster.Roster-class.html#keys xmpp.roster.Roster.Request xmpp.roster.Roster-class.html#Request xmpp.roster.Roster.getAsk xmpp.roster.Roster-class.html#getAsk xmpp.roster.Roster.setItem xmpp.roster.Roster-class.html#setItem xmpp.roster.Roster.getItem xmpp.roster.Roster-class.html#getItem xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.roster.Roster.Authorize xmpp.roster.Roster-class.html#Authorize xmpp.roster.Roster.plugin xmpp.roster.Roster-class.html#plugin xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.roster.Roster.Subscribe xmpp.roster.Roster-class.html#Subscribe xmpp.roster.Roster.delItem xmpp.roster.Roster-class.html#delItem xmpp.roster.Roster.getSubscription xmpp.roster.Roster-class.html#getSubscription xmpp.roster.Roster.getResources xmpp.roster.Roster-class.html#getResources xmpp.session.Session xmpp.session.Session-class.html xmpp.session.Session.terminate_stream xmpp.session.Session-class.html#terminate_stream xmpp.session.Session._destroy_socket xmpp.session.Session-class.html#_destroy_socket xmpp.session.Session.stop_feature xmpp.session.Session-class.html#stop_feature xmpp.session.Session.flush_queue xmpp.session.Session-class.html#flush_queue xmpp.session.Session.set_socket_state xmpp.session.Session-class.html#set_socket_state xmpp.session.Session.StartStream xmpp.session.Session-class.html#StartStream xmpp.session.Session.start_feature xmpp.session.Session-class.html#start_feature xmpp.session.Session.feature xmpp.session.Session-class.html#feature xmpp.session.Session.push_queue xmpp.session.Session-class.html#push_queue xmpp.session.Session.sendnow xmpp.session.Session-class.html#sendnow xmpp.session.Session.enqueue xmpp.session.Session-class.html#enqueue xmpp.session.Session.__init__ xmpp.session.Session-class.html#__init__ xmpp.session.Session.unfeature xmpp.session.Session-class.html#unfeature xmpp.session.Session._catch_stream_id xmpp.session.Session-class.html#_catch_stream_id xmpp.session.Session.set_session_state xmpp.session.Session-class.html#set_session_state xmpp.session.Session._dispatch xmpp.session.Session-class.html#_dispatch xmpp.session.Session.set_stream_state xmpp.session.Session-class.html#set_stream_state xmpp.session.Session._stream_close xmpp.session.Session-class.html#_stream_close xmpp.session.Session.receive xmpp.session.Session-class.html#receive xmpp.session.Session._stream_open xmpp.session.Session-class.html#_stream_open xmpp.simplexml.NT xmpp.simplexml.NT-class.html xmpp.simplexml.T.__delattr__ xmpp.simplexml.T-class.html#__delattr__ xmpp.simplexml.NT.__setattr__ xmpp.simplexml.NT-class.html#__setattr__ xmpp.simplexml.T.__init__ xmpp.simplexml.T-class.html#__init__ xmpp.simplexml.NT.__getattr__ xmpp.simplexml.NT-class.html#__getattr__ xmpp.simplexml.Node xmpp.simplexml.Node-class.html xmpp.simplexml.Node.addChild xmpp.simplexml.Node-class.html#addChild xmpp.simplexml.Node.getAttrs xmpp.simplexml.Node-class.html#getAttrs xmpp.simplexml.Node.delAttr xmpp.simplexml.Node-class.html#delAttr xmpp.simplexml.Node.setNamespace xmpp.simplexml.Node-class.html#setNamespace xmpp.simplexml.Node.__str__ xmpp.simplexml.Node-class.html#__str__ xmpp.simplexml.Node.getNamespace xmpp.simplexml.Node-class.html#getNamespace xmpp.simplexml.Node.getChildren xmpp.simplexml.Node-class.html#getChildren xmpp.simplexml.Node.addData xmpp.simplexml.Node-class.html#addData xmpp.simplexml.Node.__init__ xmpp.simplexml.Node-class.html#__init__ xmpp.simplexml.Node.__getitem__ xmpp.simplexml.Node-class.html#__getitem__ xmpp.simplexml.Node.clearData xmpp.simplexml.Node-class.html#clearData xmpp.simplexml.Node.setParent xmpp.simplexml.Node-class.html#setParent xmpp.simplexml.Node.getName xmpp.simplexml.Node-class.html#getName xmpp.simplexml.Node.__getattr__ xmpp.simplexml.Node-class.html#__getattr__ xmpp.simplexml.Node.getData xmpp.simplexml.Node-class.html#getData xmpp.simplexml.Node.getTagData xmpp.simplexml.Node-class.html#getTagData xmpp.simplexml.Node.setData xmpp.simplexml.Node-class.html#setData xmpp.simplexml.Node.setTagData xmpp.simplexml.Node-class.html#setTagData xmpp.simplexml.Node.setName xmpp.simplexml.Node-class.html#setName xmpp.simplexml.Node.getTagAttr xmpp.simplexml.Node-class.html#getTagAttr xmpp.simplexml.Node.__setitem__ xmpp.simplexml.Node-class.html#__setitem__ xmpp.simplexml.Node.getPayload xmpp.simplexml.Node-class.html#getPayload xmpp.simplexml.Node.getTag xmpp.simplexml.Node-class.html#getTag xmpp.simplexml.Node.setTagAttr xmpp.simplexml.Node-class.html#setTagAttr xmpp.simplexml.Node.getTags xmpp.simplexml.Node-class.html#getTags xmpp.simplexml.Node.__delitem__ xmpp.simplexml.Node-class.html#__delitem__ xmpp.simplexml.Node.getParent xmpp.simplexml.Node-class.html#getParent xmpp.simplexml.Node.getCDATA xmpp.simplexml.Node-class.html#getCDATA xmpp.simplexml.Node.setAttr xmpp.simplexml.Node-class.html#setAttr xmpp.simplexml.Node.delChild xmpp.simplexml.Node-class.html#delChild xmpp.simplexml.Node.getAttr xmpp.simplexml.Node-class.html#getAttr xmpp.simplexml.Node.has_attr xmpp.simplexml.Node-class.html#has_attr xmpp.simplexml.Node.setPayload xmpp.simplexml.Node-class.html#setPayload xmpp.simplexml.Node.FORCE_NODE_RECREATION xmpp.simplexml.Node-class.html#FORCE_NODE_RECREATION xmpp.simplexml.Node.setTag xmpp.simplexml.Node-class.html#setTag xmpp.simplexml.NodeBuilder xmpp.simplexml.NodeBuilder-class.html xmpp.simplexml.NodeBuilder.stream_header_received xmpp.simplexml.NodeBuilder-class.html#stream_header_received xmpp.simplexml.NodeBuilder.starttag xmpp.simplexml.NodeBuilder-class.html#starttag xmpp.simplexml.NodeBuilder.endtag xmpp.simplexml.NodeBuilder-class.html#endtag xmpp.simplexml.NodeBuilder.dispatch xmpp.simplexml.NodeBuilder-class.html#dispatch xmpp.simplexml.NodeBuilder.getDom xmpp.simplexml.NodeBuilder-class.html#getDom xmpp.simplexml.NodeBuilder.handle_namespace_start xmpp.simplexml.NodeBuilder-class.html#handle_namespace_start xmpp.simplexml.NodeBuilder.stream_footer_received xmpp.simplexml.NodeBuilder-class.html#stream_footer_received xmpp.simplexml.NodeBuilder.DEBUG xmpp.simplexml.NodeBuilder-class.html#DEBUG xmpp.simplexml.NodeBuilder.destroy xmpp.simplexml.NodeBuilder-class.html#destroy xmpp.simplexml.NodeBuilder.handle_data xmpp.simplexml.NodeBuilder-class.html#handle_data xmpp.simplexml.NodeBuilder.__init__ xmpp.simplexml.NodeBuilder-class.html#__init__ xmpp.simplexml.T xmpp.simplexml.T-class.html xmpp.simplexml.T.__delattr__ xmpp.simplexml.T-class.html#__delattr__ xmpp.simplexml.T.__setattr__ xmpp.simplexml.T-class.html#__setattr__ xmpp.simplexml.T.__init__ xmpp.simplexml.T-class.html#__init__ xmpp.simplexml.T.__getattr__ xmpp.simplexml.T-class.html#__getattr__ xmpp.transports.HTTPPROXYsocket xmpp.transports.HTTPPROXYsocket-class.html xmpp.transports.TCPsocket.pending_data xmpp.transports.TCPsocket-class.html#pending_data xmpp.transports.TCPsocket.disconnect xmpp.transports.TCPsocket-class.html#disconnect xmpp.transports.TCPsocket.disconnected xmpp.transports.TCPsocket-class.html#disconnected xmpp.transports.HTTPPROXYsocket.plugin xmpp.transports.HTTPPROXYsocket-class.html#plugin xmpp.transports.TCPsocket.receive xmpp.transports.TCPsocket-class.html#receive xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.transports.TCPsocket.plugout xmpp.transports.TCPsocket-class.html#plugout xmpp.transports.TCPsocket.send xmpp.transports.TCPsocket-class.html#send xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.transports.HTTPPROXYsocket.connect xmpp.transports.HTTPPROXYsocket-class.html#connect xmpp.transports.HTTPPROXYsocket.DEBUG xmpp.transports.HTTPPROXYsocket-class.html#DEBUG xmpp.transports.TCPsocket.getPort xmpp.transports.TCPsocket-class.html#getPort xmpp.transports.TCPsocket.getHost xmpp.transports.TCPsocket-class.html#getHost xmpp.transports.HTTPPROXYsocket.__init__ xmpp.transports.HTTPPROXYsocket-class.html#__init__ xmpp.transports.TCPsocket xmpp.transports.TCPsocket-class.html xmpp.transports.TCPsocket.pending_data xmpp.transports.TCPsocket-class.html#pending_data xmpp.transports.TCPsocket.disconnect xmpp.transports.TCPsocket-class.html#disconnect xmpp.transports.TCPsocket.disconnected xmpp.transports.TCPsocket-class.html#disconnected xmpp.transports.TCPsocket.plugout xmpp.transports.TCPsocket-class.html#plugout xmpp.transports.TCPsocket.receive xmpp.transports.TCPsocket-class.html#receive xmpp.client.PlugIn.PlugIn xmpp.client.PlugIn-class.html#PlugIn xmpp.transports.TCPsocket.plugin xmpp.transports.TCPsocket-class.html#plugin xmpp.transports.TCPsocket.send xmpp.transports.TCPsocket-class.html#send xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.transports.TCPsocket.connect xmpp.transports.TCPsocket-class.html#connect xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.transports.TCPsocket.getPort xmpp.transports.TCPsocket-class.html#getPort xmpp.transports.TCPsocket.getHost xmpp.transports.TCPsocket-class.html#getHost xmpp.transports.TCPsocket.__init__ xmpp.transports.TCPsocket-class.html#__init__ xmpp.transports.TLS xmpp.transports.TLS-class.html xmpp.transports.TLS.pending_data xmpp.transports.TLS-class.html#pending_data xmpp.client.PlugIn.PlugOut xmpp.client.PlugIn-class.html#PlugOut xmpp.transports.TLS.PlugIn xmpp.transports.TLS-class.html#PlugIn xmpp.transports.TLS.plugout xmpp.transports.TLS-class.html#plugout xmpp.client.PlugIn.DEBUG xmpp.client.PlugIn-class.html#DEBUG xmpp.transports.TLS.FeaturesHandler xmpp.transports.TLS-class.html#FeaturesHandler xmpp.transports.TLS.StartTLSHandler xmpp.transports.TLS-class.html#StartTLSHandler xmpp.transports.TLS._startSSL xmpp.transports.TLS-class.html#_startSSL xmpp.client.PlugIn.__init__ xmpp.client.PlugIn-class.html#__init__ xmpp.transports.error xmpp.transports.error-class.html xmpp.transports.error.__str__ xmpp.transports.error-class.html#__str__ xmpp.transports.error.__init__ xmpp.transports.error-class.html#__init__ xmpppy-0.4.1/doc/apidocs/index.html0000644000175000000500000000111210731034076016064 0ustar normansrc API Documentation xmpppy-0.4.1/doc/examples/0002755000175000000500000000000010731032136014265 5ustar normansrcxmpppy-0.4.1/doc/examples/bot.py0000755000175000000500000000607710731032110015426 0ustar normansrc#!/usr/bin/python # -*- coding: koi8-r -*- # $Id: bot.py,v 1.2 2006/10/06 12:30:42 normanr Exp $ import sys import xmpp commands={} i18n={'ru':{},'en':{}} ########################### user handlers start ################################## i18n['en']['HELP']="This is example jabber bot.\nAvailable commands: %s" def helpHandler(user,command,args,mess): lst=commands.keys() lst.sort() return "HELP",', '.join(lst) i18n['en']['EMPTY']="%s" i18n['en']['HOOK1']='Responce 1: %s' def hook1Handler(user,command,args,mess): return "HOOK1",'You requested: %s'%args i18n['en']['HOOK2']='Responce 2: %s' def hook2Handler(user,command,args,mess): return "HOOK2","hook2 called with %s"%(`(user,command,args,mess)`) i18n['en']['HOOK3']='Responce 3: static string' def hook3Handler(user,command,args,mess): return "HOOK3"*int(args) ########################### user handlers stop ################################### ############################ bot logic start ##################################### i18n['en']["UNKNOWN COMMAND"]='Unknown command "%s". Try "help"' i18n['en']["UNKNOWN USER"]="I do not know you. Register first." def messageCB(conn,mess): text=mess.getBody() user=mess.getFrom() user.lang='en' # dup if text.find(' ')+1: command,args=text.split(' ',1) else: command,args=text,'' cmd=command.lower() if commands.has_key(cmd): reply=commands[cmd](user,command,args,mess) else: reply=("UNKNOWN COMMAND",cmd) if type(reply)==type(()): key,args=reply if i18n[user.lang].has_key(key): pat=i18n[user.lang][key] elif i18n['en'].has_key(key): pat=i18n['en'][key] else: pat="%s" if type(pat)==type(''): reply=pat%args else: reply=pat(**args) else: try: reply=i18n[user.lang][reply] except KeyError: try: reply=i18n['en'][reply] except KeyError: pass if reply: conn.send(xmpp.Message(mess.getFrom(),reply)) for i in globals().keys(): if i[-7:]=='Handler' and i[:-7].lower()==i[:-7]: commands[i[:-7]]=globals()[i] ############################# bot logic stop ##################################### def StepOn(conn): try: conn.Process(1) except KeyboardInterrupt: return 0 return 1 def GoOn(conn): while StepOn(conn): pass if len(sys.argv)<3: print "Usage: bot.py username@server.net password" else: jid=xmpp.JID(sys.argv[1]) user,server,password=jid.getNode(),jid.getDomain(),sys.argv[2] conn=xmpp.Client(server)#,debug=[]) conres=conn.connect() if not conres: print "Unable to connect to server %s!"%server sys.exit(1) if conres<>'tls': print "Warning: unable to estabilish secure connection - TLS failed!" authres=conn.auth(user,password) if not authres: print "Unable to authorize on %s - check login/password."%server sys.exit(1) if authres<>'sasl': print "Warning: unable to perform SASL auth os %s. Old authentication method used!"%server conn.RegisterHandler('message',messageCB) conn.sendInitPresence() print "Bot started." GoOn(conn) xmpppy-0.4.1/doc/examples/commandsbot.py0000755000175000000500000001740110731032110017141 0ustar normansrc#!/usr/bin/python """ The example of using xmpppy's Ad-Hoc Commands (JEP-0050) implementation. """ import xmpp from xmpp.protocol import * options = { 'JID': 'circles@example.com', 'Password': '********', } class TestCommand(xmpp.commands.Command_Handler_Prototype): """ Example class. You should read source if you wish to understate how it works. This one actually does some calculations.""" name = 'testcommand' description = 'Circle calculations' def __init__(self, jid=''): """ Initialize some internals. Set the first request handler to self.calcTypeForm. """ xmpp.commands.Command_Handler_Prototype.__init__(self,jid) self.initial = { 'execute': self.initialForm } def initialForm(self, conn, request): """ Assign a session id and send the first form. """ sessionid = self.getSessionID() self.sessions[sessionid] = { 'jid':request.getFrom(), 'data':{'type':None} } # simulate that the client sent sessionid, so calcTypeForm will be able # to continue request.getTag(name="command").setAttr('sessionid', sessionid) return self.calcTypeForm(conn, request) def calcTypeForm(self, conn, request): """ Send first form to the requesting user. """ # get the session data sessionid = request.getTagAttr('command','sessionid') session = self.sessions[sessionid] # What to do when a user sends us a response? Note, that we should always # include 'execute', as it is a default action when requester does not send # exact action to do (should be set to the same as 'next' or 'complete' fields) session['actions'] = { 'cancel': self.cancel, 'next': self.calcTypeFormAccept, 'execute': self.calcTypeFormAccept, } # The form to send calctypefield = xmpp.DataField( name='calctype', desc='Calculation Type', value=session['data']['type'], options=[ ['Calculate the diameter of a circle','circlediameter'], ['Calculate the area of a circle','circlearea'] ], typ='list-single', required=1) # We set label attribute... seems that the xmpppy.DataField cannot do that calctypefield.setAttr('label', 'Calculation Type') form = xmpp.DataForm( title='Select type of operation', data=[ 'Use the combobox to select the type of calculation you would like'\ 'to do, then click Next.', calctypefield]) # Build a reply with the form reply = request.buildReply('result') replypayload = [ xmpp.Node('actions', attrs={'execute':'next'}, payload=[xmpp.Node('next')]), form] reply.addChild( name='command', namespace=NS_COMMANDS, attrs={ 'node':request.getTagAttr('command','node'), 'sessionid':sessionid, 'status':'executing'}, payload=replypayload) self._owner.send(reply) # Question: self._owner or conn? raise xmpp.NodeProcessed def calcTypeFormAccept(self, conn, request): """ Load the calcType form filled in by requester, then reply with the second form. """ # get the session data sessionid = request.getTagAttr('command','sessionid') session = self.sessions[sessionid] # load the form node = request.getTag(name='command').getTag(name='x',namespace=NS_DATA) form = xmpp.DataForm(node=node) # retrieve the data session['data']['type'] = form.getField('calctype').getValue() # send second form return self.calcDataForm(conn, request) def calcDataForm(self, conn, request, notavalue=None): """ Send a form asking for diameter. """ # get the session data sessionid = request.getTagAttr('command','sessionid') session = self.sessions[sessionid] # set the actions taken on requester's response session['actions'] = { 'cancel': self.cancel, 'prev': self.calcTypeForm, 'next': self.calcDataFormAccept, 'execute': self.calcDataFormAccept } # create a form radiusfield = xmpp.DataField(desc='Radius',name='radius',typ='text-single') radiusfield.setAttr('label', 'Radius') form = xmpp.DataForm( title = 'Enter the radius', data=[ 'Enter the radius of the circle (numbers only)', radiusfield]) # build a reply stanza reply = request.buildReply('result') replypayload = [ xmpp.Node('actions', attrs={'execute':'complete'}, payload=[xmpp.Node('complete'),xmpp.Node('prev')]), form] if notavalue: replypayload.append(xmpp.Node('note', attrs={'type': 'warn'}, payload=['You have to enter valid number.'])) reply.addChild( name='command', namespace=NS_COMMANDS, attrs={ 'node':request.getTagAttr('command','node'), 'sessionid':request.getTagAttr('command','sessionid'), 'status':'executing'}, payload=replypayload) self._owner.send(reply) raise xmpp.NodeProcessed def calcDataFormAccept(self, conn, request): """ Load the calcType form filled in by requester, then reply with the result. """ # get the session data sessionid = request.getTagAttr('command','sessionid') session = self.sessions[sessionid] # load the form node = request.getTag(name='command').getTag(name='x',namespace=NS_DATA) form = xmpp.DataForm(node=node) # retrieve the data; if the entered value is not a number, return to second stage try: value = float(form.getField('radius').getValue()) except: self.calcDataForm(conn, request, notavalue=True) # calculate the answer from math import pi if session['data']['type'] == 'circlearea': result = (value**2) * pi else: result = 2 * value * pi # build the result form form = xmpp.DataForm( typ='result', data=[xmpp.DataField(desc='result', name='result', value=result)]) # build the reply stanza reply = request.buildReply('result') reply.addChild( name='command', namespace=NS_COMMANDS, attrs={ 'node':request.getTagAttr('command','node'), 'sessionid':sessionid, 'status':'completed'}, payload=[form]) self._owner.send(reply) # erase the data about session del self.sessions[sessionid] raise xmpp.NodeProcessed def cancel(self, conn, request): """ Requester canceled the session, send a short reply. """ # get the session id sessionid = request.getTagAttr('command','sessionid') # send the reply reply = request.buildReply('result') reply.addChild( name='command', namespace=NS_COMMANDS, attrs={ 'node':request.getTagAttr('command','node'), 'sessionid':sessionid, 'status':'cancelled'}) self._owner.send(reply) # erase the data about session del self.sessions[sessionid] raise xmpp.NodeProcessed class ConnectionError: pass class AuthorizationError: pass class NotImplemented: pass class Bot: """ The main bot class. """ def __init__(self, JID, Password): """ Create a new bot. Connect to the server and log in. """ # connect... jid = xmpp.JID(JID) self.connection = xmpp.Client(jid.getDomain(), debug=['always', 'browser', 'testcommand']) result = self.connection.connect() if result is None: raise ConnectionError # authorize result = self.connection.auth(jid.getNode(), Password) if result is None: raise AuthorizationError # plugins # disco - needed by commands # warning: case of "plugin" method names are important! # to attach a command to Commands class, use .plugin() # to attach anything to Client class, use .PlugIn() self.disco = xmpp.browser.Browser() self.disco.PlugIn(self.connection) self.disco.setDiscoHandler({ 'info': { 'ids': [{ 'category': 'client', 'type': 'pc', 'name': 'Bot' }], 'features': [NS_DISCO_INFO], } }) self.commands = xmpp.commands.Commands(self.disco) self.commands.PlugIn(self.connection) self.command_test = TestCommand() self.command_test.plugin(self.commands) # presence self.connection.sendInitPresence(requestRoster=0) def loop(self): """ Do nothing except handling new xmpp stanzas. """ try: while self.connection.Process(1): pass except KeyboardInterrupt: pass bot = Bot(**options) bot.loop() xmpppy-0.4.1/doc/examples/logger.py0000755000175000000500000000506010731032110016110 0ustar normansrc#!/usr/bin/python # -*- coding: koi8-r -*- from xmpp import * import time,os #BOT=(botjid,password) BOT=('test@penza-gsm.ru','test') #CONF=(confjid,password) CONF=('talks@conference.jabber.ru','') LOGDIR='./' PROXY={} #PROXY={'host':'192.168.0.1','port':3128,'username':'luchs','password':'secret'} ####################################### def LOG(stanza,nick,text): ts=stanza.getTimestamp() if not ts: ts=stanza.setTimestamp() ts=stanza.getTimestamp() tp=time.mktime(time.strptime(ts,'%Y%m%dT%H:%M:%S %Z'))+3600*3 if time.localtime()[-1]: tp+=3600 tp=time.localtime(tp) fold=stanza.getFrom().getStripped().replace('@','%')+'_'+time.strftime("%Y.%m",tp) day=time.strftime("%d",tp) tm=time.strftime("%H:%M:%S",tp) try: os.mkdir(LOGDIR+fold) except: pass fName='%s%s/%s.%s.html'%(LOGDIR,fold,fold,day) try: open(fName) except: open(fName,'w').write(""" %s logs for %s.%s. """%(CONF[0],fold,day)) text='
%s
'%text open(fName,'a').write((u"\n"%(tm,nick,text)).encode('utf-8')) print (u"\n"%(tm,nick,text)).encode('koi8-r','replace') # print time.localtime(tp),nick,text def messageCB(sess,mess): nick=mess.getFrom().getResource() text=mess.getBody() LOG(mess,nick,text) roster=[] def presenceCB(sess,pres): nick=pres.getFrom().getResource() text='' if pres.getType()=='unavailable': if nick in roster: text=nick+unicode(' покинул конференцию','koi8-r') roster.remove(nick) else: if nick not in roster: text=nick+unicode(' пришёл в конференцию','koi8-r') roster.append(nick) if text: LOG(pres,nick,text) if 1: cl=Client(JID(BOT[0]).getDomain(),debug=[]) cl.connect(proxy=PROXY) cl.RegisterHandler('message',messageCB) cl.RegisterHandler('presence',presenceCB) cl.auth(JID(BOT[0]).getNode(),BOT[1]) p=Presence(to='%s/logger'%CONF[0]) p.setTag('x',namespace=NS_MUC).setTagData('password',CONF[1]) p.getTag('x').addChild('history',{'maxchars':'0','maxstanzas':'0'}) cl.send(p) while 1: cl.Process(1) xmpppy-0.4.1/doc/examples/README.py0000755000175000000500000000471310731032110015572 0ustar normansrc#!/usr/bin/python # -*- coding: koi8-r -*- from xmpp import * def presenceHandler(conn,presence_node): """ Handler for playing a sound when particular contact became online """ targetJID='node@domain.org' if presence_node.getFrom().bareMatch(targetJID): # play a sound pass def iqHandler(conn,iq_node): """ Handler for processing some "get" query from custom namespace""" reply=iq_node.buildReply('result') # ... put some content into reply node conn.send(reply) raise NodeProcessed # This stanza is fully processed def messageHandler(conn,mess_node): pass if 1: """ Example 1: Connecting to specified IP address. Connecting to port 5223 - TLS is pre-started. Using direct connect. """ # Born a client cl=Client('ejabberd.somedomain.org') # ...connect it to SSL port directly if not cl.connect(server=('1.2.3.4',5223)): raise IOError('Can not connect to server.') else: """ Example 2: Connecting to server via proxy. Assuming that servername resolves to jabber server IP. TLS will be started automatically if available. """ # Born a client cl=Client('jabberd2.somedomain.org') # ...connect via proxy if not cl.connect(proxy={'host':'someproxy.somedomain.org','port':'8080','user':'proxyuser','password':'proxyuserpassword'}): raise IOError('Can not connect to server.') # ...authorize client if not cl.auth('jabberuser','jabberuserpassword','optional resource name'): raise IOError('Can not auth with server.') # ...register some handlers (if you will register them before auth they will be thrown away) cl.RegisterHandler('presence',presenceHandler) cl.RegisterHandler('iq',iqHandler) cl.RegisterHandler('message',messageHandler) # ...become available cl.sendInitPresence() # ...work some time cl.Process(1) # ...if connection is brocken - restore it if not cl.isConnected(): cl.reconnectAndReauth() # ...send an ASCII message cl.send(Message('test@jabber.org','Test message')) # ...send a national message cl.send(Message('test@jabber.org',unicode('Проверка связи','koi8-r'))) # ...send another national message simplexml.ENCODING='koi8-r' cl.send(Message('test@jabber.org','Проверка связи 2')) # ...work some more time - collect replies cl.Process(1) # ...and then disconnect. cl.disconnect() """ If you have used jabberpy before you will find xmpppy very similar. See the docs for more info about library features. """ xmpppy-0.4.1/doc/examples/xbiff.py0000755000175000000500000000521510731032110015731 0ustar normansrc#!/usr/bin/python # $Id: xbiff.py,v 1.2 2006/10/06 12:30:42 normanr Exp $ import sys,os,xmpp,time,select class Bot: def __init__(self,jabber): self.jabber = jabber def register_handlers(self): self.jabber.RegisterHandler('message',self.xmpp_message) def xmpp_message(self, con, event): type = event.getType() fromjid = event.getFrom().getStripped() if type in ['message', 'chat', None]: print fromjid+':',event.getBody() if event.getBody(): p = xmpp.protocol.Presence(to=fromjid,status=event.getBody()) self.jabber.send(p) p = xmpp.protocol.Presence(to=fromjid,typ='unavailable') self.jabber.send(p) def xmpp_connect(self): con=self.jabber.connect() if not con: sys.stderr.write('could not connect!\n') return False sys.stderr.write('connected with %s\n'%con) auth=self.jabber.auth(jid.getNode(),jidparams['password'],resource=jid.getResource()) if not auth: sys.stderr.write('could not authenticate!\n') return False sys.stderr.write('authenticated using %s\n'%auth) self.register_handlers() return con if __name__ == '__main__': if len(sys.argv) < 1: print "Syntax: xbiff" sys.exit(0) jidparams={} if os.access(os.environ['HOME']+'/.xbiff',os.R_OK): for ln in open(os.environ['HOME']+'/.xbiff').readlines(): if not ln[0] in ('#',';'): key,val=ln.strip().split('=',1) jidparams[key.lower()]=val for mandatory in ['jid','password']: if mandatory not in jidparams.keys(): open(os.environ['HOME']+'/.xbiff','w').write('#Uncomment fields before use and type in correct credentials.\n#JID=romeo@montague.net/resource (/resource is optional)\n#PASSWORD=juliet\n') print 'Please point ~/.xbiff config file to valid JID for sending messages.' sys.exit(0) jid=xmpp.protocol.JID(jidparams['jid']) cl=xmpp.Client(jid.getDomain(),debug=[]) bot=Bot(cl) if not bot.xmpp_connect(): sys.stderr.write("Could not connect to server, or password mismatch!\n") sys.exit(1) #cl.SendInitPresence(requestRoster=0) # you may need to uncomment this for old server socketlist = {cl.Connection._sock:'xmpp'} online = 1 while online: (i , o, e) = select.select(socketlist.keys(),[],[],1) for each in i: if socketlist[each] == 'xmpp': cl.Process(1) else: raise Exception("Unknown socket type: %s" % repr(socketlist[each])) #cl.disconnect() xmpppy-0.4.1/doc/examples/xsend.py0000755000175000000500000000273110731032110015754 0ustar normansrc#!/usr/bin/python # $Id: xsend.py,v 1.8 2006/10/06 12:30:42 normanr Exp $ import sys,os,xmpp,time if len(sys.argv) < 2: print "Syntax: xsend JID text" sys.exit(0) tojid=sys.argv[1] text=' '.join(sys.argv[2:]) jidparams={} if os.access(os.environ['HOME']+'/.xsend',os.R_OK): for ln in open(os.environ['HOME']+'/.xsend').readlines(): if not ln[0] in ('#',';'): key,val=ln.strip().split('=',1) jidparams[key.lower()]=val for mandatory in ['jid','password']: if mandatory not in jidparams.keys(): open(os.environ['HOME']+'/.xsend','w').write('#Uncomment fields before use and type in correct credentials.\n#JID=romeo@montague.net/resource (/resource is optional)\n#PASSWORD=juliet\n') print 'Please point ~/.xsend config file to valid JID for sending messages.' sys.exit(0) jid=xmpp.protocol.JID(jidparams['jid']) cl=xmpp.Client(jid.getDomain(),debug=[]) con=cl.connect() if not con: print 'could not connect!' sys.exit() print 'connected with',con auth=cl.auth(jid.getNode(),jidparams['password'],resource=jid.getResource()) if not auth: print 'could not authenticate!' sys.exit() print 'authenticated using',auth #cl.SendInitPresence(requestRoster=0) # you may need to uncomment this for old server id=cl.send(xmpp.protocol.Message(tojid,text)) print 'sent message with id',id time.sleep(1) # some older servers will not send the message if you disconnect immediately after sending #cl.disconnect() xmpppy-0.4.1/doc/examples/xtalk.py0000755000175000000500000000556510731032110015766 0ustar normansrc#!/usr/bin/python # $Id: xtalk.py,v 1.2 2006/10/06 12:30:42 normanr Exp $ import sys,os,xmpp,time,select class Bot: def __init__(self,jabber,remotejid): self.jabber = jabber self.remotejid = remotejid def register_handlers(self): self.jabber.RegisterHandler('message',self.xmpp_message) def xmpp_message(self, con, event): type = event.getType() fromjid = event.getFrom().getStripped() if type in ['message', 'chat', None] and fromjid == self.remotejid: sys.stdout.write(event.getBody() + '\n') def stdio_message(self, message): m = xmpp.protocol.Message(to=self.remotejid,body=message,typ='chat') self.jabber.send(m) pass def xmpp_connect(self): con=self.jabber.connect() if not con: sys.stderr.write('could not connect!\n') return False sys.stderr.write('connected with %s\n'%con) auth=self.jabber.auth(jid.getNode(),jidparams['password'],resource=jid.getResource()) if not auth: sys.stderr.write('could not authenticate!\n') return False sys.stderr.write('authenticated using %s\n'%auth) self.register_handlers() return con if __name__ == '__main__': if len(sys.argv) < 2: print "Syntax: xtalk JID" sys.exit(0) tojid=sys.argv[1] jidparams={} if os.access(os.environ['HOME']+'/.xtalk',os.R_OK): for ln in open(os.environ['HOME']+'/.xtalk').readlines(): if not ln[0] in ('#',';'): key,val=ln.strip().split('=',1) jidparams[key.lower()]=val for mandatory in ['jid','password']: if mandatory not in jidparams.keys(): open(os.environ['HOME']+'/.xtalk','w').write('#Uncomment fields before use and type in correct credentials.\n#JID=romeo@montague.net/resource (/resource is optional)\n#PASSWORD=juliet\n') print 'Please point ~/.xtalk config file to valid JID for sending messages.' sys.exit(0) jid=xmpp.protocol.JID(jidparams['jid']) cl=xmpp.Client(jid.getDomain(),debug=[]) bot=Bot(cl,tojid) if not bot.xmpp_connect(): sys.stderr.write("Could not connect to server, or password mismatch!\n") sys.exit(1) #cl.SendInitPresence(requestRoster=0) # you may need to uncomment this for old server socketlist = {cl.Connection._sock:'xmpp',sys.stdin:'stdio'} online = 1 while online: (i , o, e) = select.select(socketlist.keys(),[],[],1) for each in i: if socketlist[each] == 'xmpp': cl.Process(1) elif socketlist[each] == 'stdio': msg = sys.stdin.readline().rstrip('\r\n') bot.stdio_message(msg) else: raise Exception("Unknown socket type: %s" % repr(socketlist[each])) #cl.disconnect() xmpppy-0.4.1/doc/index.html0000644000175000000500000002314610731037563014461 0ustar normansrcxmpppy: the jabber python project
timewhotext
%s%s%s
%s%s%s
xmpppy

about

xmpppy is a Python library that is targeted to provide easy scripting with Jabber. Similar projects are Twisted Words and jabber.py.

This library was not designed from scratch. It inherits some code from jabberpy and have very similar API in many places. Though it is separate project since it have almost completely different architecture and primarily aims to work with jabberd2 - the new Open Source Jabber Server.

xmpppy is distributed under the terms of GNU General Public License and can be freely redistributed without any charge.

documentation

Documentation is now in the process of heavy development and not yet finished but most critical docs exist - please feel free to ask any questions if you will find the docs incomplete (see support section below).

examples

For these who prefer reading samples of code than digging through [incomplete] docs - here they are. Simple (but working) examples of xmpppy usage.

  • README.py
    Self-explanatory library usage example
  • xsend.py
    Command-line utility for sending jabber messages
  • xtalk.py
    Command-line utility for chatting with a single user
  • bot.py
    Xmpppy bot framework, handles messages
  • commandsbot.py
    Xmpppy bot framework, handles ad hoc commands
  • logger.py
    Simple conference logger bot

The following are some more advanced examples showing serious library usage:

download

You can look for released versions on downloads page or alternatively you can grab the latest version directly from CVS tree by typing the following commands:
cvs -d:pserver:anonymous@xmpppy.cvs.sourceforge.net:/cvsroot/xmpppy login
(hit "enter" when you will be prompted for password)
cvs -z3 -d:pserver:anonymous@xmpppy.cvs.sourceforge.net:/cvsroot/xmpppy co xmpppy

You can also browse xmpppy (and several xmpppy-based projects) CVS online here.

If you have an RSS feed reader, there is an RSS feed of CVS commits here.

support

If you have any questions about using xmpppy you can join xmpppy-devel maillist. Here you can always find the best support, as you can find the developers here.

donations

If you are willing to help you can consult this article for how to do it. Thanks!

If you want to donate some money to encourage me to continue work on library (it helps, really!) you can do it via e-gold system (account 1552795) or via bank transfer (contact me via jabber or email to get the details).

author

Alexey Nezhdanov
Russian, born 18 Nov 1976.
My timezone is GMT+3
e-mail & Jabber: snake at penza-gsm.ru
ICQ: 19515046

I'm seeking for a job over Internet. It may be jabber-related work or any other.
Possible directions of work:
  • Python projects (preferred)
  • C++ projects
  • Remote systems administering
My skills:
  • 16 years of programming. Basic -> Pascal -> C++ -> Python
  • 9 years of system administrator work. DOS -> Win 3.1 -> Win95 -> Win98 -> linux2.2 -> linux2.4 -> linux2.6
  • Automation tasks
  • Automated instant messenging (state change/failures reporting)
  • Some research work:
    • wavelet audio analysis
    • speech recognising
    • realtime texture [de]compression (for 3D systems).

downloads

xmpppy
xmppd.py
xmpppy-irc
xmpppy-yahoo
pyGAIM-t

List all files

sourceforge

Project Summary
Feature Requests
Bugs
Patches

exits

jabber.org
xmpp.org
IRC transport
Mail transport
MXit transport
Yahoo transport

the xmpppy project

xmpppy-0.4.1/doc/xmpppy.css0000644000175000000500000000206010237714546014527 0ustar normansrc/* xmpppy.css - The stylesheet of the xmpppy homepage * * Parts are taken of ickle stylesheet * * Copyleft 2005 by Marek Kubica * * Version 0.0.20050507 * */ /* set a background color, a light grey*/ body { background-color: #F2F2F2; } /* fonts - no serif */ a, p, ul, td, div { font-family: sans-serif; } /* hyperlinks: blue, not decorated, just bold */ a { text-decoration: none; color: #00488F; font-weight: bold; } /* the head table, blue like the sf.net logo */ table.head { width: 100%; background-color: #00488F; text-align: right; border-collapse: collapse; } td.head { padding: 0px; } table.content { padding: 5px; border-spacing: 30px; } td.sflogo { width: 99%; } /* the conentent of the left side fills 80% of the screen */ td.leftside { width: 80%; } /* the links on the right side fill the remaining 20% * and are displayed on top */ td.rightside { width: 20%; vertical-align: top; } /* not simple bullets, but squares */ ul { list-style-type: square; } /* blockquotes in italic */ blockquote { font-style: italic; } xmpppy-0.4.1/doc/xmpppy_title.png0000644000175000000500000000227510237716550015731 0ustar normansrc┴PNG  IHDR,Eг/+agAMA╞х7┼ИtEXtSoftwareAdobe ImageReadyqиe<PLTEЪЪЪH▐r а╫пБ∙ЁяBw╛(d═вЦН▓глы+IDATxзЛ⌡К√К ┘|Ъ7>'MЙ`т4суYе_сtвк╖ыБe√5рpZAю X+`╛─Vю X+`╛@╟Vю X+`┌─╟Vю XК√\Ч'>>lSОDдcyс╞HО│е(l█╞·pёM+.▐■╤giЪ{│╕╗tЭ·S>49PВ╒жJй╬■┼│m!N|я┤E▀LXуj╢ЫYк%╞kЫ{iJъ▒VыePk╣u▓▓-┘\IQ▒&ёIТТОц▓∙■мK*╛&e╤4 вaiшv*╙B╓╥ц╙аjt6 ╛)m■Y/м▓© бji-7H⌡Ф┐:Фю╡ь!┐ъ&3|й├├~>┼9╞┌б┘·п┌╣[0Щ█MЮ,м╤4=fBJФK╚├жХЙ!kУ*┴/@╤°jIВ%ё]╔╫|█)&ф└╛Z╪М├ц╟XФ│√й┴└e ы│Z╞░J■*²╩Lq┤BкkT-╔W`иLЛ╧∙dIU╣*═жщ╛Ж╛з╫*Aц┬▀оЦЖНDПXзnГG▓йVё ▀Т^a┘─1и╞RTКэZ<▐Y╛▓M╡P│Ё╟▌╬─К2,╔а0!Mь╩╥6<йС╕Vjс<,PчCVR├│!м·есI6fОНB:ubgMцр&┐юWP_╞ЁCрD░уыuхN8|╛uжWРж╖Е╣Kф╞/юb5l©Vn÷[m≤┘eEЯPЩ8щк▄НН┘┘©к÷#╡; \┐∙Щ╥П/б╙,g┌╛,p6<>╙юjнч]XdЛ5Э▌аС[ ^шЗ Ж"╛#rwr|wХ═╧ЖD■q▌Р°╫{╟▌ ²╦МX0N`"(EС +╚7·YCШ╟йJз эn│┘╞┘Е╨тQё0iО6,a└ЖЗИX╓5K'ПЙ Шт╡{≈s╡нlдИгЧУ╔xт╛мФ~╟=eО ,ЕTЁ>ц╨жЦ8м3Ё╨1;#а√зn╢Т√&к9_\²цю )▐ЛтЯ_┐К(│┴⌠ЧЛa OСs`╔|╨■юФ{щШ ╕╢=Еe≥╡4XуЩ╒╫z╘z&╖h!*7┼з╖8Kэё╠.=╩E\▌и0,е.Ц`Я╔Щ╛{⌠mЧ█7я■q)В╓ч≥ьцЙжj╪ъ╞ ▒+ЖЧ╔╟ЮJ░У╜╟Р%{Ъ.Xо)Б╒╫,зf_═╡rJ╚/\ZC,ЛъФ XЗб(╞кNЭЙ╦З*XьШЪ┐nЗ'ю╗wO╒КНЫкIEND╝B`┌xmpppy-0.4.1/xmpp/0002755000175000000500000000000010731031743012671 5ustar normansrcxmpppy-0.4.1/xmpp/auth.py0000644000175000000500000003606110664771365014230 0ustar normansrc## auth.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: auth.py,v 1.38 2007/08/28 10:03:33 normanr Exp $ """ Provides library with all Non-SASL and SASL authentication mechanisms. Can be used both for client and transport authentication. """ from protocol import * from client import PlugIn import sha,base64,random,dispatcher,re import md5 def HH(some): return md5.new(some).hexdigest() def H(some): return md5.new(some).digest() def C(some): return ':'.join(some) class NonSASL(PlugIn): """ Implements old Non-SASL (JEP-0078) authentication used in jabberd1.4 and transport authentication.""" def __init__(self,user,password,resource): """ Caches username, password and resource for auth. """ PlugIn.__init__(self) self.DBG_LINE='gen_auth' self.user=user self.password=password self.resource=resource def plugin(self,owner): """ Determine the best auth method (digest/0k/plain) and use it for auth. Returns used method name on success. Used internally. """ if not self.resource: return self.authComponent(owner) self.DEBUG('Querying server about possible auth methods','start') resp=owner.Dispatcher.SendAndWaitForResponse(Iq('get',NS_AUTH,payload=[Node('username',payload=[self.user])])) if not isResultNode(resp): self.DEBUG('No result node arrived! Aborting...','error') return iq=Iq(typ='set',node=resp) query=iq.getTag('query') query.setTagData('username',self.user) query.setTagData('resource',self.resource) if query.getTag('digest'): self.DEBUG("Performing digest authentication",'ok') query.setTagData('digest',sha.new(owner.Dispatcher.Stream._document_attrs['id']+self.password).hexdigest()) if query.getTag('password'): query.delChild('password') method='digest' elif query.getTag('token'): token=query.getTagData('token') seq=query.getTagData('sequence') self.DEBUG("Performing zero-k authentication",'ok') hash = sha.new(sha.new(self.password).hexdigest()+token).hexdigest() for foo in xrange(int(seq)): hash = sha.new(hash).hexdigest() query.setTagData('hash',hash) method='0k' else: self.DEBUG("Sequre methods unsupported, performing plain text authentication",'warn') query.setTagData('password',self.password) method='plain' resp=owner.Dispatcher.SendAndWaitForResponse(iq) if isResultNode(resp): self.DEBUG('Sucessfully authenticated with remove host.','ok') owner.User=self.user owner.Resource=self.resource owner._registered_name=owner.User+'@'+owner.Server+'/'+owner.Resource return method self.DEBUG('Authentication failed!','error') def authComponent(self,owner): """ Authenticate component. Send handshake stanza and wait for result. Returns "ok" on success. """ self.handshake=0 owner.send(Node(NS_COMPONENT_ACCEPT+' handshake',payload=[sha.new(owner.Dispatcher.Stream._document_attrs['id']+self.password).hexdigest()])) owner.RegisterHandler('handshake',self.handshakeHandler,xmlns=NS_COMPONENT_ACCEPT) while not self.handshake: self.DEBUG("waiting on handshake",'notify') owner.Process(1) owner._registered_name=self.user if self.handshake+1: return 'ok' def handshakeHandler(self,disp,stanza): """ Handler for registering in dispatcher for accepting transport authentication. """ if stanza.getName()=='handshake': self.handshake=1 else: self.handshake=-1 class SASL(PlugIn): """ Implements SASL authentication. """ def __init__(self,username,password): PlugIn.__init__(self) self.username=username self.password=password def plugin(self,owner): if not self._owner.Dispatcher.Stream._document_attrs.has_key('version'): self.startsasl='not-supported' elif self._owner.Dispatcher.Stream.features: try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) except NodeProcessed: pass else: self.startsasl=None def auth(self): """ Start authentication. Result can be obtained via "SASL.startsasl" attribute and will be either "success" or "failure". Note that successfull auth will take at least two Dispatcher.Process() calls. """ if self.startsasl: pass elif self._owner.Dispatcher.Stream.features: try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) except NodeProcessed: pass else: self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) def plugout(self): """ Remove SASL handlers from owner's dispatcher. Used internally. """ if self._owner.__dict__.has_key('features'): self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) if self._owner.__dict__.has_key('challenge'): self._owner.UnregisterHandler('challenge',self.SASLHandler,xmlns=NS_SASL) if self._owner.__dict__.has_key('failure'): self._owner.UnregisterHandler('failure',self.SASLHandler,xmlns=NS_SASL) if self._owner.__dict__.has_key('success'): self._owner.UnregisterHandler('success',self.SASLHandler,xmlns=NS_SASL) def FeaturesHandler(self,conn,feats): """ Used to determine if server supports SASL auth. Used internally. """ if not feats.getTag('mechanisms',namespace=NS_SASL): self.startsasl='not-supported' self.DEBUG('SASL not supported by server','error') return mecs=[] for mec in feats.getTag('mechanisms',namespace=NS_SASL).getTags('mechanism'): mecs.append(mec.getData()) self._owner.RegisterHandler('challenge',self.SASLHandler,xmlns=NS_SASL) self._owner.RegisterHandler('failure',self.SASLHandler,xmlns=NS_SASL) self._owner.RegisterHandler('success',self.SASLHandler,xmlns=NS_SASL) if "DIGEST-MD5" in mecs: node=Node('auth',attrs={'xmlns':NS_SASL,'mechanism':'DIGEST-MD5'}) elif "PLAIN" in mecs: sasl_data='%s\x00%s\x00%s'%(self.username+'@'+self._owner.Server,self.username,self.password) node=Node('auth',attrs={'xmlns':NS_SASL,'mechanism':'PLAIN'},payload=[base64.encodestring(sasl_data)]) else: self.startsasl='failure' self.DEBUG('I can only use DIGEST-MD5 and PLAIN mecanisms.','error') return self.startsasl='in-process' self._owner.send(node.__str__()) raise NodeProcessed def SASLHandler(self,conn,challenge): """ Perform next SASL auth step. Used internally. """ if challenge.getNamespace()<>NS_SASL: return if challenge.getName()=='failure': self.startsasl='failure' try: reason=challenge.getChildren()[0] except: reason=challenge self.DEBUG('Failed SASL authentification: %s'%reason,'error') raise NodeProcessed elif challenge.getName()=='success': self.startsasl='success' self.DEBUG('Successfully authenticated with remote server.','ok') handlers=self._owner.Dispatcher.dumpHandlers() self._owner.Dispatcher.PlugOut() dispatcher.Dispatcher().PlugIn(self._owner) self._owner.Dispatcher.restoreHandlers(handlers) self._owner.User=self.username raise NodeProcessed ########################################3333 incoming_data=challenge.getData() chal={} data=base64.decodestring(incoming_data) self.DEBUG('Got challenge:'+data,'ok') for pair in re.findall('(\w+=(?:"[^"]+")|(?:[^,]+))',data): key,value=pair.split('=', 1) if value[:1]=='"' and value[-1:]=='"': value=value[1:-1] chal[key]=value if chal.has_key('qop') and 'auth' in chal['qop'].split(','): resp={} resp['username']=self.username resp['realm']=self._owner.Server resp['nonce']=chal['nonce'] cnonce='' for i in range(7): cnonce+=hex(int(random.random()*65536*4096))[2:] resp['cnonce']=cnonce resp['nc']=('00000001') resp['qop']='auth' resp['digest-uri']='xmpp/'+self._owner.Server A1=C([H(C([resp['username'],resp['realm'],self.password])),resp['nonce'],resp['cnonce']]) A2=C(['AUTHENTICATE',resp['digest-uri']]) response= HH(C([HH(A1),resp['nonce'],resp['nc'],resp['cnonce'],resp['qop'],HH(A2)])) resp['response']=response resp['charset']='utf-8' sasl_data='' for key in ['charset','username','realm','nonce','nc','cnonce','digest-uri','response','qop']: if key in ['nc','qop','response','charset']: sasl_data+="%s=%s,"%(key,resp[key]) else: sasl_data+='%s="%s",'%(key,resp[key]) ########################################3333 node=Node('response',attrs={'xmlns':NS_SASL},payload=[base64.encodestring(sasl_data[:-1]).replace('\r','').replace('\n','')]) self._owner.send(node.__str__()) elif chal.has_key('rspauth'): self._owner.send(Node('response',attrs={'xmlns':NS_SASL}).__str__()) else: self.startsasl='failure' self.DEBUG('Failed SASL authentification: unknown challenge','error') raise NodeProcessed class Bind(PlugIn): """ Bind some JID to the current connection to allow router know of our location.""" def __init__(self): PlugIn.__init__(self) self.DBG_LINE='bind' self.bound=None def plugin(self,owner): """ Start resource binding, if allowed at this time. Used internally. """ if self._owner.Dispatcher.Stream.features: try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) except NodeProcessed: pass else: self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) def plugout(self): """ Remove Bind handler from owner's dispatcher. Used internally. """ self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) def FeaturesHandler(self,conn,feats): """ Determine if server supports resource binding and set some internal attributes accordingly. """ if not feats.getTag('bind',namespace=NS_BIND): self.bound='failure' self.DEBUG('Server does not requested binding.','error') return if feats.getTag('session',namespace=NS_SESSION): self.session=1 else: self.session=-1 self.bound=[] def Bind(self,resource=None): """ Perform binding. Use provided resource name or random (if not provided). """ while self.bound is None and self._owner.Process(1): pass if resource: resource=[Node('resource',payload=[resource])] else: resource=[] resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('bind',attrs={'xmlns':NS_BIND},payload=resource)])) if isResultNode(resp): self.bound.append(resp.getTag('bind').getTagData('jid')) self.DEBUG('Successfully bound %s.'%self.bound[-1],'ok') jid=JID(resp.getTag('bind').getTagData('jid')) self._owner.User=jid.getNode() self._owner.Resource=jid.getResource() resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('session',attrs={'xmlns':NS_SESSION})])) if isResultNode(resp): self.DEBUG('Successfully opened session.','ok') self.session=1 return 'ok' else: self.DEBUG('Session open failed.','error') self.session=0 elif resp: self.DEBUG('Binding failed: %s.'%resp.getTag('error'),'error') else: self.DEBUG('Binding failed: timeout expired.','error') return '' class ComponentBind(PlugIn): """ ComponentBind some JID to the current connection to allow router know of our location.""" def __init__(self, sasl): PlugIn.__init__(self) self.DBG_LINE='bind' self.bound=None self.needsUnregister=None self.sasl = sasl def plugin(self,owner): """ Start resource binding, if allowed at this time. Used internally. """ if not self.sasl: self.bound=[] return if self._owner.Dispatcher.Stream.features: try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) except NodeProcessed: pass else: self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) self.needsUnregister=1 def plugout(self): """ Remove ComponentBind handler from owner's dispatcher. Used internally. """ if self.needsUnregister: self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) def FeaturesHandler(self,conn,feats): """ Determine if server supports resource binding and set some internal attributes accordingly. """ if not feats.getTag('bind',namespace=NS_BIND): self.bound='failure' self.DEBUG('Server does not requested binding.','error') return if feats.getTag('session',namespace=NS_SESSION): self.session=1 else: self.session=-1 self.bound=[] def Bind(self,domain=None): """ Perform binding. Use provided domain name (if not provided). """ while self.bound is None and self._owner.Process(1): pass if self.sasl: xmlns = NS_COMPONENT_1 else: xmlns = None self.bindresponse = None ttl = dispatcher.DefaultTimeout self._owner.RegisterHandler('bind',self.BindHandler,xmlns=xmlns) self._owner.send(Protocol('bind',attrs={'name':domain},xmlns=NS_COMPONENT_1)) while self.bindresponse is None and self._owner.Process(1) and ttl > 0: ttl-=1 self._owner.UnregisterHandler('bind',self.BindHandler,xmlns=xmlns) resp=self.bindresponse if resp and resp.getAttr('error'): self.DEBUG('Binding failed: %s.'%resp.getAttr('error'),'error') elif resp: self.DEBUG('Successfully bound.','ok') return 'ok' else: self.DEBUG('Binding failed: timeout expired.','error') return '' def BindHandler(self,conn,bind): self.bindresponse = bind pass xmpppy-0.4.1/xmpp/browser.py0000644000175000000500000002362410622057064014736 0ustar normansrc## browser.py ## ## Copyright (C) 2004 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: browser.py,v 1.12 2007/05/13 17:55:14 normanr Exp $ """Browser module provides DISCO server framework for your application. This functionality can be used for very different purposes - from publishing software version and supported features to building of "jabber site" that users can navigate with their disco browsers and interact with active content. Such functionality is achieved via registering "DISCO handlers" that are automatically called when user requests some node of your disco tree. """ from dispatcher import * from client import PlugIn class Browser(PlugIn): """ WARNING! This class is for components only. It will not work in client mode! Standart xmpppy class that is ancestor of PlugIn and can be attached to your application. All processing will be performed in the handlers registered in the browser instance. You can register any number of handlers ensuring that for each node/jid combination only one (or none) handler registered. You can register static information or the fully-blown function that will calculate the answer dynamically. Example of static info (see JEP-0030, examples 13-14): # cl - your xmpppy connection instance. b=xmpp.browser.Browser() b.PlugIn(cl) items=[] item={} item['jid']='catalog.shakespeare.lit' item['node']='books' item['name']='Books by and about Shakespeare' items.append(item) item={} item['jid']='catalog.shakespeare.lit' item['node']='clothing' item['name']='Wear your literary taste with pride' items.append(item) item={} item['jid']='catalog.shakespeare.lit' item['node']='music' item['name']='Music from the time of Shakespeare' items.append(item) info={'ids':[], 'features':[]} b.setDiscoHandler({'items':items,'info':info}) items should be a list of item elements. every item element can have any of these four keys: 'jid', 'node', 'name', 'action' info should be a dicionary and must have keys 'ids' and 'features'. Both of them should be lists: ids is a list of dictionaries and features is a list of text strings. Example (see JEP-0030, examples 1-2) # cl - your xmpppy connection instance. b=xmpp.browser.Browser() b.PlugIn(cl) items=[] ids=[] ids.append({'category':'conference','type':'text','name':'Play-Specific Chatrooms'}) ids.append({'category':'directory','type':'chatroom','name':'Play-Specific Chatrooms'}) features=[NS_DISCO_INFO,NS_DISCO_ITEMS,NS_MUC,NS_REGISTER,NS_SEARCH,NS_TIME,NS_VERSION] info={'ids':ids,'features':features} # info['xdata']=xmpp.protocol.DataForm() # JEP-0128 b.setDiscoHandler({'items':[],'info':info}) """ def __init__(self): """Initialises internal variables. Used internally.""" PlugIn.__init__(self) DBG_LINE='browser' self._exported_methods=[] self._handlers={'':{}} def plugin(self, owner): """ Registers it's own iq handlers in your application dispatcher instance. Used internally.""" owner.RegisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_INFO) owner.RegisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_ITEMS) def plugout(self): """ Unregisters browser's iq handlers from your application dispatcher instance. Used internally.""" self._owner.UnregisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_INFO) self._owner.UnregisterHandler('iq',self._DiscoveryHandler,typ='get',ns=NS_DISCO_ITEMS) def _traversePath(self,node,jid,set=0): """ Returns dictionary and key or None,None None - root node (w/o "node" attribute) /a/b/c - node /a/b/ - branch Set returns '' or None as the key get returns '' or None as the key or None as the dict. Used internally.""" if self._handlers.has_key(jid): cur=self._handlers[jid] elif set: self._handlers[jid]={} cur=self._handlers[jid] else: cur=self._handlers[''] if node is None: node=[None] else: node=node.replace('/',' /').split('/') for i in node: if i<>'' and cur.has_key(i): cur=cur[i] elif set and i<>'': cur[i]={dict:cur,str:i}; cur=cur[i] elif set or cur.has_key(''): return cur,'' else: return None,None if cur.has_key(1) or set: return cur,1 raise "Corrupted data" def setDiscoHandler(self,handler,node='',jid=''): """ This is the main method that you will use in this class. It is used to register supplied DISCO handler (or dictionary with static info) as handler of some disco tree branch. If you do not specify the node this handler will be used for all queried nodes. If you do not specify the jid this handler will be used for all queried JIDs. Usage: cl.Browser.setDiscoHandler(someDict,node,jid) or cl.Browser.setDiscoHandler(someDISCOHandler,node,jid) where someDict={ 'items':[ {'jid':'jid1','action':'action1','node':'node1','name':'name1'}, {'jid':'jid2','action':'action2','node':'node2','name':'name2'}, {'jid':'jid3','node':'node3','name':'name3'}, {'jid':'jid4','node':'node4'} ], 'info' :{ 'ids':[ {'category':'category1','type':'type1','name':'name1'}, {'category':'category2','type':'type2','name':'name2'}, {'category':'category3','type':'type3','name':'name3'}, ], 'features':['feature1','feature2','feature3','feature4'], 'xdata':DataForm } } and/or def someDISCOHandler(session,request,TYR): # if TYR=='items': # returns items list of the same format as shown above # elif TYR=='info': # returns info dictionary of the same format as shown above # else: # this case is impossible for now. """ self.DEBUG('Registering handler %s for "%s" node->%s'%(handler,jid,node), 'info') node,key=self._traversePath(node,jid,1) node[key]=handler def getDiscoHandler(self,node='',jid=''): """ Returns the previously registered DISCO handler that is resonsible for this node/jid combination. Used internally.""" node,key=self._traversePath(node,jid) if node: return node[key] def delDiscoHandler(self,node='',jid=''): """ Unregisters DISCO handler that is resonsible for this node/jid combination. When handler is unregistered the branch is handled in the same way that it's parent branch from this moment. """ node,key=self._traversePath(node,jid) if node: handler=node[key] del node[dict][node[str]] return handler def _DiscoveryHandler(self,conn,request): """ Servers DISCO iq request from the remote client. Automatically determines the best handler to use and calls it to handle the request. Used internally. """ node=request.getQuerynode() if node: nodestr=node else: nodestr='None' handler=self.getDiscoHandler(node,request.getTo()) if not handler: self.DEBUG("No Handler for request with jid->%s node->%s ns->%s"%(request.getTo().__str__().encode('utf8'),nodestr.encode('utf8'),request.getQueryNS().encode('utf8')),'error') conn.send(Error(request,ERR_ITEM_NOT_FOUND)) raise NodeProcessed self.DEBUG("Handling request with jid->%s node->%s ns->%s"%(request.getTo().__str__().encode('utf8'),nodestr.encode('utf8'),request.getQueryNS().encode('utf8')),'ok') rep=request.buildReply('result') if node: rep.setQuerynode(node) q=rep.getTag('query') if request.getQueryNS()==NS_DISCO_ITEMS: # handler must return list: [{jid,action,node,name}] if type(handler)==dict: lst=handler['items'] else: lst=handler(conn,request,'items') if lst==None: conn.send(Error(request,ERR_ITEM_NOT_FOUND)) raise NodeProcessed for item in lst: q.addChild('item',item) elif request.getQueryNS()==NS_DISCO_INFO: if type(handler)==dict: dt=handler['info'] else: dt=handler(conn,request,'info') if dt==None: conn.send(Error(request,ERR_ITEM_NOT_FOUND)) raise NodeProcessed # handler must return dictionary: # {'ids':[{},{},{},{}], 'features':[fe,at,ur,es], 'xdata':DataForm} for id in dt['ids']: q.addChild('identity',id) for feature in dt['features']: q.addChild('feature',{'var':feature}) if dt.has_key('xdata'): q.addChild(node=dt['xdata']) conn.send(rep) raise NodeProcessed xmpppy-0.4.1/xmpp/client.py0000644000175000000500000004007610664771365014546 0ustar normansrc## client.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: client.py,v 1.60 2007/08/28 10:03:33 normanr Exp $ """ Provides PlugIn class functionality to develop extentions for xmpppy. Also provides Client and Component classes implementations as the examples of xmpppy structures usage. These classes can be used for simple applications "AS IS" though. """ import socket import debug Debug=debug Debug.DEBUGGING_IS_ON=1 Debug.Debug.colors['socket']=debug.color_dark_gray Debug.Debug.colors['CONNECTproxy']=debug.color_dark_gray Debug.Debug.colors['nodebuilder']=debug.color_brown Debug.Debug.colors['client']=debug.color_cyan Debug.Debug.colors['component']=debug.color_cyan Debug.Debug.colors['dispatcher']=debug.color_green Debug.Debug.colors['browser']=debug.color_blue Debug.Debug.colors['auth']=debug.color_yellow Debug.Debug.colors['roster']=debug.color_magenta Debug.Debug.colors['ibb']=debug.color_yellow Debug.Debug.colors['down']=debug.color_brown Debug.Debug.colors['up']=debug.color_brown Debug.Debug.colors['data']=debug.color_brown Debug.Debug.colors['ok']=debug.color_green Debug.Debug.colors['warn']=debug.color_yellow Debug.Debug.colors['error']=debug.color_red Debug.Debug.colors['start']=debug.color_dark_gray Debug.Debug.colors['stop']=debug.color_dark_gray Debug.Debug.colors['sent']=debug.color_yellow Debug.Debug.colors['got']=debug.color_bright_cyan DBG_CLIENT='client' DBG_COMPONENT='component' class PlugIn: """ Common xmpppy plugins infrastructure: plugging in/out, debugging. """ def __init__(self): self._exported_methods=[] self.DBG_LINE=self.__class__.__name__.lower() def PlugIn(self,owner): """ Attach to main instance and register ourself and all our staff in it. """ self._owner=owner if self.DBG_LINE not in owner.debug_flags: owner.debug_flags.append(self.DBG_LINE) self.DEBUG('Plugging %s into %s'%(self,self._owner),'start') if owner.__dict__.has_key(self.__class__.__name__): return self.DEBUG('Plugging ignored: another instance already plugged.','error') self._old_owners_methods=[] for method in self._exported_methods: if owner.__dict__.has_key(method.__name__): self._old_owners_methods.append(owner.__dict__[method.__name__]) owner.__dict__[method.__name__]=method owner.__dict__[self.__class__.__name__]=self if self.__class__.__dict__.has_key('plugin'): return self.plugin(owner) def PlugOut(self): """ Unregister all our staff from main instance and detach from it. """ self.DEBUG('Plugging %s out of %s.'%(self,self._owner),'stop') ret = None if self.__class__.__dict__.has_key('plugout'): ret = self.plugout() self._owner.debug_flags.remove(self.DBG_LINE) for method in self._exported_methods: del self._owner.__dict__[method.__name__] for method in self._old_owners_methods: self._owner.__dict__[method.__name__]=method del self._owner.__dict__[self.__class__.__name__] return ret def DEBUG(self,text,severity='info'): """ Feed a provided debug line to main instance's debug facility along with our ID string. """ self._owner.DEBUG(self.DBG_LINE,text,severity) import transports,dispatcher,auth,roster class CommonClient: """ Base for Client and Component classes.""" def __init__(self,server,port=5222,debug=['always', 'nodebuilder']): """ Caches server name and (optionally) port to connect to. "debug" parameter specifies the debug IDs that will go into debug output. You can either specifiy an "include" or "exclude" list. The latter is done via adding "always" pseudo-ID to the list. Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket', 'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] . """ if self.__class__.__name__=='Client': self.Namespace,self.DBG='jabber:client',DBG_CLIENT elif self.__class__.__name__=='Component': self.Namespace,self.DBG=dispatcher.NS_COMPONENT_ACCEPT,DBG_COMPONENT self.defaultNamespace=self.Namespace self.disconnect_handlers=[] self.Server=server self.Port=port if debug and type(debug)<>list: debug=['always', 'nodebuilder'] self._DEBUG=Debug.Debug(debug) self.DEBUG=self._DEBUG.Show self.debug_flags=self._DEBUG.debug_flags self.debug_flags.append(self.DBG) self._owner=self self._registered_name=None self.RegisterDisconnectHandler(self.DisconnectHandler) self.connected='' self._route=0 def RegisterDisconnectHandler(self,handler): """ Register handler that will be called on disconnect.""" self.disconnect_handlers.append(handler) def UnregisterDisconnectHandler(self,handler): """ Unregister handler that is called on disconnect.""" self.disconnect_handlers.remove(handler) def disconnected(self): """ Called on disconnection. Calls disconnect handlers and cleans things up. """ self.connected='' self.DEBUG(self.DBG,'Disconnect detected','stop') self.disconnect_handlers.reverse() for i in self.disconnect_handlers: i() self.disconnect_handlers.reverse() if self.__dict__.has_key('TLS'): self.TLS.PlugOut() def DisconnectHandler(self): """ Default disconnect handler. Just raises an IOError. If you choosed to use this class in your production client, override this method or at least unregister it. """ raise IOError('Disconnected from server.') def event(self,eventName,args={}): """ Default event handler. To be overriden. """ print "Event: ",(eventName,args) def isConnected(self): """ Returns connection state. F.e.: None / 'tls' / 'tcp+non_sasl' . """ return self.connected def reconnectAndReauth(self): """ Example of reconnection method. In fact, it can be used to batch connection and auth as well. """ handlerssave=self.Dispatcher.dumpHandlers() if self.__dict__.has_key('ComponentBind'): self.ComponentBind.PlugOut() if self.__dict__.has_key('Bind'): self.Bind.PlugOut() self._route=0 if self.__dict__.has_key('NonSASL'): self.NonSASL.PlugOut() if self.__dict__.has_key('SASL'): self.SASL.PlugOut() if self.__dict__.has_key('TLS'): self.TLS.PlugOut() self.Dispatcher.PlugOut() if self.__dict__.has_key('HTTPPROXYsocket'): self.HTTPPROXYsocket.PlugOut() if self.__dict__.has_key('TCPsocket'): self.TCPsocket.PlugOut() if not self.connect(server=self._Server,proxy=self._Proxy): return if not self.auth(self._User,self._Password,self._Resource): return self.Dispatcher.restoreHandlers(handlerssave) return self.connected def connect(self,server=None,proxy=None,ssl=None,use_srv=None): """ Make a tcp/ip connection, protect it with tls/ssl if possible and start XMPP stream. Returns None or 'tcp' or 'tls', depending on the result.""" if not server: server=(self.Server,self.Port) if proxy: sock=transports.HTTPPROXYsocket(proxy,server,use_srv) else: sock=transports.TCPsocket(server,use_srv) connected=sock.PlugIn(self) if not connected: sock.PlugOut() return self._Server,self._Proxy=server,proxy self.connected='tcp' if (ssl is None and self.Connection.getPort() in (5223, 443)) or ssl: try: # FIXME. This should be done in transports.py transports.TLS().PlugIn(self,now=1) self.connected='ssl' except socket.sslerror: return dispatcher.Dispatcher().PlugIn(self) while self.Dispatcher.Stream._document_attrs is None: if not self.Process(1): return if self.Dispatcher.Stream._document_attrs.has_key('version') and self.Dispatcher.Stream._document_attrs['version']=='1.0': while not self.Dispatcher.Stream.features and self.Process(1): pass # If we get version 1.0 stream the features tag MUST BE presented return self.connected class Client(CommonClient): """ Example client class, based on CommonClient. """ def connect(self,server=None,proxy=None,secure=None,use_srv=True): """ Connect to jabber server. If you want to specify different ip/port to connect to you can pass it as tuple as first parameter. If there is HTTP proxy between you and server specify it's address and credentials (if needed) in the second argument. If you want ssl/tls support to be discovered and enable automatically - leave third argument as None. (ssl will be autodetected only if port is 5223 or 443) If you want to force SSL start (i.e. if port 5223 or 443 is remapped to some non-standard port) then set it to 1. If you want to disable tls/ssl support completely, set it to 0. Example: connect(('192.168.5.5',5222),{'host':'proxy.my.net','port':8080,'user':'me','password':'secret'}) Returns '' or 'tcp' or 'tls', depending on the result.""" if not CommonClient.connect(self,server,proxy,secure,use_srv) or secure<>None and not secure: return self.connected transports.TLS().PlugIn(self) if not self.Dispatcher.Stream._document_attrs.has_key('version') or not self.Dispatcher.Stream._document_attrs['version']=='1.0': return self.connected while not self.Dispatcher.Stream.features and self.Process(1): pass # If we get version 1.0 stream the features tag MUST BE presented if not self.Dispatcher.Stream.features.getTag('starttls'): return self.connected # TLS not supported by server while not self.TLS.starttls and self.Process(1): pass if not hasattr(self, 'TLS') or self.TLS.starttls!='success': self.event('tls_failed'); return self.connected self.connected='tls' return self.connected def auth(self,user,password,resource='',sasl=1): """ Authenticate connnection and bind resource. If resource is not provided random one or library name used. """ self._User,self._Password,self._Resource=user,password,resource while not self.Dispatcher.Stream._document_attrs and self.Process(1): pass if self.Dispatcher.Stream._document_attrs.has_key('version') and self.Dispatcher.Stream._document_attrs['version']=='1.0': while not self.Dispatcher.Stream.features and self.Process(1): pass # If we get version 1.0 stream the features tag MUST BE presented if sasl: auth.SASL(user,password).PlugIn(self) if not sasl or self.SASL.startsasl=='not-supported': if not resource: resource='xmpppy' if auth.NonSASL(user,password,resource).PlugIn(self): self.connected+='+old_auth' return 'old_auth' return self.SASL.auth() while self.SASL.startsasl=='in-process' and self.Process(1): pass if self.SASL.startsasl=='success': auth.Bind().PlugIn(self) while self.Bind.bound is None and self.Process(1): pass if self.Bind.Bind(resource): self.connected+='+sasl' return 'sasl' else: if self.__dict__.has_key('SASL'): self.SASL.PlugOut() def getRoster(self): """ Return the Roster instance, previously plugging it in and requesting roster from server if needed. """ if not self.__dict__.has_key('Roster'): roster.Roster().PlugIn(self) return self.Roster.getRoster() def sendInitPresence(self,requestRoster=1): """ Send roster request and initial . You can disable the first by setting requestRoster argument to 0. """ self.sendPresence(requestRoster=requestRoster) def sendPresence(self,jid=None,typ=None,requestRoster=0): """ Send some specific presence state. Can also request roster from server if according agrument is set.""" if requestRoster: roster.Roster().PlugIn(self) self.send(dispatcher.Presence(to=jid, typ=typ)) class Component(CommonClient): """ Component class. The only difference from CommonClient is ability to perform component authentication. """ def __init__(self,server,port=5347,typ=None,debug=['always', 'nodebuilder'],domains=None,sasl=0,bind=0,route=0,xcp=0): """ Init function for Components. As components use a different auth mechanism which includes the namespace of the component. Jabberd1.4 and Ejabberd use the default namespace then for all client messages. Jabberd2 uses jabber:client. 'server' argument is a server name that you are connecting to (f.e. "localhost"). 'port' can be specified if 'server' resolves to correct IP. If it is not then you'll need to specify IP and port while calling "connect()".""" CommonClient.__init__(self,server,port=port,debug=debug) self.typ=typ self.sasl=sasl self.bind=bind self.route=route self.xcp=xcp if domains: self.domains=domains else: self.domains=[server] def connect(self,server=None,proxy=None): """ This will connect to the server, and if the features tag is found then set the namespace to be jabber:client as that is required for jabberd2. 'server' and 'proxy' arguments have the same meaning as in xmpp.Client.connect() """ if self.sasl: self.Namespace=auth.NS_COMPONENT_1 self.Server=server[0] CommonClient.connect(self,server=server,proxy=proxy) if self.connected and (self.typ=='jabberd2' or not self.typ and self.Dispatcher.Stream.features != None) and (not self.xcp): self.defaultNamespace=auth.NS_CLIENT self.Dispatcher.RegisterNamespace(self.defaultNamespace) self.Dispatcher.RegisterProtocol('iq',dispatcher.Iq) self.Dispatcher.RegisterProtocol('message',dispatcher.Message) self.Dispatcher.RegisterProtocol('presence',dispatcher.Presence) return self.connected def dobind(self, sasl): # This has to be done before binding, because we can receive a route stanza before binding finishes self._route = self.route if self.bind: for domain in self.domains: auth.ComponentBind(sasl).PlugIn(self) while self.ComponentBind.bound is None: self.Process(1) if (not self.ComponentBind.Bind(domain)): self.ComponentBind.PlugOut() return self.ComponentBind.PlugOut() def auth(self,name,password,dup=None): """ Authenticate component "name" with password "password".""" self._User,self._Password,self._Resource=name,password,'' try: if self.sasl: auth.SASL(name,password).PlugIn(self) if not self.sasl or self.SASL.startsasl=='not-supported': if auth.NonSASL(name,password,'').PlugIn(self): self.dobind(sasl=False) self.connected+='+old_auth' return 'old_auth' return self.SASL.auth() while self.SASL.startsasl=='in-process' and self.Process(1): pass if self.SASL.startsasl=='success': self.dobind(sasl=True) self.connected+='+sasl' return 'sasl' else: raise auth.NotAuthorized(self.SASL.startsasl) except: self.DEBUG(self.DBG,"Failed to authenticate %s"%name,'error') xmpppy-0.4.1/xmpp/commands.py0000644000175000000500000003736410664770307015072 0ustar normansrc## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $ ## Ad-Hoc Command manager ## Mike Albon (c) 5th January 2005 ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. """This module is a ad-hoc command processor for xmpppy. It uses the plug-in mechanism like most of the core library. It depends on a DISCO browser manager. There are 3 classes here, a command processor Commands like the Browser, and a command template plugin Command, and an example command. To use this module: Instansiate the module with the parent transport and disco browser manager as parameters. 'Plug in' commands using the command template. The command feature must be added to existing disco replies where neccessary. What it supplies: Automatic command registration with the disco browser manager. Automatic listing of commands in the public command list. A means of handling requests, by redirection though the command manager. """ from protocol import * from client import PlugIn class Commands(PlugIn): """Commands is an ancestor of PlugIn and can be attached to any session. The commands class provides a lookup and browse mechnism. It follows the same priciple of the Browser class, for Service Discovery to provide the list of commands, it adds the 'list' disco type to your existing disco handler function. How it works: The commands are added into the existing Browser on the correct nodes. When the command list is built the supplied discovery handler function needs to have a 'list' option in type. This then gets enumerated, all results returned as None are ignored. The command executed is then called using it's Execute method. All session management is handled by the command itself. """ def __init__(self, browser): """Initialises class and sets up local variables""" PlugIn.__init__(self) DBG_LINE='commands' self._exported_methods=[] self._handlers={'':{}} self._browser = browser def plugin(self, owner): """Makes handlers within the session""" # Plug into the session and the disco manager # We only need get and set, results are not needed by a service provider, only a service user. owner.RegisterHandler('iq',self._CommandHandler,typ='set',ns=NS_COMMANDS) owner.RegisterHandler('iq',self._CommandHandler,typ='get',ns=NS_COMMANDS) self._browser.setDiscoHandler(self._DiscoHandler,node=NS_COMMANDS,jid='') def plugout(self): """Removes handlers from the session""" # unPlug from the session and the disco manager self._owner.UnregisterHandler('iq',self._CommandHandler,ns=NS_COMMANDS) for jid in self._handlers: self._browser.delDiscoHandler(self._DiscoHandler,node=NS_COMMANDS) def _CommandHandler(self,conn,request): """The internal method to process the routing of command execution requests""" # This is the command handler itself. # We must: # Pass on command execution to command handler # (Do we need to keep session details here, or can that be done in the command?) jid = str(request.getTo()) try: node = request.getTagAttr('command','node') except: conn.send(Error(request,ERR_BAD_REQUEST)) raise NodeProcessed if self._handlers.has_key(jid): if self._handlers[jid].has_key(node): self._handlers[jid][node]['execute'](conn,request) else: conn.send(Error(request,ERR_ITEM_NOT_FOUND)) raise NodeProcessed elif self._handlers[''].has_key(node): self._handlers[''][node]['execute'](conn,request) else: conn.send(Error(request,ERR_ITEM_NOT_FOUND)) raise NodeProcessed def _DiscoHandler(self,conn,request,typ): """The internal method to process service discovery requests""" # This is the disco manager handler. if typ == 'items': # We must: # Generate a list of commands and return the list # * This handler does not handle individual commands disco requests. # Pseudo: # Enumerate the 'item' disco of each command for the specified jid # Build responce and send # To make this code easy to write we add an 'list' disco type, it returns a tuple or 'none' if not advertised list = [] items = [] jid = str(request.getTo()) # Get specific jid based results if self._handlers.has_key(jid): for each in self._handlers[jid].keys(): items.append((jid,each)) else: # Get generic results for each in self._handlers[''].keys(): items.append(('',each)) if items != []: for each in items: i = self._handlers[each[0]][each[1]]['disco'](conn,request,'list') if i != None: list.append(Node(tag='item',attrs={'jid':i[0],'node':i[1],'name':i[2]})) iq = request.buildReply('result') if request.getQuerynode(): iq.setQuerynode(request.getQuerynode()) iq.setQueryPayload(list) conn.send(iq) else: conn.send(Error(request,ERR_ITEM_NOT_FOUND)) raise NodeProcessed elif typ == 'info': return {'ids':[{'category':'automation','type':'command-list'}],'features':[]} def addCommand(self,name,cmddisco,cmdexecute,jid=''): """The method to call if adding a new command to the session, the requred parameters of cmddisco and cmdexecute are the methods to enable that command to be executed""" # This command takes a command object and the name of the command for registration # We must: # Add item into disco # Add item into command list if not self._handlers.has_key(jid): self._handlers[jid]={} self._browser.setDiscoHandler(self._DiscoHandler,node=NS_COMMANDS,jid=jid) if self._handlers[jid].has_key(name): raise NameError,'Command Exists' else: self._handlers[jid][name]={'disco':cmddisco,'execute':cmdexecute} # Need to add disco stuff here self._browser.setDiscoHandler(cmddisco,node=name,jid=jid) def delCommand(self,name,jid=''): """Removed command from the session""" # This command takes a command object and the name used for registration # We must: # Remove item from disco # Remove item from command list if not self._handlers.has_key(jid): raise NameError,'Jid not found' if not self._handlers[jid].has_key(name): raise NameError, 'Command not found' else: #Do disco removal here command = self.getCommand(name,jid)['disco'] del self._handlers[jid][name] self._browser.delDiscoHandler(command,node=name,jid=jid) def getCommand(self,name,jid=''): """Returns the command tuple""" # This gets the command object with name # We must: # Return item that matches this name if not self._handlers.has_key(jid): raise NameError,'Jid not found' elif not self._handlers[jid].has_key(name): raise NameError,'Command not found' else: return self._handlers[jid][name] class Command_Handler_Prototype(PlugIn): """This is a prototype command handler, as each command uses a disco method and execute method you can implement it any way you like, however this is my first attempt at making a generic handler that you can hang process stages on too. There is an example command below. The parameters are as follows: name : the name of the command within the jabber environment description : the natural language description discofeatures : the features supported by the command initial : the initial command in the from of {'execute':commandname} All stages set the 'actions' dictionary for each session to represent the possible options available. """ name = 'examplecommand' count = 0 description = 'an example command' discofeatures = [NS_COMMANDS,NS_DATA] # This is the command template def __init__(self,jid=''): """Set up the class""" PlugIn.__init__(self) DBG_LINE='command' self.sessioncount = 0 self.sessions = {} # Disco information for command list pre-formatted as a tuple self.discoinfo = {'ids':[{'category':'automation','type':'command-node','name':self.description}],'features': self.discofeatures} self._jid = jid def plugin(self,owner): """Plug command into the commands class""" # The owner in this instance is the Command Processor self._commands = owner self._owner = owner._owner self._commands.addCommand(self.name,self._DiscoHandler,self.Execute,jid=self._jid) def plugout(self): """Remove command from the commands class""" self._commands.delCommand(self.name,self._jid) def getSessionID(self): """Returns an id for the command session""" self.count = self.count+1 return 'cmd-%s-%d'%(self.name,self.count) def Execute(self,conn,request): """The method that handles all the commands, and routes them to the correct method for that stage.""" # New request or old? try: session = request.getTagAttr('command','sessionid') except: session = None try: action = request.getTagAttr('command','action') except: action = None if action == None: action = 'execute' # Check session is in session list if self.sessions.has_key(session): if self.sessions[session]['jid']==request.getFrom(): # Check action is vaild if self.sessions[session]['actions'].has_key(action): # Execute next action self.sessions[session]['actions'][action](conn,request) else: # Stage not presented as an option self._owner.send(Error(request,ERR_BAD_REQUEST)) raise NodeProcessed else: # Jid and session don't match. Go away imposter self._owner.send(Error(request,ERR_BAD_REQUEST)) raise NodeProcessed elif session != None: # Not on this sessionid you won't. self._owner.send(Error(request,ERR_BAD_REQUEST)) raise NodeProcessed else: # New session self.initial[action](conn,request) def _DiscoHandler(self,conn,request,type): """The handler for discovery events""" if type == 'list': return (request.getTo(),self.name,self.description) elif type == 'items': return [] elif type == 'info': return self.discoinfo class TestCommand(Command_Handler_Prototype): """ Example class. You should read source if you wish to understate how it works. Generally, it presents a "master" that giudes user through to calculate something. """ name = 'testcommand' description = 'a noddy example command' def __init__(self,jid=''): """ Init internal constants. """ Command_Handler_Prototype.__init__(self,jid) self.initial = {'execute':self.cmdFirstStage} def cmdFirstStage(self,conn,request): """ Determine """ # This is the only place this should be repeated as all other stages should have SessionIDs try: session = request.getTagAttr('command','sessionid') except: session = None if session == None: session = self.getSessionID() self.sessions[session]={'jid':request.getFrom(),'actions':{'cancel':self.cmdCancel,'next':self.cmdSecondStage,'execute':self.cmdSecondStage},'data':{'type':None}} # As this is the first stage we only send a form reply = request.buildReply('result') form = DataForm(title='Select type of operation',data=['Use the combobox to select the type of calculation you would like to do, then click Next',DataField(name='calctype',desc='Calculation Type',value=self.sessions[session]['data']['type'],options=[['circlediameter','Calculate the Diameter of a circle'],['circlearea','Calculate the area of a circle']],typ='list-single',required=1)]) replypayload = [Node('actions',attrs={'execute':'next'},payload=[Node('next')]),form] reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':session,'status':'executing'},payload=replypayload) self._owner.send(reply) raise NodeProcessed def cmdSecondStage(self,conn,request): form = DataForm(node = request.getTag(name='command').getTag(name='x',namespace=NS_DATA)) self.sessions[request.getTagAttr('command','sessionid')]['data']['type']=form.getField('calctype').getValue() self.sessions[request.getTagAttr('command','sessionid')]['actions']={'cancel':self.cmdCancel,None:self.cmdThirdStage,'previous':self.cmdFirstStage,'execute':self.cmdThirdStage,'next':self.cmdThirdStage} # The form generation is split out to another method as it may be called by cmdThirdStage self.cmdSecondStageReply(conn,request) def cmdSecondStageReply(self,conn,request): reply = request.buildReply('result') form = DataForm(title = 'Enter the radius', data=['Enter the radius of the circle (numbers only)',DataField(desc='Radius',name='radius',typ='text-single')]) replypayload = [Node('actions',attrs={'execute':'complete'},payload=[Node('complete'),Node('prev')]),form] reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'executing'},payload=replypayload) self._owner.send(reply) raise NodeProcessed def cmdThirdStage(self,conn,request): form = DataForm(node = request.getTag(name='command').getTag(name='x',namespace=NS_DATA)) try: num = float(form.getField('radius').getValue()) except: self.cmdSecondStageReply(conn,request) from math import pi if self.sessions[request.getTagAttr('command','sessionid')]['data']['type'] == 'circlearea': result = (num**2)*pi else: result = num*2*pi reply = request.buildReply('result') form = DataForm(typ='result',data=[DataField(desc='result',name='result',value=result)]) reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'completed'},payload=[form]) self._owner.send(reply) raise NodeProcessed def cmdCancel(self,conn,request): reply = request.buildReply('result') reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':request.getTagAttr('command','node'),'sessionid':request.getTagAttr('command','sessionid'),'status':'cancelled'}) self._owner.send(reply) del self.sessions[request.getTagAttr('command','sessionid')] xmpppy-0.4.1/xmpp/debug.py0000644000175000000500000003336510411157450014340 0ustar normansrc## debug.py ## ## Copyright (C) 2003 Jacob Lundqvist ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License as published ## by the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. _version_ = '1.4.0' """\ Generic debug class Other modules can always define extra debug flags for local usage, as long as they make sure they append them to debug_flags Also its always a good thing to prefix local flags with something, to reduce risk of coliding flags. Nothing breaks if two flags would be identical, but it might activate unintended debugging. flags can be numeric, but that makes analysing harder, on creation its not obvious what is activated, and when flag_show is given, output isnt really meaningfull. This Debug class can either be initialized and used on app level, or used independantly by the individual classes. For samples of usage, see samples subdir in distro source, and selftest in this code """ import sys import traceback import time import os import types if os.environ.has_key('TERM'): colors_enabled=True else: colors_enabled=False color_none = chr(27) + "[0m" color_black = chr(27) + "[30m" color_red = chr(27) + "[31m" color_green = chr(27) + "[32m" color_brown = chr(27) + "[33m" color_blue = chr(27) + "[34m" color_magenta = chr(27) + "[35m" color_cyan = chr(27) + "[36m" color_light_gray = chr(27) + "[37m" color_dark_gray = chr(27) + "[30;1m" color_bright_red = chr(27) + "[31;1m" color_bright_green = chr(27) + "[32;1m" color_yellow = chr(27) + "[33;1m" color_bright_blue = chr(27) + "[34;1m" color_purple = chr(27) + "[35;1m" color_bright_cyan = chr(27) + "[36;1m" color_white = chr(27) + "[37;1m" """ Define your flags in yor modules like this: from debug import * DBG_INIT = 'init' ; debug_flags.append( DBG_INIT ) DBG_CONNECTION = 'connection' ; debug_flags.append( DBG_CONNECTION ) The reason for having a double statement wis so we can validate params and catch all undefined debug flags This gives us control over all used flags, and makes it easier to allow global debugging in your code, just do something like foo = Debug( debug_flags ) group flags, that is a flag in it self containing multiple flags should be defined without the debug_flags.append() sequence, since the parts are already in the list, also they must of course be defined after the flags they depend on ;) example: DBG_MULTI = [ DBG_INIT, DBG_CONNECTION ] NoDebug ------- To speed code up, typically for product releases or such use this class instead if you globaly want to disable debugging """ class NoDebug: def __init__( self, *args, **kwargs ): self.debug_flags = [] def show( self, *args, **kwargs): pass def Show( self, *args, **kwargs): pass def is_active( self, flag ): pass colors={} def active_set( self, active_flags = None ): return 0 LINE_FEED = '\n' class Debug: def __init__( self, # # active_flags are those that will trigger output # active_flags = None, # # Log file should be file object or file namne # log_file = sys.stderr, # # prefix and sufix can either be set globaly or per call. # personally I use this to color code debug statements # with prefix = chr(27) + '[34m' # sufix = chr(27) + '[37;1m\n' # prefix = 'DEBUG: ', sufix = '\n', # # If you want unix style timestamps, # 0 disables timestamps # 1 before prefix, good when prefix is a string # 2 after prefix, good when prefix is a color # time_stamp = 0, # # flag_show should normaly be of, but can be turned on to get a # good view of what flags are actually used for calls, # if it is not None, it should be a string # flags for current call will be displayed # with flag_show as separator # recomended values vould be '-' or ':', but any string goes # flag_show = None, # # If you dont want to validate flags on each call to # show(), set this to 0 # validate_flags = 1, # # If you dont want the welcome message, set to 0 # default is to show welcome if any flags are active welcome = -1 ): self.debug_flags = [] if welcome == -1: if active_flags and len(active_flags): welcome = 1 else: welcome = 0 self._remove_dupe_flags() if log_file: if type( log_file ) is type(''): try: self._fh = open(log_file,'w') except: print 'ERROR: can open %s for writing' sys.exit(0) else: ## assume its a stream type object self._fh = log_file else: self._fh = sys.stdout if time_stamp not in (0,1,2): msg2 = '%s' % time_stamp raise 'Invalid time_stamp param', msg2 self.prefix = prefix self.sufix = sufix self.time_stamp = time_stamp self.flag_show = None # must be initialised after possible welcome self.validate_flags = validate_flags self.active_set( active_flags ) if welcome: self.show('') caller = sys._getframe(1) # used to get name of caller try: mod_name= ":%s" % caller.f_locals['__name__'] except: mod_name = "" self.show('Debug created for %s%s' % (caller.f_code.co_filename, mod_name )) self.show(' flags defined: %s' % ','.join( self.active )) if type(flag_show) in (type(''), type(None)): self.flag_show = flag_show else: msg2 = '%s' % type(flag_show ) raise 'Invalid type for flag_show!', msg2 def show( self, msg, flag = None, prefix = None, sufix = None, lf = 0 ): """ flag can be of folowing types: None - this msg will always be shown if any debugging is on flag - will be shown if flag is active (flag1,flag2,,,) - will be shown if any of the given flags are active if prefix / sufix are not given, default ones from init will be used lf = -1 means strip linefeed if pressent lf = 1 means add linefeed if not pressent """ if self.validate_flags: self._validate_flag( flag ) if not self.is_active(flag): return if prefix: pre = prefix else: pre = self.prefix if sufix: suf = sufix else: suf = self.sufix if self.time_stamp == 2: output = '%s%s ' % ( pre, time.strftime('%b %d %H:%M:%S', time.localtime(time.time() )), ) elif self.time_stamp == 1: output = '%s %s' % ( time.strftime('%b %d %H:%M:%S', time.localtime(time.time() )), pre, ) else: output = pre if self.flag_show: if flag: output = '%s%s%s' % ( output, flag, self.flag_show ) else: # this call uses the global default, # dont print "None", just show the separator output = '%s %s' % ( output, self.flag_show ) output = '%s%s%s' % ( output, msg, suf ) if lf: # strip/add lf if needed last_char = output[-1] if lf == 1 and last_char != LINE_FEED: output = output + LINE_FEED elif lf == -1 and last_char == LINE_FEED: output = output[:-1] try: self._fh.write( output ) except: # unicode strikes again ;) s=u'' for i in range(len(output)): if ord(output[i]) < 128: c = output[i] else: c = '?' s=s+c self._fh.write( '%s%s%s' % ( pre, s, suf )) self._fh.flush() def is_active( self, flag ): 'If given flag(s) should generate output.' # try to abort early to quicken code if not self.active: return 0 if not flag or flag in self.active: return 1 else: # check for multi flag type: if type( flag ) in ( type(()), type([]) ): for s in flag: if s in self.active: return 1 return 0 def active_set( self, active_flags = None ): "returns 1 if any flags where actually set, otherwise 0." r = 0 ok_flags = [] if not active_flags: #no debuging at all self.active = [] elif type( active_flags ) in ( types.TupleType, types.ListType ): flags = self._as_one_list( active_flags ) for t in flags: if t not in self.debug_flags: sys.stderr.write('Invalid debugflag given: %s\n' % t ) ok_flags.append( t ) self.active = ok_flags r = 1 else: # assume comma string try: flags = active_flags.split(',') except: self.show( '***' ) self.show( '*** Invalid debug param given: %s' % active_flags ) self.show( '*** please correct your param!' ) self.show( '*** due to this, full debuging is enabled' ) self.active = self.debug_flags for f in flags: s = f.strip() ok_flags.append( s ) self.active = ok_flags self._remove_dupe_flags() return r def active_get( self ): "returns currently active flags." return self.active def _as_one_list( self, items ): """ init param might contain nested lists, typically from group flags. This code organises lst and remves dupes """ if type( items ) <> type( [] ) and type( items ) <> type( () ): return [ items ] r = [] for l in items: if type( l ) == type([]): lst2 = self._as_one_list( l ) for l2 in lst2: self._append_unique_str(r, l2 ) elif l == None: continue else: self._append_unique_str(r, l ) return r def _append_unique_str( self, lst, item ): """filter out any dupes.""" if type(item) <> type(''): msg2 = '%s' % item raise 'Invalid item type (should be string)',msg2 if item not in lst: lst.append( item ) return lst def _validate_flag( self, flags ): 'verify that flag is defined.' if flags: for f in self._as_one_list( flags ): if not f in self.debug_flags: msg2 = '%s' % f raise 'Invalid debugflag given', msg2 def _remove_dupe_flags( self ): """ if multiple instances of Debug is used in same app, some flags might be created multiple time, filter out dupes """ unique_flags = [] for f in self.debug_flags: if f not in unique_flags: unique_flags.append(f) self.debug_flags = unique_flags colors={} def Show(self, flag, msg, prefix=''): msg=msg.replace('\r','\\r').replace('\n','\\n').replace('><','>\n <') if not colors_enabled: pass elif self.colors.has_key(prefix): msg=self.colors[prefix]+msg+color_none else: msg=color_none+msg if not colors_enabled: prefixcolor='' elif self.colors.has_key(flag): prefixcolor=self.colors[flag] else: prefixcolor=color_none if prefix=='error': _exception = sys.exc_info() if _exception[0]: msg=msg+'\n'+''.join(traceback.format_exception(_exception[0], _exception[1], _exception[2])).rstrip() prefix= self.prefix+prefixcolor+(flag+' '*12)[:12]+' '+(prefix+' '*6)[:6] self.show(msg, flag, prefix) def is_active( self, flag ): if not self.active: return 0 if not flag or flag in self.active and DBG_ALWAYS not in self.active or flag not in self.active and DBG_ALWAYS in self.active : return 1 return 0 DBG_ALWAYS='always' ##Uncomment this to effectively disable all debugging and all debugging overhead. #Debug=NoDebug xmpppy-0.4.1/xmpp/dispatcher.py0000644000175000000500000004306610623433454015405 0ustar normansrc## transports.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: dispatcher.py,v 1.42 2007/05/18 23:18:36 normanr Exp $ """ Main xmpppy mechanism. Provides library with methods to assign different handlers to different XMPP stanzas. Contains one tunable attribute: DefaultTimeout (25 seconds by default). It defines time that Dispatcher.SendAndWaitForResponce method will wait for reply stanza before giving up. """ import simplexml,time,sys from protocol import * from client import PlugIn DefaultTimeout=25 ID=0 class Dispatcher(PlugIn): """ Ancestor of PlugIn class. Handles XMPP stream, i.e. aware of stream headers. Can be plugged out/in to restart these headers (used for SASL f.e.). """ def __init__(self): PlugIn.__init__(self) DBG_LINE='dispatcher' self.handlers={} self._expected={} self._defaultHandler=None self._pendingExceptions=[] self._eventHandler=None self._cycleHandlers=[] self._exported_methods=[self.Process,self.RegisterHandler,self.RegisterDefaultHandler,\ self.RegisterEventHandler,self.UnregisterCycleHandler,self.RegisterCycleHandler,\ self.RegisterHandlerOnce,self.UnregisterHandler,self.RegisterProtocol,\ self.WaitForResponse,self.SendAndWaitForResponse,self.send,self.disconnect,\ self.SendAndCallForResponse, ] def dumpHandlers(self): """ Return set of user-registered callbacks in it's internal format. Used within the library to carry user handlers set over Dispatcher replugins. """ return self.handlers def restoreHandlers(self,handlers): """ Restores user-registered callbacks structure from dump previously obtained via dumpHandlers. Used within the library to carry user handlers set over Dispatcher replugins. """ self.handlers=handlers def _init(self): """ Registers default namespaces/protocols/handlers. Used internally. """ self.RegisterNamespace('unknown') self.RegisterNamespace(NS_STREAMS) self.RegisterNamespace(self._owner.defaultNamespace) self.RegisterProtocol('iq',Iq) self.RegisterProtocol('presence',Presence) self.RegisterProtocol('message',Message) self.RegisterDefaultHandler(self.returnStanzaHandler) self.RegisterHandler('error',self.streamErrorHandler,xmlns=NS_STREAMS) def plugin(self, owner): """ Plug the Dispatcher instance into Client class instance and send initial stream header. Used internally.""" self._init() for method in self._old_owners_methods: if method.__name__=='send': self._owner_send=method; break self._owner.lastErrNode=None self._owner.lastErr=None self._owner.lastErrCode=None self.StreamInit() def plugout(self): """ Prepares instance to be destructed. """ self.Stream.dispatch=None self.Stream.DEBUG=None self.Stream.features=None self.Stream.destroy() def StreamInit(self): """ Send an initial stream header. """ self.Stream=simplexml.NodeBuilder() self.Stream._dispatch_depth=2 self.Stream.dispatch=self.dispatch self.Stream.stream_header_received=self._check_stream_start self._owner.debug_flags.append(simplexml.DBG_NODEBUILDER) self.Stream.DEBUG=self._owner.DEBUG self.Stream.features=None self._metastream=Node('stream:stream') self._metastream.setNamespace(self._owner.Namespace) self._metastream.setAttr('version','1.0') self._metastream.setAttr('xmlns:stream',NS_STREAMS) self._metastream.setAttr('to',self._owner.Server) self._owner.send("%s>"%str(self._metastream)[:-2]) def _check_stream_start(self,ns,tag,attrs): if ns<>NS_STREAMS or tag<>'stream': raise ValueError('Incorrect stream start: (%s,%s). Terminating.'%(tag,ns)) def Process(self, timeout=0): """ Check incoming stream for data waiting. If "timeout" is positive - block for as max. this time. Returns: 1) length of processed data if some data were processed; 2) '0' string if no data were processed but link is alive; 3) 0 (zero) if underlying connection is closed. Take note that in case of disconnection detect during Process() call disconnect handlers are called automatically. """ for handler in self._cycleHandlers: handler(self) if len(self._pendingExceptions) > 0: _pendingException = self._pendingExceptions.pop() raise _pendingException[0], _pendingException[1], _pendingException[2] if self._owner.Connection.pending_data(timeout): try: data=self._owner.Connection.receive() except IOError: return self.Stream.Parse(data) if len(self._pendingExceptions) > 0: _pendingException = self._pendingExceptions.pop() raise _pendingException[0], _pendingException[1], _pendingException[2] if data: return len(data) return '0' # It means that nothing is received but link is alive. def RegisterNamespace(self,xmlns,order='info'): """ Creates internal structures for newly registered namespace. You can register handlers for this namespace afterwards. By default one namespace already registered (jabber:client or jabber:component:accept depending on context. """ self.DEBUG('Registering namespace "%s"'%xmlns,order) self.handlers[xmlns]={} self.RegisterProtocol('unknown',Protocol,xmlns=xmlns) self.RegisterProtocol('default',Protocol,xmlns=xmlns) def RegisterProtocol(self,tag_name,Proto,xmlns=None,order='info'): """ Used to declare some top-level stanza name to dispatcher. Needed to start registering handlers for such stanzas. Iq, message and presence protocols are registered by default. """ if not xmlns: xmlns=self._owner.defaultNamespace self.DEBUG('Registering protocol "%s" as %s(%s)'%(tag_name,Proto,xmlns), order) self.handlers[xmlns][tag_name]={type:Proto, 'default':[]} def RegisterNamespaceHandler(self,xmlns,handler,typ='',ns='', makefirst=0, system=0): """ Register handler for processing all stanzas for specified namespace. """ self.RegisterHandler('default', handler, typ, ns, xmlns, makefirst, system) def RegisterHandler(self,name,handler,typ='',ns='',xmlns=None, makefirst=0, system=0): """Register user callback as stanzas handler of declared type. Callback must take (if chained, see later) arguments: dispatcher instance (for replying), incomed return of previous handlers. The callback must raise xmpp.NodeProcessed just before return if it want preven callbacks to be called with the same stanza as argument _and_, more importantly library from returning stanza to sender with error set (to be enabled in 0.2 ve Arguments: "name" - name of stanza. F.e. "iq". "handler" - user callback. "typ" - value of stanza's "type" attribute. If not specified any value match "ns" - namespace of child that stanza must contain. "chained" - chain together output of several handlers. "makefirst" - insert handler in the beginning of handlers list instead of adding it to the end. Note that more common handlers (i.e. w/o "typ" and " will be called first nevertheless. "system" - call handler even if NodeProcessed Exception were raised already. """ if not xmlns: xmlns=self._owner.defaultNamespace self.DEBUG('Registering handler %s for "%s" type->%s ns->%s(%s)'%(handler,name,typ,ns,xmlns), 'info') if not typ and not ns: typ='default' if not self.handlers.has_key(xmlns): self.RegisterNamespace(xmlns,'warn') if not self.handlers[xmlns].has_key(name): self.RegisterProtocol(name,Protocol,xmlns,'warn') if not self.handlers[xmlns][name].has_key(typ+ns): self.handlers[xmlns][name][typ+ns]=[] if makefirst: self.handlers[xmlns][name][typ+ns].insert(0,{'func':handler,'system':system}) else: self.handlers[xmlns][name][typ+ns].append({'func':handler,'system':system}) def RegisterHandlerOnce(self,name,handler,typ='',ns='',xmlns=None,makefirst=0, system=0): """ Unregister handler after first call (not implemented yet). """ if not xmlns: xmlns=self._owner.defaultNamespace self.RegisterHandler(name, handler, typ, ns, xmlns, makefirst, system) def UnregisterHandler(self,name,handler,typ='',ns='',xmlns=None): """ Unregister handler. "typ" and "ns" must be specified exactly the same as with registering.""" if not xmlns: xmlns=self._owner.defaultNamespace if not self.handlers.has_key(xmlns): return if not typ and not ns: typ='default' for pack in self.handlers[xmlns][name][typ+ns]: if handler==pack['func']: break else: pack=None try: self.handlers[xmlns][name][typ+ns].remove(pack) except ValueError: pass def RegisterDefaultHandler(self,handler): """ Specify the handler that will be used if no NodeProcessed exception were raised. This is returnStanzaHandler by default. """ self._defaultHandler=handler def RegisterEventHandler(self,handler): """ Register handler that will process events. F.e. "FILERECEIVED" event. """ self._eventHandler=handler def returnStanzaHandler(self,conn,stanza): """ Return stanza back to the sender with error set. """ if stanza.getType() in ['get','set']: conn.send(Error(stanza,ERR_FEATURE_NOT_IMPLEMENTED)) def streamErrorHandler(self,conn,error): name,text='error',error.getData() for tag in error.getChildren(): if tag.getNamespace()==NS_XMPP_STREAMS: if tag.getName()=='text': text=tag.getData() else: name=tag.getName() if name in stream_exceptions.keys(): exc=stream_exceptions[name] else: exc=StreamError raise exc((name,text)) def RegisterCycleHandler(self,handler): """ Register handler that will be called on every Dispatcher.Process() call. """ if handler not in self._cycleHandlers: self._cycleHandlers.append(handler) def UnregisterCycleHandler(self,handler): """ Unregister handler that will is called on every Dispatcher.Process() call.""" if handler in self._cycleHandlers: self._cycleHandlers.remove(handler) def Event(self,realm,event,data): """ Raise some event. Takes three arguments: 1) "realm" - scope of event. Usually a namespace. 2) "event" - the event itself. F.e. "SUCESSFULL SEND". 3) data that comes along with event. Depends on event.""" if self._eventHandler: self._eventHandler(realm,event,data) def dispatch(self,stanza,session=None,direct=0): """ Main procedure that performs XMPP stanza recognition and calling apppropriate handlers for it. Called internally. """ if not session: session=self session.Stream._mini_dom=None name=stanza.getName() if not direct and self._owner._route: if name == 'route': if stanza.getAttr('error') == None: if len(stanza.getChildren()) == 1: stanza = stanza.getChildren()[0] name=stanza.getName() else: for each in stanza.getChildren(): self.dispatch(each,session,direct=1) return elif name == 'presence': return elif name in ('features','bind'): pass else: raise UnsupportedStanzaType(name) if name=='features': session.Stream.features=stanza xmlns=stanza.getNamespace() if not self.handlers.has_key(xmlns): self.DEBUG("Unknown namespace: " + xmlns,'warn') xmlns='unknown' if not self.handlers[xmlns].has_key(name): self.DEBUG("Unknown stanza: " + name,'warn') name='unknown' else: self.DEBUG("Got %s/%s stanza"%(xmlns,name), 'ok') if stanza.__class__.__name__=='Node': stanza=self.handlers[xmlns][name][type](node=stanza) typ=stanza.getType() if not typ: typ='' stanza.props=stanza.getProperties() ID=stanza.getID() session.DEBUG("Dispatching %s stanza with type->%s props->%s id->%s"%(name,typ,stanza.props,ID),'ok') list=['default'] # we will use all handlers: if self.handlers[xmlns][name].has_key(typ): list.append(typ) # from very common... for prop in stanza.props: if self.handlers[xmlns][name].has_key(prop): list.append(prop) if typ and self.handlers[xmlns][name].has_key(typ+prop): list.append(typ+prop) # ...to very particular chain=self.handlers[xmlns]['default']['default'] for key in list: if key: chain = chain + self.handlers[xmlns][name][key] output='' if session._expected.has_key(ID): user=0 if type(session._expected[ID])==type(()): cb,args=session._expected[ID] session.DEBUG("Expected stanza arrived. Callback %s(%s) found!"%(cb,args),'ok') try: cb(session,stanza,**args) except Exception, typ: if typ.__class__.__name__<>'NodeProcessed': raise else: session.DEBUG("Expected stanza arrived!",'ok') session._expected[ID]=stanza else: user=1 for handler in chain: if user or handler['system']: try: handler['func'](session,stanza) except Exception, typ: if typ.__class__.__name__<>'NodeProcessed': self._pendingExceptions.insert(0, sys.exc_info()) return user=0 if user and self._defaultHandler: self._defaultHandler(session,stanza) def WaitForResponse(self, ID, timeout=DefaultTimeout): """ Block and wait until stanza with specific "id" attribute will come. If no such stanza is arrived within timeout, return None. If operation failed for some reason then owner's attributes lastErrNode, lastErr and lastErrCode are set accordingly. """ self._expected[ID]=None has_timed_out=0 abort_time=time.time() + timeout self.DEBUG("Waiting for ID:%s with timeout %s..." % (ID,timeout),'wait') while not self._expected[ID]: if not self.Process(0.04): self._owner.lastErr="Disconnect" return None if time.time() > abort_time: self._owner.lastErr="Timeout" return None response=self._expected[ID] del self._expected[ID] if response.getErrorCode(): self._owner.lastErrNode=response self._owner.lastErr=response.getError() self._owner.lastErrCode=response.getErrorCode() return response def SendAndWaitForResponse(self, stanza, timeout=DefaultTimeout): """ Put stanza on the wire and wait for recipient's response to it. """ return self.WaitForResponse(self.send(stanza),timeout) def SendAndCallForResponse(self, stanza, func, args={}): """ Put stanza on the wire and call back when recipient replies. Additional callback arguments can be specified in args. """ self._expected[self.send(stanza)]=(func,args) def send(self,stanza): """ Serialise stanza and put it on the wire. Assign an unique ID to it before send. Returns assigned ID.""" if type(stanza) in [type(''), type(u'')]: return self._owner_send(stanza) if not isinstance(stanza,Protocol): _ID=None elif not stanza.getID(): global ID ID+=1 _ID=`ID` stanza.setID(_ID) else: _ID=stanza.getID() if self._owner._registered_name and not stanza.getAttr('from'): stanza.setAttr('from',self._owner._registered_name) if self._owner._route and stanza.getName()!='bind': to=self._owner.Server if stanza.getTo() and stanza.getTo().getDomain(): to=stanza.getTo().getDomain() frm=stanza.getFrom() if frm.getDomain(): frm=frm.getDomain() route=Protocol('route',to=to,frm=frm,payload=[stanza]) stanza=route stanza.setNamespace(self._owner.Namespace) stanza.setParent(self._metastream) self._owner_send(stanza) return _ID def disconnect(self): """ Send a stream terminator and and handle all incoming stanzas before stream closure. """ self._owner_send('') while self.Process(1): pass xmpppy-0.4.1/xmpp/features.py0000644000175000000500000002053610411154552015064 0ustar normansrc## features.py ## ## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: features.py,v 1.24 2006/03/25 05:47:22 snakeru Exp $ """ This module contains variable stuff that is not worth splitting into separate modules. Here is: DISCO client and agents-to-DISCO and browse-to-DISCO emulators. IBR and password manager. jabber:iq:privacy methods All these methods takes 'disp' first argument that should be already connected (and in most cases already authorised) dispatcher instance. """ from protocol import * REGISTER_DATA_RECEIVED='REGISTER DATA RECEIVED' ### DISCO ### http://jabber.org/protocol/disco ### JEP-0030 #################### ### Browse ### jabber:iq:browse ### JEP-0030 ################################### ### Agents ### jabber:iq:agents ### JEP-0030 ################################### def _discover(disp,ns,jid,node=None,fb2b=0,fb2a=1): """ Try to obtain info from the remote object. If remote object doesn't support disco fall back to browse (if fb2b is true) and if it doesnt support browse (or fb2b is not true) fall back to agents protocol (if gb2a is true). Returns obtained info. Used internally. """ iq=Iq(to=jid,typ='get',queryNS=ns) if node: iq.setQuerynode(node) rep=disp.SendAndWaitForResponse(iq) if fb2b and not isResultNode(rep): rep=disp.SendAndWaitForResponse(Iq(to=jid,typ='get',queryNS=NS_BROWSE)) # Fallback to browse if fb2a and not isResultNode(rep): rep=disp.SendAndWaitForResponse(Iq(to=jid,typ='get',queryNS=NS_AGENTS)) # Fallback to agents if isResultNode(rep): return rep.getQueryPayload() return [] def discoverItems(disp,jid,node=None): """ Query remote object about any items that it contains. Return items list. """ """ According to JEP-0030: query MAY have node attribute item: MUST HAVE jid attribute and MAY HAVE name, node, action attributes. action attribute of item can be either of remove or update value.""" ret=[] for i in _discover(disp,NS_DISCO_ITEMS,jid,node): if i.getName()=='agent' and i.getTag('name'): i.setAttr('name',i.getTagData('name')) ret.append(i.attrs) return ret def discoverInfo(disp,jid,node=None): """ Query remote object about info that it publishes. Returns identities and features lists.""" """ According to JEP-0030: query MAY have node attribute identity: MUST HAVE category and name attributes and MAY HAVE type attribute. feature: MUST HAVE var attribute""" identities , features = [] , [] for i in _discover(disp,NS_DISCO_INFO,jid,node): if i.getName()=='identity': identities.append(i.attrs) elif i.getName()=='feature': features.append(i.getAttr('var')) elif i.getName()=='agent': if i.getTag('name'): i.setAttr('name',i.getTagData('name')) if i.getTag('description'): i.setAttr('name',i.getTagData('description')) identities.append(i.attrs) if i.getTag('groupchat'): features.append(NS_GROUPCHAT) if i.getTag('register'): features.append(NS_REGISTER) if i.getTag('search'): features.append(NS_SEARCH) return identities , features ### Registration ### jabber:iq:register ### JEP-0077 ########################### def getRegInfo(disp,host,info={},sync=True): """ Gets registration form from remote host. You can pre-fill the info dictionary. F.e. if you are requesting info on registering user joey than specify info as {'username':'joey'}. See JEP-0077 for details. 'disp' must be connected dispatcher instance.""" iq=Iq('get',NS_REGISTER,to=host) for i in info.keys(): iq.setTagData(i,info[i]) if sync: resp=disp.SendAndWaitForResponse(iq) _ReceivedRegInfo(disp.Dispatcher,resp, host) return resp else: disp.SendAndCallForResponse(iq,_ReceivedRegInfo, {'agent': host}) def _ReceivedRegInfo(con, resp, agent): iq=Iq('get',NS_REGISTER,to=agent) if not isResultNode(resp): return df=resp.getTag('query',namespace=NS_REGISTER).getTag('x',namespace=NS_DATA) if df: con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent, DataForm(node=df))) return df=DataForm(typ='form') for i in resp.getQueryPayload(): if type(i)<>type(iq): pass elif i.getName()=='instructions': df.addInstructions(i.getData()) else: df.setField(i.getName()).setValue(i.getData()) con.Event(NS_REGISTER,REGISTER_DATA_RECEIVED,(agent, df)) def register(disp,host,info): """ Perform registration on remote server with provided info. disp must be connected dispatcher instance. Returns true or false depending on registration result. If registration fails you can get additional info from the dispatcher's owner attributes lastErrNode, lastErr and lastErrCode. """ iq=Iq('set',NS_REGISTER,to=host) if type(info)<>type({}): info=info.asDict() for i in info.keys(): iq.setTag('query').setTagData(i,info[i]) resp=disp.SendAndWaitForResponse(iq) if isResultNode(resp): return 1 def unregister(disp,host): """ Unregisters with host (permanently removes account). disp must be connected and authorized dispatcher instance. Returns true on success.""" resp=disp.SendAndWaitForResponse(Iq('set',NS_REGISTER,to=host,payload=[Node('remove')])) if isResultNode(resp): return 1 def changePasswordTo(disp,newpassword,host=None): """ Changes password on specified or current (if not specified) server. disp must be connected and authorized dispatcher instance. Returns true on success.""" if not host: host=disp._owner.Server resp=disp.SendAndWaitForResponse(Iq('set',NS_REGISTER,to=host,payload=[Node('username',payload=[disp._owner.Server]),Node('password',payload=[newpassword])])) if isResultNode(resp): return 1 ### Privacy ### jabber:iq:privacy ### draft-ietf-xmpp-im-19 #################### #type=[jid|group|subscription] #action=[allow|deny] def getPrivacyLists(disp): """ Requests privacy lists from connected server. Returns dictionary of existing lists on success.""" try: dict={'lists':[]} resp=disp.SendAndWaitForResponse(Iq('get',NS_PRIVACY)) if not isResultNode(resp): return for list in resp.getQueryPayload(): if list.getName()=='list': dict['lists'].append(list.getAttr('name')) else: dict[list.getName()]=list.getAttr('name') return dict except: pass def getPrivacyList(disp,listname): """ Requests specific privacy list listname. Returns list of XML nodes (rules) taken from the server responce.""" try: resp=disp.SendAndWaitForResponse(Iq('get',NS_PRIVACY,payload=[Node('list',{'name':listname})])) if isResultNode(resp): return resp.getQueryPayload()[0] except: pass def setActivePrivacyList(disp,listname=None,typ='active'): """ Switches privacy list 'listname' to specified type. By default the type is 'active'. Returns true on success.""" if listname: attrs={'name':listname} else: attrs={} resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[Node(typ,attrs)])) if isResultNode(resp): return 1 def setDefaultPrivacyList(disp,listname=None): """ Sets the default privacy list as 'listname'. Returns true on success.""" return setActivePrivacyList(disp,listname,'default') def setPrivacyList(disp,list): """ Set the ruleset. 'list' should be the simpleXML node formatted according to RFC 3921 (XMPP-IM) (I.e. Node('list',{'name':listname},payload=[...]) ) Returns true on success.""" resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[list])) if isResultNode(resp): return 1 def delPrivacyList(disp,listname): """ Deletes privacy list 'listname'. Returns true on success.""" resp=disp.SendAndWaitForResponse(Iq('set',NS_PRIVACY,payload=[Node('list',{'name':listname})])) if isResultNode(resp): return 1 xmpppy-0.4.1/xmpp/filetransfer.py0000644000175000000500000002365510163344143015740 0ustar normansrc## filetransfer.py ## ## Copyright (C) 2004 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: filetransfer.py,v 1.6 2004/12/25 20:06:59 snakeru Exp $ """ This module contains IBB class that is the simple implementation of JEP-0047. Note that this is just a transport for data. You have to negotiate data transfer before (via StreamInitiation most probably). Unfortunately SI is not implemented yet. """ from protocol import * from dispatcher import PlugIn import base64 class IBB(PlugIn): """ IBB used to transfer small-sized data chunk over estabilished xmpp connection. Data is split into small blocks (by default 3000 bytes each), encoded as base 64 and sent to another entity that compiles these blocks back into the data chunk. This is very inefficiend but should work under any circumstances. Note that using IBB normally should be the last resort. """ def __init__(self): """ Initialise internal variables. """ PlugIn.__init__(self) self.DBG_LINE='ibb' self._exported_methods=[self.OpenStream] self._streams={} self._ampnode=Node(NS_AMP+' amp',payload=[Node('rule',{'condition':'deliver-at','value':'stored','action':'error'}),Node('rule',{'condition':'match-resource','value':'exact','action':'error'})]) def plugin(self,owner): """ Register handlers for receiving incoming datastreams. Used internally. """ self._owner.RegisterHandlerOnce('iq',self.StreamOpenReplyHandler) # Move to StreamOpen and specify stanza id self._owner.RegisterHandler('iq',self.IqHandler,ns=NS_IBB) self._owner.RegisterHandler('message',self.ReceiveHandler,ns=NS_IBB) def IqHandler(self,conn,stanza): """ Handles streams state change. Used internally. """ typ=stanza.getType() self.DEBUG('IqHandler called typ->%s'%typ,'info') if typ=='set' and stanza.getTag('open',namespace=NS_IBB): self.StreamOpenHandler(conn,stanza) elif typ=='set' and stanza.getTag('close',namespace=NS_IBB): self.StreamCloseHandler(conn,stanza) elif typ=='result': self.StreamCommitHandler(conn,stanza) elif typ=='error': self.StreamOpenReplyHandler(conn,stanza) else: conn.send(Error(stanza,ERR_BAD_REQUEST)) raise NodeProcessed def StreamOpenHandler(self,conn,stanza): """ Handles opening of new incoming stream. Used internally. """ """ """ err=None sid,blocksize=stanza.getTagAttr('open','sid'),stanza.getTagAttr('open','block-size') self.DEBUG('StreamOpenHandler called sid->%s blocksize->%s'%(sid,blocksize),'info') try: blocksize=int(blocksize) except: err=ERR_BAD_REQUEST if not sid or not blocksize: err=ERR_BAD_REQUEST elif sid in self._streams.keys(): err=ERR_UNEXPECTED_REQUEST if err: rep=Error(stanza,err) else: self.DEBUG("Opening stream: id %s, block-size %s"%(sid,blocksize),'info') rep=Protocol('iq',stanza.getFrom(),'result',stanza.getTo(),{'id':stanza.getID()}) self._streams[sid]={'direction':'<'+str(stanza.getFrom()),'block-size':blocksize,'fp':open('/tmp/xmpp_file_'+sid,'w'),'seq':0,'syn_id':stanza.getID()} conn.send(rep) def OpenStream(self,sid,to,fp,blocksize=3000): """ Start new stream. You should provide stream id 'sid', the endpoind jid 'to', the file object containing info for send 'fp'. Also the desired blocksize can be specified. Take into account that recommended stanza size is 4k and IBB uses base64 encoding that increases size of data by 1/3.""" if sid in self._streams.keys(): return if not JID(to).getResource(): return self._streams[sid]={'direction':'|>'+to,'block-size':blocksize,'fp':fp,'seq':0} self._owner.RegisterCycleHandler(self.SendHandler) syn=Protocol('iq',to,'set',payload=[Node(NS_IBB+' open',{'sid':sid,'block-size':blocksize})]) self._owner.send(syn) self._streams[sid]['syn_id']=syn.getID() return self._streams[sid] def SendHandler(self,conn): """ Send next portion of data if it is time to do it. Used internally. """ self.DEBUG('SendHandler called','info') for sid in self._streams.keys(): stream=self._streams[sid] if stream['direction'][:2]=='|>': cont=1 elif stream['direction'][0]=='>': chunk=stream['fp'].read(stream['block-size']) if chunk: datanode=Node(NS_IBB+' data',{'sid':sid,'seq':stream['seq']},base64.encodestring(chunk)) stream['seq']+=1 if stream['seq']==65536: stream['seq']=0 conn.send(Protocol('message',stream['direction'][1:],payload=[datanode,self._ampnode])) else: """ notify the other side about stream closing notify the local user about sucessfull send delete the local stream""" conn.send(Protocol('iq',stream['direction'][1:],'set',payload=[Node(NS_IBB+' close',{'sid':sid})])) conn.Event(self.DBG_LINE,'SUCCESSFULL SEND',stream) del self._streams[sid] self._owner.UnregisterCycleHandler(self.SendHandler) """ qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA """ def ReceiveHandler(self,conn,stanza): """ Receive next portion of incoming datastream and store it write it to temporary file. Used internally. """ sid,seq,data=stanza.getTagAttr('data','sid'),stanza.getTagAttr('data','seq'),stanza.getTagData('data') self.DEBUG('ReceiveHandler called sid->%s seq->%s'%(sid,seq),'info') try: seq=int(seq); data=base64.decodestring(data) except: seq=''; data='' err=None if not sid in self._streams.keys(): err=ERR_ITEM_NOT_FOUND else: stream=self._streams[sid] if not data: err=ERR_BAD_REQUEST elif seq<>stream['seq']: err=ERR_UNEXPECTED_REQUEST else: self.DEBUG('Successfull receive sid->%s %s+%s bytes'%(sid,stream['fp'].tell(),len(data)),'ok') stream['seq']+=1 stream['fp'].write(data) if err: self.DEBUG('Error on receive: %s'%err,'error') conn.send(Error(Iq(to=stanza.getFrom(),frm=stanza.getTo(),payload=[Node(NS_IBB+' close')]),err,reply=0)) def StreamCloseHandler(self,conn,stanza): """ Handle stream closure due to all data transmitted. Raise xmpppy event specifying successfull data receive. """ sid=stanza.getTagAttr('close','sid') self.DEBUG('StreamCloseHandler called sid->%s'%sid,'info') if sid in self._streams.keys(): conn.send(stanza.buildReply('result')) conn.Event(self.DBG_LINE,'SUCCESSFULL RECEIVE',self._streams[sid]) del self._streams[sid] else: conn.send(Error(stanza,ERR_ITEM_NOT_FOUND)) def StreamBrokenHandler(self,conn,stanza): """ Handle stream closure due to all some error while receiving data. Raise xmpppy event specifying unsuccessfull data receive. """ syn_id=stanza.getID() self.DEBUG('StreamBrokenHandler called syn_id->%s'%syn_id,'info') for sid in self._streams.keys(): stream=self._streams[sid] if stream['syn_id']==syn_id: if stream['direction'][0]=='<': conn.Event(self.DBG_LINE,'ERROR ON RECEIVE',stream) else: conn.Event(self.DBG_LINE,'ERROR ON SEND',stream) del self._streams[sid] def StreamOpenReplyHandler(self,conn,stanza): """ Handle remote side reply about is it agree or not to receive our datastream. Used internally. Raises xmpppy event specfiying if the data transfer is agreed upon.""" syn_id=stanza.getID() self.DEBUG('StreamOpenReplyHandler called syn_id->%s'%syn_id,'info') for sid in self._streams.keys(): stream=self._streams[sid] if stream['syn_id']==syn_id: if stanza.getType()=='error': if stream['direction'][0]=='<': conn.Event(self.DBG_LINE,'ERROR ON RECEIVE',stream) else: conn.Event(self.DBG_LINE,'ERROR ON SEND',stream) del self._streams[sid] elif stanza.getType()=='result': if stream['direction'][0]=='|': stream['direction']=stream['direction'][1:] conn.Event(self.DBG_LINE,'STREAM COMMITTED',stream) else: conn.send(Error(stanza,ERR_UNEXPECTED_REQUEST)) xmpppy-0.4.1/xmpp/__init__.py0000644000175000000500000000340310213020073014765 0ustar normansrc# $Id: __init__.py,v 1.9 2005/03/07 09:34:51 snakeru Exp $ """ All features of xmpppy library contained within separate modules. At present there are modules: simplexml - XML handling routines protocol - jabber-objects (I.e. JID and different stanzas and sub-stanzas) handling routines. debug - Jacob Lundquist's debugging module. Very handy if you like colored debug. auth - Non-SASL and SASL stuff. You will need it to auth as a client or transport. transports - low level connection handling. TCP and TLS currently. HTTP support planned. roster - simple roster for use in clients. dispatcher - decision-making logic. Handles all hooks. The first who takes control over fresh stanzas. features - different stuff that didn't worths separating into modules browser - DISCO server framework. Allows to build dynamic disco tree. filetransfer - Currently contains only IBB stuff. Can be used for bot-to-bot transfers. Most of the classes that is defined in all these modules is an ancestors of class PlugIn so they share a single set of methods allowing you to compile a featured XMPP client. For every instance of PlugIn class the 'owner' is the class in what the plug was plugged. While plugging in such instance usually sets some methods of owner to it's own ones for easy access. All session specific info stored either in instance of PlugIn or in owner's instance. This is considered unhandy and there are plans to port 'Session' class from xmppd.py project for storing all session-related info. Though if you are not accessing instances variables directly and use only methods for access all values you should not have any problems. """ import simplexml,protocol,debug,auth,transports,roster,dispatcher,features,browser,filetransfer,commands from client import * from protocol import * xmpppy-0.4.1/xmpp/jep0106.py0000644000175000000500000000135210622057064014332 0ustar normansrc # JID Escaping XEP-0106 for the xmpppy based transports written by Norman Rasmussen """This file is the XEP-0106 commands. Implemented commands as follows: 4.2 Encode : Encoding Transformation 4.3 Decode : Decoding Transformation """ xep0106mapping = [ [' ' ,'20'], ['"' ,'22'], ['&' ,'26'], ['\'','27'], ['/' ,'2f'], [':' ,'3a'], ['<' ,'3c'], ['>' ,'3e'], ['@' ,'40']] def JIDEncode(str): str = str.replace('\\5c', '\\5c5c') for each in xep0106mapping: str = str.replace('\\' + each[1], '\\5c' + each[1]) for each in xep0106mapping: str = str.replace(each[0], '\\' + each[1]) return str def JIDDecode(str): for each in xep0106mapping: str = str.replace('\\' + each[1], each[0]) return str.replace('\\5c', '\\') xmpppy-0.4.1/xmpp/protocol.py0000644000175000000500000012714110622057064015113 0ustar normansrc## protocol.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: protocol.py,v 1.58 2007/05/13 17:55:46 normanr Exp $ """ Protocol module contains tools that is needed for processing of xmpp-related data structures. """ from simplexml import Node,ustr import time NS_ACTIVITY ='http://jabber.org/protocol/activity' # XEP-0108 NS_ADDRESS ='http://jabber.org/protocol/address' # XEP-0033 NS_ADMIN ='http://jabber.org/protocol/admin' # XEP-0133 NS_ADMIN_ADD_USER =NS_ADMIN+'#add-user' # XEP-0133 NS_ADMIN_DELETE_USER =NS_ADMIN+'#delete-user' # XEP-0133 NS_ADMIN_DISABLE_USER =NS_ADMIN+'#disable-user' # XEP-0133 NS_ADMIN_REENABLE_USER =NS_ADMIN+'#reenable-user' # XEP-0133 NS_ADMIN_END_USER_SESSION =NS_ADMIN+'#end-user-session' # XEP-0133 NS_ADMIN_GET_USER_PASSWORD =NS_ADMIN+'#get-user-password' # XEP-0133 NS_ADMIN_CHANGE_USER_PASSWORD =NS_ADMIN+'#change-user-password' # XEP-0133 NS_ADMIN_GET_USER_ROSTER =NS_ADMIN+'#get-user-roster' # XEP-0133 NS_ADMIN_GET_USER_LASTLOGIN =NS_ADMIN+'#get-user-lastlogin' # XEP-0133 NS_ADMIN_USER_STATS =NS_ADMIN+'#user-stats' # XEP-0133 NS_ADMIN_EDIT_BLACKLIST =NS_ADMIN+'#edit-blacklist' # XEP-0133 NS_ADMIN_EDIT_WHITELIST =NS_ADMIN+'#edit-whitelist' # XEP-0133 NS_ADMIN_REGISTERED_USERS_NUM =NS_ADMIN+'#get-registered-users-num' # XEP-0133 NS_ADMIN_DISABLED_USERS_NUM =NS_ADMIN+'#get-disabled-users-num' # XEP-0133 NS_ADMIN_ONLINE_USERS_NUM =NS_ADMIN+'#get-online-users-num' # XEP-0133 NS_ADMIN_ACTIVE_USERS_NUM =NS_ADMIN+'#get-active-users-num' # XEP-0133 NS_ADMIN_IDLE_USERS_NUM =NS_ADMIN+'#get-idle-users-num' # XEP-0133 NS_ADMIN_REGISTERED_USERS_LIST =NS_ADMIN+'#get-registered-users-list' # XEP-0133 NS_ADMIN_DISABLED_USERS_LIST =NS_ADMIN+'#get-disabled-users-list' # XEP-0133 NS_ADMIN_ONLINE_USERS_LIST =NS_ADMIN+'#get-online-users-list' # XEP-0133 NS_ADMIN_ACTIVE_USERS_LIST =NS_ADMIN+'#get-active-users-list' # XEP-0133 NS_ADMIN_IDLE_USERS_LIST =NS_ADMIN+'#get-idle-users-list' # XEP-0133 NS_ADMIN_ANNOUNCE =NS_ADMIN+'#announce' # XEP-0133 NS_ADMIN_SET_MOTD =NS_ADMIN+'#set-motd' # XEP-0133 NS_ADMIN_EDIT_MOTD =NS_ADMIN+'#edit-motd' # XEP-0133 NS_ADMIN_DELETE_MOTD =NS_ADMIN+'#delete-motd' # XEP-0133 NS_ADMIN_SET_WELCOME =NS_ADMIN+'#set-welcome' # XEP-0133 NS_ADMIN_DELETE_WELCOME =NS_ADMIN+'#delete-welcome' # XEP-0133 NS_ADMIN_EDIT_ADMIN =NS_ADMIN+'#edit-admin' # XEP-0133 NS_ADMIN_RESTART =NS_ADMIN+'#restart' # XEP-0133 NS_ADMIN_SHUTDOWN =NS_ADMIN+'#shutdown' # XEP-0133 NS_AGENTS ='jabber:iq:agents' # XEP-0094 (historical) NS_AMP ='http://jabber.org/protocol/amp' # XEP-0079 NS_AMP_ERRORS =NS_AMP+'#errors' # XEP-0079 NS_AUTH ='jabber:iq:auth' NS_AVATAR ='jabber:iq:avatar' # XEP-0008 (historical) NS_BIND ='urn:ietf:params:xml:ns:xmpp-bind' NS_BROWSE ='jabber:iq:browse' # XEP-0011 (historical) NS_BYTESTREAM ='http://jabber.org/protocol/bytestreams' # XEP-0065 NS_CAPS ='http://jabber.org/protocol/caps' # XEP-0115 NS_CHATSTATES ='http://jabber.org/protocol/chatstates' # XEP-0085 NS_CLIENT ='jabber:client' NS_COMMANDS ='http://jabber.org/protocol/commands' NS_COMPONENT_ACCEPT ='jabber:component:accept' NS_COMPONENT_1 ='http://jabberd.jabberstudio.org/ns/component/1.0' NS_COMPRESS ='http://jabber.org/protocol/compress' # XEP-0138 NS_DATA ='jabber:x:data' # XEP-0004 NS_DELAY ='jabber:x:delay' NS_DIALBACK ='jabber:server:dialback' NS_DISCO ='http://jabber.org/protocol/disco' # XEP-0030 NS_DISCO_INFO =NS_DISCO+'#info' # XEP-0030 NS_DISCO_ITEMS =NS_DISCO+'#items' # XEP-0030 NS_ENCRYPTED ='jabber:x:encrypted' # XEP-0027 NS_EVENT ='jabber:x:event' # XEP-0022 NS_FEATURE ='http://jabber.org/protocol/feature-neg' NS_FILE ='http://jabber.org/protocol/si/profile/file-transfer' # XEP-0096 NS_GATEWAY ='jabber:iq:gateway' NS_GEOLOC ='http://jabber.org/protocol/geoloc' # XEP-0080 NS_GROUPCHAT ='gc-1.0' NS_HTTP_BIND ='http://jabber.org/protocol/httpbind' # XEP-0124 NS_IBB ='http://jabber.org/protocol/ibb' NS_INVISIBLE ='presence-invisible' # Jabberd2 NS_IQ ='iq' # Jabberd2 NS_LAST ='jabber:iq:last' NS_MESSAGE ='message' # Jabberd2 NS_MOOD ='http://jabber.org/protocol/mood' # XEP-0107 NS_MUC ='http://jabber.org/protocol/muc' # XEP-0045 NS_MUC_ADMIN =NS_MUC+'#admin' # XEP-0045 NS_MUC_OWNER =NS_MUC+'#owner' # XEP-0045 NS_MUC_UNIQUE =NS_MUC+'#unique' # XEP-0045 NS_MUC_USER =NS_MUC+'#user' # XEP-0045 NS_MUC_REGISTER =NS_MUC+'#register' # XEP-0045 NS_MUC_REQUEST =NS_MUC+'#request' # XEP-0045 NS_MUC_ROOMCONFIG =NS_MUC+'#roomconfig' # XEP-0045 NS_MUC_ROOMINFO =NS_MUC+'#roominfo' # XEP-0045 NS_MUC_ROOMS =NS_MUC+'#rooms' # XEP-0045 NS_MUC_TRAFIC =NS_MUC+'#traffic' # XEP-0045 NS_OFFLINE ='http://jabber.org/protocol/offline' # XEP-0013 NS_PHYSLOC ='http://jabber.org/protocol/physloc' # XEP-0112 NS_PRESENCE ='presence' # Jabberd2 NS_PRIVACY ='jabber:iq:privacy' NS_PRIVATE ='jabber:iq:private' NS_PUBSUB ='http://jabber.org/protocol/pubsub' # XEP-0060 NS_REGISTER ='jabber:iq:register' NS_ROSTER ='jabber:iq:roster' NS_ROSTERX ='http://jabber.org/protocol/rosterx' # XEP-0144 NS_RPC ='jabber:iq:rpc' # XEP-0009 NS_SASL ='urn:ietf:params:xml:ns:xmpp-sasl' NS_SEARCH ='jabber:iq:search' NS_SERVER ='jabber:server' NS_SESSION ='urn:ietf:params:xml:ns:xmpp-session' NS_SI ='http://jabber.org/protocol/si' # XEP-0096 NS_SI_PUB ='http://jabber.org/protocol/sipub' # XEP-0137 NS_SIGNED ='jabber:x:signed' # XEP-0027 NS_STANZAS ='urn:ietf:params:xml:ns:xmpp-stanzas' NS_STREAMS ='http://etherx.jabber.org/streams' NS_TIME ='jabber:iq:time' NS_TLS ='urn:ietf:params:xml:ns:xmpp-tls' NS_VACATION ='http://jabber.org/protocol/vacation' NS_VCARD ='vcard-temp' NS_VERSION ='jabber:iq:version' NS_WAITINGLIST ='http://jabber.org/protocol/waitinglist' # XEP-0130 NS_XHTML_IM ='http://jabber.org/protocol/xhtml-im' # XEP-0071 NS_DATA_LAYOUT ='http://jabber.org/protocol/xdata-layout' # XEP-0141 NS_DATA_VALIDATE ='http://jabber.org/protocol/xdata-validate' # XEP-0122 NS_XMPP_STREAMS ='urn:ietf:params:xml:ns:xmpp-streams' xmpp_stream_error_conditions=""" bad-format -- -- -- The entity has sent XML that cannot be processed. bad-namespace-prefix -- -- -- The entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that requires such a prefix. conflict -- -- -- The server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream. connection-timeout -- -- -- The entity has not generated any traffic over the stream for some period of time. host-gone -- -- -- The value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server. host-unknown -- -- -- The value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server. improper-addressing -- -- -- A stanza sent between two servers lacks a 'to' or 'from' attribute (or the attribute has no value). internal-server-error -- -- -- The server has experienced a misconfiguration or an otherwise-undefined internal error that prevents it from servicing the stream. invalid-from -- cancel -- -- The JID or hostname provided in a 'from' address does not match an authorized JID or validated domain negotiated between servers via SASL or dialback, or between a client and a server via authentication and resource authorization. invalid-id -- -- -- The stream ID or dialback ID is invalid or does not match an ID previously provided. invalid-namespace -- -- -- The streams namespace name is something other than "http://etherx.jabber.org/streams" or the dialback namespace name is something other than "jabber:server:dialback". invalid-xml -- -- -- The entity has sent invalid XML over the stream to a server that performs validation. not-authorized -- -- -- The entity has attempted to send data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation. policy-violation -- -- -- The entity has violated some local service policy. remote-connection-failed -- -- -- The server is unable to properly connect to a remote resource that is required for authentication or authorization. resource-constraint -- -- -- The server lacks the system resources necessary to service the stream. restricted-xml -- -- -- The entity has attempted to send restricted XML features such as a comment, processing instruction, DTD, entity reference, or unescaped character. see-other-host -- -- -- The server will not provide service to the initiating entity but is redirecting traffic to another host. system-shutdown -- -- -- The server is being shut down and all active streams are being closed. undefined-condition -- -- -- The error condition is not one of those defined by the other conditions in this list. unsupported-encoding -- -- -- The initiating entity has encoded the stream in an encoding that is not supported by the server. unsupported-stanza-type -- -- -- The initiating entity has sent a first-level child of the stream that is not supported by the server. unsupported-version -- -- -- The value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server. xml-not-well-formed -- -- -- The initiating entity has sent XML that is not well-formed.""" xmpp_stanza_error_conditions=""" bad-request -- 400 -- modify -- The sender has sent XML that is malformed or that cannot be processed. conflict -- 409 -- cancel -- Access cannot be granted because an existing resource or session exists with the same name or address. feature-not-implemented -- 501 -- cancel -- The feature requested is not implemented by the recipient or server and therefore cannot be processed. forbidden -- 403 -- auth -- The requesting entity does not possess the required permissions to perform the action. gone -- 302 -- modify -- The recipient or server can no longer be contacted at this address. internal-server-error -- 500 -- wait -- The server could not process the stanza because of a misconfiguration or an otherwise-undefined internal server error. item-not-found -- 404 -- cancel -- The addressed JID or item requested cannot be found. jid-malformed -- 400 -- modify -- The value of the 'to' attribute in the sender's stanza does not adhere to the syntax defined in Addressing Scheme. not-acceptable -- 406 -- cancel -- The recipient or server understands the request but is refusing to process it because it does not meet criteria defined by the recipient or server. not-allowed -- 405 -- cancel -- The recipient or server does not allow any entity to perform the action. not-authorized -- 401 -- auth -- The sender must provide proper credentials before being allowed to perform the action, or has provided improper credentials. payment-required -- 402 -- auth -- The requesting entity is not authorized to access the requested service because payment is required. recipient-unavailable -- 404 -- wait -- The intended recipient is temporarily unavailable. redirect -- 302 -- modify -- The recipient or server is redirecting requests for this information to another entity. registration-required -- 407 -- auth -- The requesting entity is not authorized to access the requested service because registration is required. remote-server-not-found -- 404 -- cancel -- A remote server or service specified as part or all of the JID of the intended recipient does not exist. remote-server-timeout -- 504 -- wait -- A remote server or service specified as part or all of the JID of the intended recipient could not be contacted within a reasonable amount of time. resource-constraint -- 500 -- wait -- The server or recipient lacks the system resources necessary to service the request. service-unavailable -- 503 -- cancel -- The server or recipient does not currently provide the requested service. subscription-required -- 407 -- auth -- The requesting entity is not authorized to access the requested service because a subscription is required. undefined-condition -- 500 -- -- unexpected-request -- 400 -- wait -- The recipient or server understood the request but was not expecting it at this time (e.g., the request was out of order).""" sasl_error_conditions=""" aborted -- -- -- The receiving entity acknowledges an element sent by the initiating entity; sent in reply to the element. incorrect-encoding -- -- -- The data provided by the initiating entity could not be processed because the [BASE64]Josefsson, S., The Base16, Base32, and Base64 Data Encodings, July 2003. encoding is incorrect (e.g., because the encoding does not adhere to the definition in Section 3 of [BASE64]Josefsson, S., The Base16, Base32, and Base64 Data Encodings, July 2003.); sent in reply to a element or an element with initial response data. invalid-authzid -- -- -- The authzid provided by the initiating entity is invalid, either because it is incorrectly formatted or because the initiating entity does not have permissions to authorize that ID; sent in reply to a element or an element with initial response data. invalid-mechanism -- -- -- The initiating entity did not provide a mechanism or requested a mechanism that is not supported by the receiving entity; sent in reply to an element. mechanism-too-weak -- -- -- The mechanism requested by the initiating entity is weaker than server policy permits for that initiating entity; sent in reply to a element or an element with initial response data. not-authorized -- -- -- The authentication failed because the initiating entity did not provide valid credentials (this includes but is not limited to the case of an unknown username); sent in reply to a element or an element with initial response data. temporary-auth-failure -- -- -- The authentication failed because of a temporary error condition within the receiving entity; sent in reply to an element or element.""" ERRORS,_errorcodes={},{} for ns,errname,errpool in [(NS_XMPP_STREAMS,'STREAM',xmpp_stream_error_conditions), (NS_STANZAS ,'ERR' ,xmpp_stanza_error_conditions), (NS_SASL ,'SASL' ,sasl_error_conditions)]: for err in errpool.split('\n')[1:]: cond,code,typ,text=err.split(' -- ') name=errname+'_'+cond.upper().replace('-','_') locals()[name]=ns+' '+cond ERRORS[ns+' '+cond]=[code,typ,text] if code: _errorcodes[code]=cond del ns,errname,errpool,err,cond,code,typ,text def isResultNode(node): """ Returns true if the node is a positive reply. """ return node and node.getType()=='result' def isErrorNode(node): """ Returns true if the node is a negative reply. """ return node and node.getType()=='error' class NodeProcessed(Exception): """ Exception that should be raised by handler when the handling should be stopped. """ class StreamError(Exception): """ Base exception class for stream errors.""" class BadFormat(StreamError): pass class BadNamespacePrefix(StreamError): pass class Conflict(StreamError): pass class ConnectionTimeout(StreamError): pass class HostGone(StreamError): pass class HostUnknown(StreamError): pass class ImproperAddressing(StreamError): pass class InternalServerError(StreamError): pass class InvalidFrom(StreamError): pass class InvalidID(StreamError): pass class InvalidNamespace(StreamError): pass class InvalidXML(StreamError): pass class NotAuthorized(StreamError): pass class PolicyViolation(StreamError): pass class RemoteConnectionFailed(StreamError): pass class ResourceConstraint(StreamError): pass class RestrictedXML(StreamError): pass class SeeOtherHost(StreamError): pass class SystemShutdown(StreamError): pass class UndefinedCondition(StreamError): pass class UnsupportedEncoding(StreamError): pass class UnsupportedStanzaType(StreamError): pass class UnsupportedVersion(StreamError): pass class XMLNotWellFormed(StreamError): pass stream_exceptions = {'bad-format': BadFormat, 'bad-namespace-prefix': BadNamespacePrefix, 'conflict': Conflict, 'connection-timeout': ConnectionTimeout, 'host-gone': HostGone, 'host-unknown': HostUnknown, 'improper-addressing': ImproperAddressing, 'internal-server-error': InternalServerError, 'invalid-from': InvalidFrom, 'invalid-id': InvalidID, 'invalid-namespace': InvalidNamespace, 'invalid-xml': InvalidXML, 'not-authorized': NotAuthorized, 'policy-violation': PolicyViolation, 'remote-connection-failed': RemoteConnectionFailed, 'resource-constraint': ResourceConstraint, 'restricted-xml': RestrictedXML, 'see-other-host': SeeOtherHost, 'system-shutdown': SystemShutdown, 'undefined-condition': UndefinedCondition, 'unsupported-encoding': UnsupportedEncoding, 'unsupported-stanza-type': UnsupportedStanzaType, 'unsupported-version': UnsupportedVersion, 'xml-not-well-formed': XMLNotWellFormed} class JID: """ JID object. JID can be built from string, modified, compared, serialised into string. """ def __init__(self, jid=None, node='', domain='', resource=''): """ Constructor. JID can be specified as string (jid argument) or as separate parts. Examples: JID('node@domain/resource') JID(node='node',domain='domain.org') """ if not jid and not domain: raise ValueError('JID must contain at least domain name') elif type(jid)==type(self): self.node,self.domain,self.resource=jid.node,jid.domain,jid.resource elif domain: self.node,self.domain,self.resource=node,domain,resource else: if jid.find('@')+1: self.node,jid=jid.split('@',1) else: self.node='' if jid.find('/')+1: self.domain,self.resource=jid.split('/',1) else: self.domain,self.resource=jid,'' def getNode(self): """ Return the node part of the JID """ return self.node def setNode(self,node): """ Set the node part of the JID to new value. Specify None to remove the node part.""" self.node=node.lower() def getDomain(self): """ Return the domain part of the JID """ return self.domain def setDomain(self,domain): """ Set the domain part of the JID to new value.""" self.domain=domain.lower() def getResource(self): """ Return the resource part of the JID """ return self.resource def setResource(self,resource): """ Set the resource part of the JID to new value. Specify None to remove the resource part.""" self.resource=resource def getStripped(self): """ Return the bare representation of JID. I.e. string value w/o resource. """ return self.__str__(0) def __eq__(self, other): """ Compare the JID to another instance or to string for equality. """ try: other=JID(other) except ValueError: return 0 return self.resource==other.resource and self.__str__(0) == other.__str__(0) def __ne__(self, other): """ Compare the JID to another instance or to string for non-equality. """ return not self.__eq__(other) def bareMatch(self, other): """ Compare the node and domain parts of the JID's for equality. """ return self.__str__(0) == JID(other).__str__(0) def __str__(self,wresource=1): """ Serialise JID into string. """ if self.node: jid=self.node+'@'+self.domain else: jid=self.domain if wresource and self.resource: return jid+'/'+self.resource return jid def __hash__(self): """ Produce hash of the JID, Allows to use JID objects as keys of the dictionary. """ return hash(self.__str__()) class Protocol(Node): """ A "stanza" object class. Contains methods that are common for presences, iqs and messages. """ def __init__(self, name=None, to=None, typ=None, frm=None, attrs={}, payload=[], timestamp=None, xmlns=None, node=None): """ Constructor, name is the name of the stanza i.e. 'message' or 'presence' or 'iq'. to is the value of 'to' attribure, 'typ' - 'type' attribute frn - from attribure, attrs - other attributes mapping, payload - same meaning as for simplexml payload definition timestamp - the time value that needs to be stamped over stanza xmlns - namespace of top stanza node node - parsed or unparsed stana to be taken as prototype. """ if not attrs: attrs={} if to: attrs['to']=to if frm: attrs['from']=frm if typ: attrs['type']=typ Node.__init__(self, tag=name, attrs=attrs, payload=payload, node=node) if not node and xmlns: self.setNamespace(xmlns) if self['to']: self.setTo(self['to']) if self['from']: self.setFrom(self['from']) if node and type(self)==type(node) and self.__class__==node.__class__ and self.attrs.has_key('id'): del self.attrs['id'] self.timestamp=None for x in self.getTags('x',namespace=NS_DELAY): try: if not self.getTimestamp() or x.getAttr('stamp')'text': return tag.getName() return errtag.getData() def getErrorCode(self): """ Return the error code. Obsolette. """ return self.getTagAttr('error','code') def setError(self,error,code=None): """ Set the error code. Obsolette. Use error-conditions instead. """ if code: if str(code) in _errorcodes.keys(): error=ErrorNode(_errorcodes[str(code)],text=error) else: error=ErrorNode(ERR_UNDEFINED_CONDITION,code=code,typ='cancel',text=error) elif type(error) in [type(''),type(u'')]: error=ErrorNode(error) self.setType('error') self.addChild(node=error) def setTimestamp(self,val=None): """Set the timestamp. timestamp should be the yyyymmddThhmmss string.""" if not val: val=time.strftime('%Y%m%dT%H:%M:%S', time.gmtime()) self.timestamp=val self.setTag('x',{'stamp':self.timestamp},namespace=NS_DELAY) def getProperties(self): """ Return the list of namespaces to which belongs the direct childs of element""" props=[] for child in self.getChildren(): prop=child.getNamespace() if prop not in props: props.append(prop) return props def __setitem__(self,item,val): """ Set the item 'item' to the value 'val'.""" if item in ['to','from']: val=JID(val) return self.setAttr(item,val) class Message(Protocol): """ XMPP Message stanza - "push" mechanism.""" def __init__(self, to=None, body=None, typ=None, subject=None, attrs={}, frm=None, payload=[], timestamp=None, xmlns=NS_CLIENT, node=None): """ Create message object. You can specify recipient, text of message, type of message any additional attributes, sender of the message, any additional payload (f.e. jabber:x:delay element) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as message. """ Protocol.__init__(self, 'message', to=to, typ=typ, attrs=attrs, frm=frm, payload=payload, timestamp=timestamp, xmlns=xmlns, node=node) if body: self.setBody(body) if subject: self.setSubject(subject) def getBody(self): """ Returns text of the message. """ return self.getTagData('body') def getSubject(self): """ Returns subject of the message. """ return self.getTagData('subject') def getThread(self): """ Returns thread of the message. """ return self.getTagData('thread') def setBody(self,val): """ Sets the text of the message. """ self.setTagData('body',val) def setSubject(self,val): """ Sets the subject of the message. """ self.setTagData('subject',val) def setThread(self,val): """ Sets the thread of the message. """ self.setTagData('thread',val) def buildReply(self,text=None): """ Builds and returns another message object with specified text. The to, from and thread properties of new message are pre-set as reply to this message. """ m=Message(to=self.getFrom(),frm=self.getTo(),body=text) th=self.getThread() if th: m.setThread(th) return m class Presence(Protocol): """ XMPP Presence object.""" def __init__(self, to=None, typ=None, priority=None, show=None, status=None, attrs={}, frm=None, timestamp=None, payload=[], xmlns=NS_CLIENT, node=None): """ Create presence object. You can specify recipient, type of message, priority, show and status values any additional attributes, sender of the presence, timestamp, any additional payload (f.e. jabber:x:delay element) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as presence. """ Protocol.__init__(self, 'presence', to=to, typ=typ, attrs=attrs, frm=frm, payload=payload, timestamp=timestamp, xmlns=xmlns, node=node) if priority: self.setPriority(priority) if show: self.setShow(show) if status: self.setStatus(status) def getPriority(self): """ Returns the priority of the message. """ return self.getTagData('priority') def getShow(self): """ Returns the show value of the message. """ return self.getTagData('show') def getStatus(self): """ Returns the status string of the message. """ return self.getTagData('status') def setPriority(self,val): """ Sets the priority of the message. """ self.setTagData('priority',val) def setShow(self,val): """ Sets the show value of the message. """ self.setTagData('show',val) def setStatus(self,val): """ Sets the status string of the message. """ self.setTagData('status',val) def _muc_getItemAttr(self,tag,attr): for xtag in self.getTags('x'): for child in xtag.getTags(tag): return child.getAttr(attr) def _muc_getSubTagDataAttr(self,tag,attr): for xtag in self.getTags('x'): for child in xtag.getTags('item'): for cchild in child.getTags(tag): return cchild.getData(),cchild.getAttr(attr) return None,None def getRole(self): """Returns the presence role (for groupchat)""" return self._muc_getItemAttr('item','role') def getAffiliation(self): """Returns the presence affiliation (for groupchat)""" return self._muc_getItemAttr('item','affiliation') def getNick(self): """Returns the nick value (for nick change in groupchat)""" return self._muc_getItemAttr('item','nick') def getJid(self): """Returns the presence jid (for groupchat)""" return self._muc_getItemAttr('item','jid') def getReason(self): """Returns the reason of the presence (for groupchat)""" return self._muc_getSubTagDataAttr('reason','')[0] def getActor(self): """Returns the reason of the presence (for groupchat)""" return self._muc_getSubTagDataAttr('actor','jid')[1] def getStatusCode(self): """Returns the status code of the presence (for groupchat)""" return self._muc_getItemAttr('status','code') class Iq(Protocol): """ XMPP Iq object - get/set dialog mechanism. """ def __init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns=NS_CLIENT, node=None): """ Create Iq object. You can specify type, query namespace any additional attributes, recipient of the iq, sender of the iq, any additional payload (f.e. jabber:x:data node) and namespace in one go. Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as an iq. """ Protocol.__init__(self, 'iq', to=to, typ=typ, attrs=attrs, frm=frm, xmlns=xmlns, node=node) if payload: self.setQueryPayload(payload) if queryNS: self.setQueryNS(queryNS) def getQueryNS(self): """ Return the namespace of the 'query' child element.""" tag=self.getTag('query') if tag: return tag.getNamespace() def getQuerynode(self): """ Return the 'node' attribute value of the 'query' child element.""" return self.getTagAttr('query','node') def getQueryPayload(self): """ Return the 'query' child element payload.""" tag=self.getTag('query') if tag: return tag.getPayload() def getQueryChildren(self): """ Return the 'query' child element child nodes.""" tag=self.getTag('query') if tag: return tag.getChildren() def setQueryNS(self,namespace): """ Set the namespace of the 'query' child element.""" self.setTag('query').setNamespace(namespace) def setQueryPayload(self,payload): """ Set the 'query' child element payload.""" self.setTag('query').setPayload(payload) def setQuerynode(self,node): """ Set the 'node' attribute value of the 'query' child element.""" self.setTagAttr('query','node',node) def buildReply(self,typ): """ Builds and returns another Iq object of specified type. The to, from and query child node of new Iq are pre-set as reply to this Iq. """ iq=Iq(typ,to=self.getFrom(),frm=self.getTo(),attrs={'id':self.getID()}) if self.getTag('query'): iq.setQueryNS(self.getQueryNS()) return iq class ErrorNode(Node): """ XMPP-style error element. In the case of stanza error should be attached to XMPP stanza. In the case of stream-level errors should be used separately. """ def __init__(self,name,code=None,typ=None,text=None): """ Create new error node object. Mandatory parameter: name - name of error condition. Optional parameters: code, typ, text. Used for backwards compartibility with older jabber protocol.""" if ERRORS.has_key(name): cod,type,txt=ERRORS[name] ns=name.split()[0] else: cod,ns,type,txt='500',NS_STANZAS,'cancel','' if typ: type=typ if code: cod=code if text: txt=text Node.__init__(self,'error',{},[Node(name)]) if type: self.setAttr('type',type) if not cod: self.setName('stream:error') if txt: self.addChild(node=Node(ns+' text',{},[txt])) if cod: self.setAttr('code',cod) class Error(Protocol): """ Used to quickly transform received stanza into error reply.""" def __init__(self,node,error,reply=1): """ Create error reply basing on the received 'node' stanza and the 'error' error condition. If the 'node' is not the received stanza but locally created ('to' and 'from' fields needs not swapping) specify the 'reply' argument as false.""" if reply: Protocol.__init__(self,to=node.getFrom(),frm=node.getTo(),node=node) else: Protocol.__init__(self,node=node) self.setError(error) if node.getType()=='error': self.__str__=self.__dupstr__ def __dupstr__(self,dup1=None,dup2=None): """ Dummy function used as preventor of creating error node in reply to error node. I.e. you will not be able to serialise "double" error into string. """ return '' class DataField(Node): """ This class is used in the DataForm class to describe the single data item. If you are working with jabber:x:data (XEP-0004, XEP-0068, XEP-0122) then you will need to work with instances of this class. """ def __init__(self,name=None,value=None,typ=None,required=0,label=None,desc=None,options=[],node=None): """ Create new data field of specified name,value and type. Also 'required','desc' and 'options' fields can be set. Alternatively other XML object can be passed in as the 'node' parameted to replicate it as a new datafiled. """ Node.__init__(self,'field',node=node) if name: self.setVar(name) if type(value) in [list,tuple]: self.setValues(value) elif value: self.setValue(value) if typ: self.setType(typ) elif not typ and not node: self.setType('text-single') if required: self.setRequired(required) if label: self.setLabel(label) if desc: self.setDesc(desc) if options: self.setOptions(options) def setRequired(self,req=1): """ Change the state of the 'required' flag. """ if req: self.setTag('required') else: try: self.delChild('required') except ValueError: return def isRequired(self): """ Returns in this field a required one. """ return self.getTag('required') def setLabel(self,label): """ Set the label of this field. """ self.setAttr('label',label) def getLabel(self): """ Return the label of this field. """ return self.getAttr('label') def setDesc(self,desc): """ Set the description of this field. """ self.setTagData('desc',desc) def getDesc(self): """ Return the description of this field. """ return self.getTagData('desc') def setValue(self,val): """ Set the value of this field. """ self.setTagData('value',val) def getValue(self): return self.getTagData('value') def setValues(self,lst): """ Set the values of this field as values-list. Replaces all previous filed values! If you need to just add a value - use addValue method.""" while self.getTag('value'): self.delChild('value') for val in lst: self.addValue(val) def addValue(self,val): """ Add one more value to this field. Used in 'get' iq's or such.""" self.addChild('value',{},[val]) def getValues(self): """ Return the list of values associated with this field.""" ret=[] for tag in self.getTags('value'): ret.append(tag.getData()) return ret def getOptions(self): """ Return label-option pairs list associated with this field.""" ret=[] for tag in self.getTags('option'): ret.append([tag.getAttr('label'),tag.getTagData('value')]) return ret def setOptions(self,lst): """ Set label-option pairs list associated with this field.""" while self.getTag('option'): self.delChild('option') for opt in lst: self.addOption(opt) def addOption(self,opt): """ Add one more label-option pair to this field.""" if type(opt) in [str,unicode]: self.addChild('option').setTagData('value',opt) else: self.addChild('option',{'label':opt[0]}).setTagData('value',opt[1]) def getType(self): """ Get type of this field. """ return self.getAttr('type') def setType(self,val): """ Set type of this field. """ return self.setAttr('type',val) def getVar(self): """ Get 'var' attribute value of this field. """ return self.getAttr('var') def setVar(self,val): """ Set 'var' attribute value of this field. """ return self.setAttr('var',val) class DataForm(Node): """ DataForm class. Used for manipulating dataforms in XMPP. Relevant XEPs: 0004, 0068, 0122. Can be used in disco, pub-sub and many other applications.""" def __init__(self, typ=None, data=[], title=None, node=None): """ Create new dataform of type 'typ'. 'data' is the list of DataField instances that this dataform contains, 'title' - the title string. You can specify the 'node' argument as the other node to be used as base for constructing this dataform. title and instructions is optional and SHOULD NOT contain newlines. Several instructions MAY be present. 'typ' can be one of ('form' | 'submit' | 'cancel' | 'result' ) 'typ' of reply iq can be ( 'result' | 'set' | 'set' | 'result' ) respectively. 'cancel' form can not contain any fields. All other forms contains AT LEAST one field. 'title' MAY be included in forms of type "form" and "result" """ Node.__init__(self,'x',node=node) if node: newkids=[] for n in self.getChildren(): if n.getName()=='field': newkids.append(DataField(node=n)) else: newkids.append(n) self.kids=newkids if typ: self.setType(typ) self.setNamespace(NS_DATA) if title: self.setTitle(title) if type(data)==type({}): newdata=[] for name in data.keys(): newdata.append(DataField(name,data[name])) data=newdata for child in data: if type(child) in [type(''),type(u'')]: self.addInstructions(child) elif child.__class__.__name__=='DataField': self.kids.append(child) else: self.kids.append(DataField(node=child)) def getType(self): """ Return the type of dataform. """ return self.getAttr('type') def setType(self,typ): """ Set the type of dataform. """ self.setAttr('type',typ) def getTitle(self): """ Return the title of dataform. """ return self.getTagData('title') def setTitle(self,text): """ Set the title of dataform. """ self.setTagData('title',text) def getInstructions(self): """ Return the instructions of dataform. """ return self.getTagData('instructions') def setInstructions(self,text): """ Set the instructions of dataform. """ self.setTagData('instructions',text) def addInstructions(self,text): """ Add one more instruction to the dataform. """ self.addChild('instructions',{},[text]) def getField(self,name): """ Return the datafield object with name 'name' (if exists). """ return self.getTag('field',attrs={'var':name}) def setField(self,name): """ Create if nessessary or get the existing datafield object with name 'name' and return it. """ f=self.getField(name) if f: return f return self.addChild(node=DataField(name)) def asDict(self): """ Represent dataform as simple dictionary mapping of datafield names to their values.""" ret={} for field in self.getTags('field'): name=field.getAttr('var') typ=field.getType() if isinstance(typ,(str,unicode)) and typ[-6:]=='-multi': val=[] for i in field.getTags('value'): val.append(i.getData()) else: val=field.getTagData('value') ret[name]=val if self.getTag('instructions'): ret['instructions']=self.getInstructions() return ret def __getitem__(self,name): """ Simple dictionary interface for getting datafields values by their names.""" item=self.getField(name) if item: return item.getValue() raise IndexError('No such field') def __setitem__(self,name,val): """ Simple dictionary interface for setting datafields values by their names.""" return self.setField(name).setValue(val) xmpppy-0.4.1/xmpp/roster.py0000644000175000000500000002171310265212654014567 0ustar normansrc## roster.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: roster.py,v 1.20 2005/07/13 13:22:52 snakeru Exp $ """ Simple roster implementation. Can be used though for different tasks like mass-renaming of contacts. """ from protocol import * from client import PlugIn class Roster(PlugIn): """ Defines a plenty of methods that will allow you to manage roster. Also automatically track presences from remote JIDs taking into account that every JID can have multiple resources connected. Does not currently support 'error' presences. You can also use mapping interface for access to the internal representation of contacts in roster. """ def __init__(self): """ Init internal variables. """ PlugIn.__init__(self) self.DBG_LINE='roster' self._data = {} self.set=None self._exported_methods=[self.getRoster] def plugin(self,owner,request=1): """ Register presence and subscription trackers in the owner's dispatcher. Also request roster from server if the 'request' argument is set. Used internally.""" self._owner.RegisterHandler('iq',self.RosterIqHandler,'result',NS_ROSTER) self._owner.RegisterHandler('iq',self.RosterIqHandler,'set',NS_ROSTER) self._owner.RegisterHandler('presence',self.PresenceHandler) if request: self.Request() def Request(self,force=0): """ Request roster from server if it were not yet requested (or if the 'force' argument is set). """ if self.set is None: self.set=0 elif not force: return self._owner.send(Iq('get',NS_ROSTER)) self.DEBUG('Roster requested from server','start') def getRoster(self): """ Requests roster from server if neccessary and returns self.""" if not self.set: self.Request() while not self.set: self._owner.Process(10) return self def RosterIqHandler(self,dis,stanza): """ Subscription tracker. Used internally for setting items state in internal roster representation. """ for item in stanza.getTag('query').getTags('item'): jid=item.getAttr('jid') if item.getAttr('subscription')=='remove': if self._data.has_key(jid): del self._data[jid] raise NodeProcessed # a MUST self.DEBUG('Setting roster item %s...'%jid,'ok') if not self._data.has_key(jid): self._data[jid]={} self._data[jid]['name']=item.getAttr('name') self._data[jid]['ask']=item.getAttr('ask') self._data[jid]['subscription']=item.getAttr('subscription') self._data[jid]['groups']=[] if not self._data[jid].has_key('resources'): self._data[jid]['resources']={} for group in item.getTags('group'): self._data[jid]['groups'].append(group.getData()) self._data[self._owner.User+'@'+self._owner.Server]={'resources':{},'name':None,'ask':None,'subscription':None,'groups':None,} self.set=1 raise NodeProcessed # a MUST. Otherwise you'll get back an def PresenceHandler(self,dis,pres): """ Presence tracker. Used internally for setting items' resources state in internal roster representation. """ jid=JID(pres.getFrom()) if not self._data.has_key(jid.getStripped()): self._data[jid.getStripped()]={'name':None,'ask':None,'subscription':'none','groups':['Not in roster'],'resources':{}} item=self._data[jid.getStripped()] typ=pres.getType() if not typ: self.DEBUG('Setting roster item %s for resource %s...'%(jid.getStripped(),jid.getResource()),'ok') item['resources'][jid.getResource()]=res={'show':None,'status':None,'priority':'0','timestamp':None} if pres.getTag('show'): res['show']=pres.getShow() if pres.getTag('status'): res['status']=pres.getStatus() if pres.getTag('priority'): res['priority']=pres.getPriority() if not pres.getTimestamp(): pres.setTimestamp() res['timestamp']=pres.getTimestamp() elif typ=='unavailable' and item['resources'].has_key(jid.getResource()): del item['resources'][jid.getResource()] # Need to handle type='error' also def _getItemData(self,jid,dataname): """ Return specific jid's representation in internal format. Used internally. """ jid=jid[:(jid+'/').find('/')] return self._data[jid][dataname] def _getResourceData(self,jid,dataname): """ Return specific jid's resource representation in internal format. Used internally. """ if jid.find('/')+1: jid,resource=jid.split('/',1) if self._data[jid]['resources'].has_key(resource): return self._data[jid]['resources'][resource][dataname] elif self._data[jid]['resources'].keys(): lastpri=-129 for r in self._data[jid]['resources'].keys(): if int(self._data[jid]['resources'][r]['priority'])>lastpri: resource,lastpri=r,int(self._data[jid]['resources'][r]['priority']) return self._data[jid]['resources'][resource][dataname] def delItem(self,jid): """ Delete contact 'jid' from roster.""" self._owner.send(Iq('set',NS_ROSTER,payload=[Node('item',{'jid':jid,'subscription':'remove'})])) def getAsk(self,jid): """ Returns 'ask' value of contact 'jid'.""" return self._getItemData(jid,'ask') def getGroups(self,jid): """ Returns groups list that contact 'jid' belongs to.""" return self._getItemData(jid,'groups') def getName(self,jid): """ Returns name of contact 'jid'.""" return self._getItemData(jid,'name') def getPriority(self,jid): """ Returns priority of contact 'jid'. 'jid' should be a full (not bare) JID.""" return self._getResourceData(jid,'priority') def getRawRoster(self): """ Returns roster representation in internal format. """ return self._data def getRawItem(self,jid): """ Returns roster item 'jid' representation in internal format. """ return self._data[jid[:(jid+'/').find('/')]] def getShow(self, jid): """ Returns 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID.""" return self._getResourceData(jid,'show') def getStatus(self, jid): """ Returns 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID.""" return self._getResourceData(jid,'status') def getSubscription(self,jid): """ Returns 'subscription' value of contact 'jid'.""" return self._getItemData(jid,'subscription') def getResources(self,jid): """ Returns list of connected resources of contact 'jid'.""" return self._data[jid[:(jid+'/').find('/')]]['resources'].keys() def setItem(self,jid,name=None,groups=[]): """ Creates/renames contact 'jid' and sets the groups list that it now belongs to.""" iq=Iq('set',NS_ROSTER) query=iq.getTag('query') attrs={'jid':jid} if name: attrs['name']=name item=query.setTag('item',attrs) for group in groups: item.addChild(node=Node('group',payload=[group])) self._owner.send(iq) def getItems(self): """ Return list of all [bare] JIDs that the roster is currently tracks.""" return self._data.keys() def keys(self): """ Same as getItems. Provided for the sake of dictionary interface.""" return self._data.keys() def __getitem__(self,item): """ Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster.""" return self._data[item] def getItem(self,item): """ Get the contact in the internal format (or None if JID 'item' is not in roster).""" if self._data.has_key(item): return self._data[item] def Subscribe(self,jid): """ Send subscription request to JID 'jid'.""" self._owner.send(Presence(jid,'subscribe')) def Unsubscribe(self,jid): """ Ask for removing our subscription for JID 'jid'.""" self._owner.send(Presence(jid,'unsubscribe')) def Authorize(self,jid): """ Authorise JID 'jid'. Works only if these JID requested auth previously. """ self._owner.send(Presence(jid,'subscribed')) def Unauthorize(self,jid): """ Unauthorise JID 'jid'. Use for declining authorisation request or for removing existing authorization. """ self._owner.send(Presence(jid,'unsubscribed')) xmpppy-0.4.1/xmpp/session.py0000644000175000000500000004104510317545010014725 0ustar normansrc## ## XMPP server ## ## Copyright (C) 2004 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. __version__="$Id" """ When your handler is called it is getting the session instance as the first argument. This is the difference from xmpppy 0.1 where you got the "Client" instance. With Session class you can have "multi-session" client instead of having one client for each connection. Is is specifically important when you are writing the server. """ from protocol import * # Transport-level flags SOCKET_UNCONNECTED =0 SOCKET_ALIVE =1 SOCKET_DEAD =2 # XML-level flags STREAM__NOT_OPENED =1 STREAM__OPENED =2 STREAM__CLOSING =3 STREAM__CLOSED =4 # XMPP-session flags SESSION_NOT_AUTHED =1 SESSION_AUTHED =2 SESSION_BOUND =3 SESSION_OPENED =4 SESSION_CLOSED =5 class Session: """ The Session class instance is used for storing all session-related info like credentials, socket/xml stream/session state flags, roster items (in case of client type connection) etc. Session object have no means of discovering is any info is ready to be read. Instead you should use poll() (recomended) or select() methods for this purpose. Session can be one of two types: 'server' and 'client'. 'server' session handles inbound connection and 'client' one used to create an outbound one. Session instance have multitude of internal attributes. The most imporant is the 'peer' one. It is set once the peer is authenticated (client). """ def __init__(self,socket,owner,xmlns=None,peer=None): """ When the session is created it's type (client/server) is determined from the beginning. socket argument is the pre-created socket-like object. It must have the following methods: send, recv, fileno, close. owner is the 'master' instance that have Dispatcher plugged into it and generally will take care about all session events. xmlns is the stream namespace that will be used. Client must set this argument If server sets this argument than stream will be dropped if opened with some another namespace. peer is the name of peer instance. This is the flag that differentiates client session from server session. Client must set it to the name of the server that will be connected, server must leave this argument alone. """ self.xmlns=xmlns if peer: self.TYP='client' self.peer=peer self._socket_state=SOCKET_UNCONNECTED else: self.TYP='server' self.peer=None self._socket_state=SOCKET_ALIVE self._sock=socket self._send=socket.send self._recv=socket.recv self.fileno=socket.fileno self._registered=0 self.Dispatcher=owner.Dispatcher self.DBG_LINE='session' self.DEBUG=owner.Dispatcher.DEBUG self._expected={} self._owner=owner if self.TYP=='server': self.ID=`random.random()`[2:] else: self.ID=None self.sendbuffer='' self._stream_pos_queued=None self._stream_pos_sent=0 self.deliver_key_queue=[] self.deliver_queue_map={} self.stanza_queue=[] self._session_state=SESSION_NOT_AUTHED self.waiting_features=[] for feature in [NS_TLS,NS_SASL,NS_BIND,NS_SESSION]: if feature in owner.features: self.waiting_features.append(feature) self.features=[] self.feature_in_process=None self.slave_session=None self.StartStream() def StartStream(self): """ This method is used to initialise the internal xml expat parser and to send initial stream header (in case of client connection). Should be used after initial connection and after every stream restart.""" self._stream_state=STREAM__NOT_OPENED self.Stream=simplexml.NodeBuilder() self.Stream._dispatch_depth=2 self.Stream.dispatch=self._dispatch self.Parse=self.Stream.Parse self.Stream.stream_footer_received=self._stream_close if self.TYP=='client': self.Stream.stream_header_received=self._catch_stream_id self._stream_open() else: self.Stream.stream_header_received=self._stream_open def receive(self): """ Reads all pending incoming data. Raises IOError on disconnection. Blocks until at least one byte is read.""" try: received = self._recv(10240) except: received = '' if len(received): # length of 0 means disconnect self.DEBUG(`self.fileno()`+' '+received,'got') else: self.DEBUG('Socket error while receiving data','error') self.set_socket_state(SOCKET_DEAD) raise IOError("Peer disconnected") return received def sendnow(self,chunk): """ Put chunk into "immidiatedly send" queue. Should only be used for auth/TLS stuff and like. If you just want to shedule regular stanza for delivery use enqueue method. """ if isinstance(chunk,Node): chunk = chunk.__str__().encode('utf-8') elif type(chunk)==type(u''): chunk = chunk.encode('utf-8') self.enqueue(chunk) def enqueue(self,stanza): """ Takes Protocol instance as argument. Puts stanza into "send" fifo queue. Items into the send queue are hold until stream authenticated. After that this method is effectively the same as "sendnow" method.""" if isinstance(stanza,Protocol): self.stanza_queue.append(stanza) else: self.sendbuffer+=stanza if self._socket_state>=SOCKET_ALIVE: self.push_queue() def push_queue(self,failreason=ERR_RECIPIENT_UNAVAILABLE): """ If stream is authenticated than move items from "send" queue to "immidiatedly send" queue. Else if the stream is failed then return all queued stanzas with error passed as argument. Otherwise do nothing.""" # If the stream authed - convert stanza_queue into sendbuffer and set the checkpoints if self._stream_state>=STREAM__CLOSED or self._socket_state>=SOCKET_DEAD: # the stream failed. Return all stanzas that are still waiting for delivery. self._owner.deactivatesession(self) for key in self.deliver_key_queue: # Not sure. May be I self._dispatch(Error(self.deliver_queue_map[key],failreason),trusted=1) # should simply re-dispatch it? for stanza in self.stanza_queue: # But such action can invoke self._dispatch(Error(stanza,failreason),trusted=1) # Infinite loops in case of S2S connection... self.deliver_queue_map,self.deliver_key_queue,self.stanza_queue={},[],[] return elif self._session_state>=SESSION_AUTHED: # FIXME! Должен быть какой-то другой флаг. #### LOCK_QUEUE for stanza in self.stanza_queue: txt=stanza.__str__().encode('utf-8') self.sendbuffer+=txt self._stream_pos_queued+=len(txt) # should be re-evaluated for SSL connection. self.deliver_queue_map[self._stream_pos_queued]=stanza # position of the stream when stanza will be successfully and fully sent self.deliver_key_queue.append(self._stream_pos_queued) self.stanza_queue=[] #### UNLOCK_QUEUE def flush_queue(self): """ Put the "immidiatedly send" queue content on the wire. Blocks until at least one byte sent.""" if self.sendbuffer: try: # LOCK_QUEUE sent=self._send(self.sendbuffer) # Блокирующая штучка! except: # UNLOCK_QUEUE self.set_socket_state(SOCKET_DEAD) self.DEBUG("Socket error while sending data",'error') return self.terminate_stream() self.DEBUG(`self.fileno()`+' '+self.sendbuffer[:sent],'sent') self._stream_pos_sent+=sent self.sendbuffer=self.sendbuffer[sent:] self._stream_pos_delivered=self._stream_pos_sent # Should be acquired from socket somehow. Take SSL into account. while self.deliver_key_queue and self._stream_pos_delivered>self.deliver_key_queue[0]: del self.deliver_queue_map[self.deliver_key_queue[0]] self.deliver_key_queue.remove(self.deliver_key_queue[0]) # UNLOCK_QUEUE def _dispatch(self,stanza,trusted=0): """ This is callback that is used to pass the received stanza forth to owner's dispatcher _if_ the stream is authorised. Otherwise the stanza is just dropped. The 'trusted' argument is used to emulate stanza receive. This method is used internally. """ self._owner.packets+=1 print self._owner.packets if self._stream_state==STREAM__OPENED or trusted: # if the server really should reject all stanzas after he is closed stream (himeself)? self.DEBUG(stanza.__str__(),'dispatch') stanza.trusted=trusted return self.Dispatcher.dispatch(stanza,self) def _catch_stream_id(self,ns=None,tag='stream',attrs={}): """ This callback is used to detect the stream namespace of incoming stream. Used internally. """ if not attrs.has_key('id') or not attrs['id']: return self.terminate_stream(STREAM_INVALID_XML) self.ID=attrs['id'] if not attrs.has_key('version'): self._owner.Dialback(self) def _stream_open(self,ns=None,tag='stream',attrs={}): """ This callback is used to handle opening stream tag of the incoming stream. In the case of client session it just make some validation. Server session also sends server headers and if the stream valid the features node. Used internally. """ text='\n') self.set_stream_state(STREAM__OPENED) if self.TYP=='client': return if tag<>'stream': return self.terminate_stream(STREAM_INVALID_XML) if ns<>NS_STREAMS: return self.terminate_stream(STREAM_INVALID_NAMESPACE) if self.Stream.xmlns<>self.xmlns: return self.terminate_stream(STREAM_BAD_NAMESPACE_PREFIX) if not attrs.has_key('to'): return self.terminate_stream(STREAM_IMPROPER_ADDRESSING) if attrs['to'] not in self._owner.servernames: return self.terminate_stream(STREAM_HOST_UNKNOWN) self.ourname=attrs['to'].lower() if self.TYP=='server' and attrs.has_key('version'): # send features features=Node('stream:features') if NS_TLS in self.waiting_features: features.NT.starttls.setNamespace(NS_TLS) features.T.starttls.NT.required if NS_SASL in self.waiting_features: features.NT.mechanisms.setNamespace(NS_SASL) for mec in self._owner.SASL.mechanisms: features.T.mechanisms.NT.mechanism=mec else: if NS_BIND in self.waiting_features: features.NT.bind.setNamespace(NS_BIND) if NS_SESSION in self.waiting_features: features.NT.session.setNamespace(NS_SESSION) self.sendnow(features) def feature(self,feature): """ Declare some stream feature as activated one. """ if feature not in self.features: self.features.append(feature) self.unfeature(feature) def unfeature(self,feature): """ Declare some feature as illegal. Illegal features can not be used. Example: BIND feature becomes illegal after Non-SASL auth. """ if feature in self.waiting_features: self.waiting_features.remove(feature) def _stream_close(self,unregister=1): """ Write the closing stream tag and destroy the underlaying socket. Used internally. """ if self._stream_state>=STREAM__CLOSED: return self.set_stream_state(STREAM__CLOSING) self.sendnow('') self.set_stream_state(STREAM__CLOSED) self.push_queue() # decompose queue really since STREAM__CLOSED self._owner.flush_queues() if unregister: self._owner.unregistersession(self) self._destroy_socket() def terminate_stream(self,error=None,unregister=1): """ Notify the peer about stream closure. Ensure that xmlstream is not brokes - i.e. if the stream isn't opened yet - open it before closure. If the error condition is specified than create a stream error and send it along with closing stream tag. Emulate receiving 'unavailable' type presence just before stream closure. """ if self._stream_state>=STREAM__CLOSING: return if self._stream_statef: raise "Stopping feature %s instead of %s !"%(f,self.feature_in_process) self.feature_in_process=None def set_socket_state(self,newstate): """ Change the underlaying socket state. Socket starts with SOCKET_UNCONNECTED state and then proceeds (possibly) to SOCKET_ALIVE and then to SOCKET_DEAD """ if self._socket_state=SESSION_AUTHED: self._stream_pos_queued=self._stream_pos_sent self._session_state=newstate def set_stream_state(self,newstate): """ Change the underlaying XML stream state Stream starts with STREAM__NOT_OPENED and then proceeds with STREAM__OPENED, STREAM__CLOSING and STREAM__CLOSED states. Note that some features (like TLS and SASL) requires stream re-start so this state can have non-linear changes. """ if self._stream_state " replaced by their respective XML entities.""" return txt.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """) ENCODING='utf-8' def ustr(what): """Converts object "what" to unicode string using it's own __str__ method if accessible or unicode method otherwise.""" if type(what) == type(u''): return what try: r=what.__str__() except AttributeError: r=str(what) if type(r)<>type(u''): return unicode(r,ENCODING) return r class Node: """ Node class describes syntax of separate XML Node. It have a constructor that permits node creation from set of "namespace name", attributes and payload of text strings and other nodes. It does not natively support building node from text string and uses NodeBuilder class for that purpose. After creation node can be mangled in many ways so it can be completely changed. Also node can be serialised into string in one of two modes: default (where the textual representation of node describes it exactly) and "fancy" - with whitespace added to make indentation and thus make result more readable by human. Node class have attribute FORCE_NODE_RECREATION that is defaults to False thus enabling fast node replication from the some other node. The drawback of the fast way is that new node shares some info with the "original" node that is changing the one node may influence the other. Though it is rarely needed (in xmpppy it is never needed at all since I'm usually never using original node after replication (and using replication only to move upwards on the classes tree). """ FORCE_NODE_RECREATION=0 def __init__(self, tag=None, attrs={}, payload=[], parent=None, node=None): """ Takes "tag" argument as the name of node (prepended by namespace, if needed and separated from it by a space), attrs dictionary as the set of arguments, payload list as the set of textual strings and child nodes that this node carries within itself and "parent" argument that is another node that this one will be the child of. Also the __init__ can be provided with "node" argument that is either a text string containing exactly one node or another Node instance to begin with. If both "node" and other arguments is provided then the node initially created as replica of "node" provided and then modified to be compliant with other arguments.""" if node: if self.FORCE_NODE_RECREATION and type(node)==type(self): node=str(node) if type(node)<>type(self): node=NodeBuilder(node,self) else: self.name,self.namespace,self.attrs,self.data,self.kids,self.parent = node.name,node.namespace,{},[],[],node.parent for key in node.attrs.keys(): self.attrs[key]=node.attrs[key] for data in node.data: self.data.append(data) for kid in node.kids: self.kids.append(kid) else: self.name,self.namespace,self.attrs,self.data,self.kids,self.parent = 'tag','',{},[],[],None if tag: self.namespace, self.name = ([self.namespace]+tag.split())[-2:] if parent: self.parent = parent if self.parent and not self.namespace: self.namespace=self.parent.namespace for attr in attrs.keys(): self.attrs[attr]=attrs[attr] if type(payload) in (type(''),type(u'')): payload=[payload] for i in payload: if type(i)==type(self): self.addChild(node=i) else: self.addData(i) def __str__(self,fancy=0): """ Method used to dump node into textual representation. if "fancy" argument is set to True produces indented output for readability.""" s = (fancy-1) * 2 * ' ' + "<" + self.name if self.namespace: if not self.parent or self.parent.namespace!=self.namespace: s = s + ' xmlns="%s"'%self.namespace for key in self.attrs.keys(): val = ustr(self.attrs[key]) s = s + ' %s="%s"' % ( key, XMLescape(val) ) s = s + ">" cnt = 0 if self.kids: if fancy: s = s + "\n" for a in self.kids: if not fancy and (len(self.data)-1)>=cnt: s=s+XMLescape(self.data[cnt]) elif (len(self.data)-1)>=cnt: s=s+XMLescape(self.data[cnt].strip()) if a: s = s + a.__str__(fancy and fancy+1) cnt=cnt+1 if not fancy and (len(self.data)-1) >= cnt: s = s + XMLescape(self.data[cnt]) elif (len(self.data)-1) >= cnt: s = s + XMLescape(self.data[cnt].strip()) if not self.kids and s[-1:]=='>': s=s[:-1]+' />' if fancy: s = s + "\n" else: if fancy and not self.data: s = s + (fancy-1) * 2 * ' ' s = s + "" if fancy: s = s + "\n" return s def getCDATA(self): """ Serialise node, dropping all tags and leaving CDATA intact. That is effectively kills all formatiing, leaving only text were contained in XML. """ s = "" cnt = 0 if self.kids: for a in self.kids: s=s+self.data[cnt] if a: s = s + a.getCDATA() cnt=cnt+1 if (len(self.data)-1) >= cnt: s = s + self.data[cnt] return s def addChild(self, name=None, attrs={}, payload=[], namespace=None, node=None): """ If "node" argument is provided, adds it as child node. Else creates new node from the other arguments' values and adds it as well.""" if attrs.has_key('xmlns'): raise AttributeError("Use namespace=x instead of attrs={'xmlns':x}") if namespace: name=namespace+' '+name if node: newnode=node node.parent = self else: newnode=Node(tag=name, parent=self, attrs=attrs, payload=payload) self.kids.append(newnode) self.data.append(u'') return newnode def addData(self, data): """ Adds some CDATA to node. """ self.data.append(ustr(data)) self.kids.append(None) def clearData(self): """ Removes all CDATA from the node. """ self.data=[] def delAttr(self, key): """ Deletes an attribute "key" """ del self.attrs[key] def delChild(self, node, attrs={}): """ Deletes the "node" from the node's childs list, if "node" is an instance. Else deletes the first node that have specified name and (optionally) attributes. """ if type(node)<>type(self): node=self.getTag(node,attrs) self.kids[self.kids.index(node)]=None return node def getAttrs(self): """ Returns all node's attributes as dictionary. """ return self.attrs def getAttr(self, key): """ Returns value of specified attribute. """ try: return self.attrs[key] except: return None def getChildren(self): """ Returns all node's child nodes as list. """ return self.kids def getData(self): """ Returns all node CDATA as string (concatenated). """ return ''.join(self.data) def getName(self): """ Returns the name of node """ return self.name def getNamespace(self): """ Returns the namespace of node """ return self.namespace def getParent(self): """ Returns the parent of node (if present). """ return self.parent def getPayload(self): """ Return the payload of node i.e. list of child nodes and CDATA entries. F.e. for "text1 text2" will be returned list: ['text1', , , ' text2']. """ ret=[] for i in range(max(len(self.data),len(self.kids))): if i < len(self.data) and self.data[i]: ret.append(self.data[i]) if i < len(self.kids) and self.kids[i]: ret.append(self.kids[i]) return ret def getTag(self, name, attrs={}, namespace=None): """ Filters all child nodes using specified arguments as filter. Returns the first found or None if not found. """ return self.getTags(name, attrs, namespace, one=1) def getTagAttr(self,tag,attr): """ Returns attribute value of the child with specified name (or None if no such attribute).""" try: return self.getTag(tag).attrs[attr] except: return None def getTagData(self,tag): """ Returns cocatenated CDATA of the child with specified name.""" try: return self.getTag(tag).getData() except: return None def getTags(self, name, attrs={}, namespace=None, one=0): """ Filters all child nodes using specified arguments as filter. Returns the list of nodes found. """ nodes=[] for node in self.kids: if not node: continue if namespace and namespace<>node.getNamespace(): continue if node.getName() == name: for key in attrs.keys(): if not node.attrs.has_key(key) or node.attrs[key]<>attrs[key]: break else: nodes.append(node) if one and nodes: return nodes[0] if not one: return nodes def setAttr(self, key, val): """ Sets attribute "key" with the value "val". """ self.attrs[key]=val def setData(self, data): """ Sets node's CDATA to provided string. Resets all previous CDATA!""" self.data=[ustr(data)] def setName(self,val): """ Changes the node name. """ self.name = val def setNamespace(self, namespace): """ Changes the node namespace. """ self.namespace=namespace def setParent(self, node): """ Sets node's parent to "node". WARNING: do not checks if the parent already present and not removes the node from the list of childs of previous parent. """ self.parent = node def setPayload(self,payload,add=0): """ Sets node payload according to the list specified. WARNING: completely replaces all node's previous content. If you wish just to add child or CDATA - use addData or addChild methods. """ if type(payload) in (type(''),type(u'')): payload=[payload] if add: self.kids+=payload else: self.kids=payload def setTag(self, name, attrs={}, namespace=None): """ Same as getTag but if the node with specified namespace/attributes not found, creates such node and returns it. """ node=self.getTags(name, attrs, namespace=namespace, one=1) if node: return node else: return self.addChild(name, attrs, namespace=namespace) def setTagAttr(self,tag,attr,val): """ Creates new node (if not already present) with name "tag" and sets it's attribute "attr" to value "val". """ try: self.getTag(tag).attrs[attr]=val except: self.addChild(tag,attrs={attr:val}) def setTagData(self,tag,val,attrs={}): """ Creates new node (if not already present) with name "tag" and (optionally) attributes "attrs" and sets it's CDATA to string "val". """ try: self.getTag(tag,attrs).setData(ustr(val)) except: self.addChild(tag,attrs,payload=[ustr(val)]) def has_attr(self,key): """ Checks if node have attribute "key".""" return self.attrs.has_key(key) def __getitem__(self,item): """ Returns node's attribute "item" value. """ return self.getAttr(item) def __setitem__(self,item,val): """ Sets node's attribute "item" value. """ return self.setAttr(item,val) def __delitem__(self,item): """ Deletes node's attribute "item". """ return self.delAttr(item) def __getattr__(self,attr): """ Reduce memory usage caused by T/NT classes - use memory only when needed. """ if attr=='T': self.T=T(self) return self.T if attr=='NT': self.NT=NT(self) return self.NT raise AttributeError class T: """ Auxiliary class used to quick access to node's child nodes. """ def __init__(self,node): self.__dict__['node']=node def __getattr__(self,attr): return self.node.getTag(attr) def __setattr__(self,attr,val): if isinstance(val,Node): Node.__init__(self.node.setTag(attr),node=val) else: return self.node.setTagData(attr,val) def __delattr__(self,attr): return self.node.delChild(attr) class NT(T): """ Auxiliary class used to quick create node's child nodes. """ def __getattr__(self,attr): return self.node.addChild(attr) def __setattr__(self,attr,val): if isinstance(val,Node): self.node.addChild(attr,node=val) else: return self.node.addChild(attr,payload=[val]) DBG_NODEBUILDER = 'nodebuilder' class NodeBuilder: """ Builds a Node class minidom from data parsed to it. This class used for two purposes: 1. Creation an XML Node from a textual representation. F.e. reading a config file. See an XML2Node method. 2. Handling an incoming XML stream. This is done by mangling the __dispatch_depth parameter and redefining the dispatch method. You do not need to use this class directly if you do not designing your own XML handler.""" def __init__(self,data=None,initial_node=None): """ Takes two optional parameters: "data" and "initial_node". By default class initialised with empty Node class instance. Though, if "initial_node" is provided it used as "starting point". You can think about it as of "node upgrade". "data" (if provided) feeded to parser immidiatedly after instance init. """ self.DEBUG(DBG_NODEBUILDER, "Preparing to handle incoming XML stream.", 'start') self._parser = xml.parsers.expat.ParserCreate(namespace_separator=' ') self._parser.StartElementHandler = self.starttag self._parser.EndElementHandler = self.endtag self._parser.CharacterDataHandler = self.handle_data self._parser.StartNamespaceDeclHandler = self.handle_namespace_start self.Parse = self._parser.Parse self.__depth = 0 self._dispatch_depth = 1 self._document_attrs = None self._mini_dom=initial_node self.last_is_data = 1 self._ptr=None self.namespaces={"http://www.w3.org/XML/1998/namespace":'xml:'} self.xmlns="http://www.w3.org/XML/1998/namespace" if data: self._parser.Parse(data,1) def destroy(self): """ Method used to allow class instance to be garbage-collected. """ self._parser.StartElementHandler = None self._parser.EndElementHandler = None self._parser.CharacterDataHandler = None self._parser.StartNamespaceDeclHandler = None def starttag(self, tag, attrs): """XML Parser callback. Used internally""" attlist=attrs.keys() # for attr in attlist: # FIXME: Crude hack. And it also slows down the whole library considerably. sp=attr.rfind(" ") # if sp==-1: continue # ns=attr[:sp] # attrs[self.namespaces[ns]+attr[sp+1:]]=attrs[attr] del attrs[attr] # self.__depth += 1 self.DEBUG(DBG_NODEBUILDER, "DEPTH -> %i , tag -> %s, attrs -> %s" % (self.__depth, tag, `attrs`), 'down') if self.__depth == self._dispatch_depth: if not self._mini_dom : self._mini_dom = Node(tag=tag, attrs=attrs) else: Node.__init__(self._mini_dom,tag=tag, attrs=attrs) self._ptr = self._mini_dom elif self.__depth > self._dispatch_depth: self._ptr.kids.append(Node(tag=tag,parent=self._ptr,attrs=attrs)) self._ptr = self._ptr.kids[-1] if self.__depth == 1: self._document_attrs = attrs ns, name = (['']+tag.split())[-2:] self.stream_header_received(ns, name, attrs) if not self.last_is_data and self._ptr.parent: self._ptr.parent.data.append('') self.last_is_data = 0 def endtag(self, tag ): """XML Parser callback. Used internally""" self.DEBUG(DBG_NODEBUILDER, "DEPTH -> %i , tag -> %s" % (self.__depth, tag), 'up') if self.__depth == self._dispatch_depth: self.dispatch(self._mini_dom) elif self.__depth > self._dispatch_depth: self._ptr = self._ptr.parent else: self.DEBUG(DBG_NODEBUILDER, "Got higher than dispatch level. Stream terminated?", 'stop') self.__depth -= 1 self.last_is_data = 0 if self.__depth == 0: self.stream_footer_received() def handle_data(self, data): """XML Parser callback. Used internally""" self.DEBUG(DBG_NODEBUILDER, data, 'data') if not self._ptr: return if self.last_is_data: self._ptr.data[-1] += data else: self._ptr.data.append(data) self.last_is_data = 1 def handle_namespace_start(self, prefix, uri): """XML Parser callback. Used internally""" if prefix: self.namespaces[uri]=prefix+':' else: self.xmlns=uri def DEBUG(self, level, text, comment=None): """ Gets all NodeBuilder walking events. Can be used for debugging if redefined.""" def getDom(self): """ Returns just built Node. """ return self._mini_dom def dispatch(self,stanza): """ Gets called when the NodeBuilder reaches some level of depth on it's way up with the built node as argument. Can be redefined to convert incoming XML stanzas to program events. """ def stream_header_received(self,ns,tag,attrs): """ Method called when stream just opened. """ def stream_footer_received(self): """ Method called when stream just closed. """ def XML2Node(xml): """ Converts supplied textual string into XML node. Handy f.e. for reading configuration file. Raises xml.parser.expat.parsererror if provided string is not well-formed XML. """ return NodeBuilder(xml).getDom() def BadXML2Node(xml): """ Converts supplied textual string into XML node. Survives if xml data is cutted half way round. I.e. "some text
some more text". Will raise xml.parser.expat.parsererror on misplaced tags though. F.e. "some text
some more text
" will not work.""" return NodeBuilder(xml).getDom() xmpppy-0.4.1/xmpp/transports.py0000644000175000000500000003456210672741504015501 0ustar normansrc## transports.py ## ## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. # $Id: transports.py,v 1.31 2007/09/15 11:34:28 normanr Exp $ """ This module contains the low-level implementations of xmpppy connect methods or (in other words) transports for xmpp-stanzas. Currently here is three transports: direct TCP connect - TCPsocket class proxied TCP connect - HTTPPROXYsocket class (CONNECT proxies) TLS connection - TLS class. Can be used for SSL connections also. Transports are stackable so you - f.e. TLS use HTPPROXYsocket or TCPsocket as more low-level transport. Also exception 'error' is defined to allow capture of this module specific exceptions. """ import socket,select,base64,dispatcher,sys from simplexml import ustr from client import PlugIn from protocol import * # determine which DNS resolution library is available HAVE_DNSPYTHON = False HAVE_PYDNS = False try: import dns.resolver # http://dnspython.org/ HAVE_DNSPYTHON = True except ImportError: try: import DNS # http://pydns.sf.net/ HAVE_PYDNS = True except ImportError: #TODO: use self.DEBUG() sys.stderr.write("Could not load one of the supported DNS libraries (dnspython or pydns). SRV records will not be queried and you may need to set custom hostname/port for some servers to be accessible.\n") DATA_RECEIVED='DATA RECEIVED' DATA_SENT='DATA SENT' class error: """An exception to be raised in case of low-level errors in methods of 'transports' module.""" def __init__(self,comment): """Cache the descriptive string""" self._comment=comment def __str__(self): """Serialise exception into pre-cached descriptive string.""" return self._comment BUFLEN=1024 class TCPsocket(PlugIn): """ This class defines direct TCP connection method. """ def __init__(self, server=None, use_srv=True): """ Cache connection point 'server'. 'server' is the tuple of (host, port) absolutely the same as standard tcp socket uses. """ PlugIn.__init__(self) self.DBG_LINE='socket' self._exported_methods=[self.send,self.disconnect] # SRV resolver if use_srv and (HAVE_DNSPYTHON or HAVE_PYDNS): host, port = server possible_queries = ['_xmpp-client._tcp.' + host] for query in possible_queries: try: if HAVE_DNSPYTHON: answers = [x for x in dns.resolver.query(query, 'SRV')] if answers: host = str(answers[0].target) port = int(answers[0].port) break elif HAVE_PYDNS: # ensure we haven't cached an old configuration DNS.ParseResolvConf() response = DNS.Request().req(query, qtype='SRV') answers = response.answers if len(answers) > 0: # ignore the priority and weight for now _, _, port, host = answers[0]['data'] del _ port = int(port) break except: #TODO: use self.DEBUG() print 'An error occurred while looking up %s' % query server = (host, port) # end of SRV resolver self._server = server def plugin(self, owner): """ Fire up connection. Return non-empty string on success. Also registers self.disconnected method in the owner's dispatcher. Called internally. """ if not self._server: self._server=(self._owner.Server,5222) if not self.connect(self._server): return self._owner.Connection=self self._owner.RegisterDisconnectHandler(self.disconnected) return 'ok' def getHost(self): """ Return the 'host' value that is connection is [will be] made to.""" return self._server[0] def getPort(self): """ Return the 'port' value that is connection is [will be] made to.""" return self._server[1] def connect(self,server=None): """ Try to connect. Returns non-empty string on success. """ try: if not server: server=self._server self._sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM) self._sock.connect((server[0], int(server[1]))) self._send=self._sock.sendall self._recv=self._sock.recv self.DEBUG("Successfully connected to remote host %s"%`server`,'start') return 'ok' except socket.error, (errno, strerror): self.DEBUG("Failed to connect to remote host %s: %s (%s)"%(`server`, strerror, errno),'error') except: pass def plugout(self): """ Disconnect from the remote server and unregister self.disconnected method from the owner's dispatcher. """ self._sock.close() if self._owner.__dict__.has_key('Connection'): del self._owner.Connection self._owner.UnregisterDisconnectHandler(self.disconnected) def receive(self): """ Reads all pending incoming data. In case of disconnection calls owner's disconnected() method and then raises IOError exception.""" try: received = self._recv(BUFLEN) except socket.sslerror,e: self._seen_data=0 if e[0]==socket.SSL_ERROR_WANT_READ: return '' if e[0]==socket.SSL_ERROR_WANT_WRITE: return '' self.DEBUG('Socket error while receiving data','error') sys.exc_clear() self._owner.disconnected() raise IOError("Disconnected from server") except: received = '' while self.pending_data(0): try: add = self._recv(BUFLEN) except: add='' received +=add if not add: break if len(received): # length of 0 means disconnect self._seen_data=1 self.DEBUG(received,'got') if hasattr(self._owner, 'Dispatcher'): self._owner.Dispatcher.Event('', DATA_RECEIVED, received) else: self.DEBUG('Socket error while receiving data','error') self._owner.disconnected() raise IOError("Disconnected from server") return received def send(self,raw_data): """ Writes raw outgoing data. Blocks until done. If supplied data is unicode string, encodes it to utf-8 before send.""" if type(raw_data)==type(u''): raw_data = raw_data.encode('utf-8') elif type(raw_data)<>type(''): raw_data = ustr(raw_data).encode('utf-8') try: self._send(raw_data) # Avoid printing messages that are empty keepalive packets. if raw_data.strip(): self.DEBUG(raw_data,'sent') self._owner.Dispatcher.Event('', DATA_SENT, raw_data) except: self.DEBUG("Socket error while sending data",'error') self._owner.disconnected() def pending_data(self,timeout=0): """ Returns true if there is a data ready to be read. """ return select.select([self._sock],[],[],timeout)[0] def disconnect(self): """ Closes the socket. """ self.DEBUG("Closing socket",'stop') self._sock.close() def disconnected(self): """ Called when a Network Error or disconnection occurs. Designed to be overidden. """ self.DEBUG("Socket operation failed",'error') DBG_CONNECT_PROXY='CONNECTproxy' class HTTPPROXYsocket(TCPsocket): """ HTTP (CONNECT) proxy connection class. Uses TCPsocket as the base class redefines only connect method. Allows to use HTTP proxies like squid with (optionally) simple authentication (using login and password). """ def __init__(self,proxy,server,use_srv=True): """ Caches proxy and target addresses. 'proxy' argument is a dictionary with mandatory keys 'host' and 'port' (proxy address) and optional keys 'user' and 'password' to use for authentication. 'server' argument is a tuple of host and port - just like TCPsocket uses. """ TCPsocket.__init__(self,server,use_srv) self.DBG_LINE=DBG_CONNECT_PROXY self._proxy=proxy def plugin(self, owner): """ Starts connection. Used interally. Returns non-empty string on success.""" owner.debug_flags.append(DBG_CONNECT_PROXY) return TCPsocket.plugin(self,owner) def connect(self,dupe=None): """ Starts connection. Connects to proxy, supplies login and password to it (if were specified while creating instance). Instructs proxy to make connection to the target server. Returns non-empty sting on success. """ if not TCPsocket.connect(self,(self._proxy['host'],self._proxy['port'])): return self.DEBUG("Proxy server contacted, performing authentification",'start') connector = ['CONNECT %s:%s HTTP/1.0'%self._server, 'Proxy-Connection: Keep-Alive', 'Pragma: no-cache', 'Host: %s:%s'%self._server, 'User-Agent: HTTPPROXYsocket/v0.1'] if self._proxy.has_key('user') and self._proxy.has_key('password'): credentials = '%s:%s'%(self._proxy['user'],self._proxy['password']) credentials = base64.encodestring(credentials).strip() connector.append('Proxy-Authorization: Basic '+credentials) connector.append('\r\n') self.send('\r\n'.join(connector)) try: reply = self.receive().replace('\r','') except IOError: self.DEBUG('Proxy suddenly disconnected','error') self._owner.disconnected() return try: proto,code,desc=reply.split('\n')[0].split(' ',2) except: raise error('Invalid proxy reply') if code<>'200': self.DEBUG('Invalid proxy reply: %s %s %s'%(proto,code,desc),'error') self._owner.disconnected() return while reply.find('\n\n') == -1: try: reply += self.receive().replace('\r','') except IOError: self.DEBUG('Proxy suddenly disconnected','error') self._owner.disconnected() return self.DEBUG("Authentification successfull. Jabber server contacted.",'ok') return 'ok' def DEBUG(self,text,severity): """Overwrites DEBUG tag to allow debug output be presented as "CONNECTproxy".""" return self._owner.DEBUG(DBG_CONNECT_PROXY,text,severity) class TLS(PlugIn): """ TLS connection used to encrypts already estabilished tcp connection.""" def PlugIn(self,owner,now=0): """ If the 'now' argument is true then starts using encryption immidiatedly. If 'now' in false then starts encryption as soon as TLS feature is declared by the server (if it were already declared - it is ok). """ if owner.__dict__.has_key('TLS'): return # Already enabled. PlugIn.PlugIn(self,owner) DBG_LINE='TLS' if now: return self._startSSL() if self._owner.Dispatcher.Stream.features: try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) except NodeProcessed: pass else: self._owner.RegisterHandlerOnce('features',self.FeaturesHandler,xmlns=NS_STREAMS) self.starttls=None def plugout(self,now=0): """ Unregisters TLS handler's from owner's dispatcher. Take note that encription can not be stopped once started. You can only break the connection and start over.""" self._owner.UnregisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) self._owner.UnregisterHandler('proceed',self.StartTLSHandler,xmlns=NS_TLS) self._owner.UnregisterHandler('failure',self.StartTLSHandler,xmlns=NS_TLS) def FeaturesHandler(self, conn, feats): """ Used to analyse server tag for TLS support. If TLS is supported starts the encryption negotiation. Used internally""" if not feats.getTag('starttls',namespace=NS_TLS): self.DEBUG("TLS unsupported by remote server.",'warn') return self.DEBUG("TLS supported by remote server. Requesting TLS start.",'ok') self._owner.RegisterHandlerOnce('proceed',self.StartTLSHandler,xmlns=NS_TLS) self._owner.RegisterHandlerOnce('failure',self.StartTLSHandler,xmlns=NS_TLS) self._owner.Connection.send(''%NS_TLS) raise NodeProcessed def pending_data(self,timeout=0): """ Returns true if there possible is a data ready to be read. """ return self._tcpsock._seen_data or select.select([self._tcpsock._sock],[],[],timeout)[0] def _startSSL(self): """ Immidiatedly switch socket to TLS mode. Used internally.""" """ Here we should switch pending_data to hint mode.""" tcpsock=self._owner.Connection tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None) tcpsock._sslIssuer = tcpsock._sslObj.issuer() tcpsock._sslServer = tcpsock._sslObj.server() tcpsock._recv = tcpsock._sslObj.read tcpsock._send = tcpsock._sslObj.write tcpsock._seen_data=1 self._tcpsock=tcpsock tcpsock.pending_data=self.pending_data tcpsock._sock.setblocking(0) self.starttls='success' def StartTLSHandler(self, conn, starttls): """ Handle server reply if TLS is allowed to process. Behaves accordingly. Used internally.""" if starttls.getNamespace()<>NS_TLS: return self.starttls=starttls.getName() if self.starttls=='failure': self.DEBUG("Got starttls response: "+self.starttls,'error') return self.DEBUG("Got starttls proceed response. Switching to TLS/SSL...",'ok') self._startSSL() self._owner.Dispatcher.PlugOut() dispatcher.Dispatcher().PlugIn(self._owner) xmpppy-0.4.1/ChangeLog0000644000175000000500000011374310731037347013474 0ustar normansrc2007-09-15 13:34 normanr * xmpp/transports.py: Clean up SSL errors a little bit 2007-09-11 14:46 normanr * xmpp/simplexml.py: Fixes for children node fetching, still not perfect, but much better 2007-08-28 12:03 normanr * xmpp/: auth.py, client.py: [ 1529650 ] Bug in auth, can't retry 2007-08-28 11:54 normanr * xmpp/commands.py: [ 1729857 ] typo in commands.py 2007-08-04 00:35 normanr * xmpp/client.py: Fix socket namespace conflict 2007-05-19 01:18 normanr * xmpp/: client.py, dispatcher.py, transports.py: More fixes - reconnectAndReauth now works for Client too 2007-05-19 00:43 normanr * xmpp/client.py: Fix PlugOut and reconnectAndReauth code execution order 2007-05-18 19:41 normanr * xmpp/simplexml.py: Ordering fix for when addChild and addData are used on the same node (may increase memory usage, might need to watch for that) 2007-05-13 19:55 normanr * xmpp/: jep0106.py, protocol.py: change jep references into xep 2007-05-13 19:55 normanr * xmpp/browser.py: Fix for non-ascii data in debug message 2007-04-09 22:23 normanr * xmpp/protocol.py: moving admin namespace constants from jep0133 to to protocol 2007-04-09 21:22 normanr * xmpp/protocol.py: updating namespace constants 2007-04-09 19:50 normanr * xmpp/protocol.py: add support for setting the DataField label in it's constructor 2007-03-20 08:00 snakeru * xmpp/simplexml.py: Fixed node attribute deletion with "del node[attr]" syntax. 2007-03-15 22:49 normanr * xmpp/client.py: Handle XCP component:accept namespace 2006-10-06 14:30 normanr * doc/examples/: bot.py, xsend.py, xtalk.py: allow the bot to set a connection resource 2006-10-06 01:30 normanr * doc/index.html: missed a few links 2006-10-06 01:14 normanr * doc/index.html: updating documentation links 2006-10-06 00:25 normanr * setup.py: Debian updates for version 0.4 2006-10-03 22:03 normanr * xmpp/protocol.py: add some missing protocol namespaces 2006-09-27 00:12 normanr * doc/examples/xtalk.py: initial check-in 2006-09-27 00:12 normanr * doc/examples/xsend.py: tweaked login code to fail with reasons 2006-08-21 10:12 normanr * doc/examples/xsend.py: Ignore comment lines in config file 2006-08-21 10:11 normanr * xmpp/auth.py: Fixing auth splits 2006-06-03 15:53 normanr * xmpp/: auth.py, client.py, dispatcher.py: added support for wildfire component binding 2006-06-03 14:54 normanr * doc/examples/commandsbot.py, xmpp/commands.py: fixed command namespaces and basic circle area math 2006-06-03 14:36 normanr * doc/examples/commandsbot.py: added example command bot from Liorithiel 2006-06-03 14:32 normanr * xmpp/commands.py: fixes from Liorithiel 2006-06-03 14:22 normanr * xmpp/simplexml.py: added xmlns safety check 2006-06-03 14:15 normanr * xmpp/commands.py: fixed command namespaces 2006-05-30 21:55 normanr * doc/examples/xsend.py: General cleanups 2006-05-22 10:58 normanr * xmpp/transports.py: Fix for non-int ports 2006-05-18 07:53 snakeru * xmpp/simplexml.py: Added CDATA extracting method to xml node. 2006-05-15 01:57 normanr * xmpp/jep0106.py: moved jep-0106 into xmpp 2006-05-13 16:39 normanr * xmpp/commands.py: minor typos 2006-03-25 08:11 snakeru * xmpp/debug.py: Re-enabled debugging. 2006-03-25 08:01 snakeru * setup.py: Updated version stuff for xmpppy module. 2006-03-25 07:47 snakeru * xmpp/features.py: Fixed bug in disco items discovery (thanks Soren Roug). 2006-02-11 17:45 snakeru * xmpp/debug.py: Made NoDebug class usable 2006-02-11 17:37 snakeru * xmpp/client.py: fixed resources consumation in many places 2006-02-11 17:36 snakeru * xmpp/features.py: fixed features.register 2006-01-26 15:09 snakeru * xmpp/transports.py: Bugfix for previous commit 2006-01-26 15:06 snakeru * xmpp/: debug.py, transports.py: Made xmpppy to print warnings to stdout instead of stderr 2006-01-18 23:38 normanr * xmpp/: client.py, commands.py, debug.py, protocol.py: xmlns fixes, and minor tweaks for speed and safety 2006-01-18 21:26 normanr * xmpp/: auth.py, dispatcher.py: Namespace fixes 2006-01-10 00:08 normanr * xmpp/protocol.py: Message.buildReply fix for Gerard 2006-01-07 20:41 normanr * xmpp/protocol.py: Added message events, and minor DataForm fix 2006-01-02 21:40 normanr * xmpp/: auth.py, client.py, dispatcher.py, protocol.py: Jabberd2 component protocol support 2006-01-02 21:26 normanr * xmpp/debug.py: Enhanced debug output 2005-12-19 16:30 snakeru * xmpp/debug.py: Disabled color output on non-un*x-like platforms. 2005-12-11 20:54 normanr * xmpp/: client.py, transports.py: made failed connections slightly more robust. 2005-11-30 19:05 normanr * xmpp/auth.py: http://trac.gajim.org/ticket/1188 - fix for base64 encoded strings ending with an equals sign 2005-11-30 19:03 normanr * xmpp/commands.py: command nodes now return correct disco#info values 2005-11-22 07:20 snakeru * xmpp/auth.py: Fixed digest-uri parameter in SASL auth. Thanks to Le Boulanger Yann and Norman Rasmussen. 2005-10-31 08:15 snakeru * xmpp/protocol.py: Fixed timstamp detecting bug (thanks to Daryl Herzmann). 2005-10-26 10:45 snakeru * xmpp/auth.py: Fixed SASL bug on win32 platform. (Thanks to Martin Thomas) 2005-10-24 21:32 normanr * xmpp/: client.py, transports.py: [gajim]it is standarD not with T; thanks dkm 2005-10-22 23:47 normanr * xmpp/: client.py, debug.py, protocol.py: fixed whitespace 2005-10-08 01:17 normanr * xmpp/: browser.py, commands.py: fixes for discovery replies that gajim exposed 2005-10-01 19:53 snakeru * xmpp/: client.py, transports.py: Made SRV resolution disableable (Gajim patch 3658). 2005-10-01 19:51 snakeru * xmpp/client.py: Added catchment for exception while tls handshake (Gajim patch 3323). 2005-10-01 19:41 snakeru * xmpp/transports.py: Added events for sent/received bytes (Gajim patches 2789, 2979, 3254). 2005-10-01 19:40 snakeru * xmpp/session.py: Removed useless #!/usr/bin/python header (Gajim patch 2115) 2005-10-01 19:39 snakeru * xmpp/transports.py: Typo and debug line text fixes (Gajim patch 2113). 2005-10-01 19:36 snakeru * xmpp/protocol.py: Added method for retrieve nick value in MUC (Gajim patch 2089). 2005-10-01 19:34 snakeru * xmpp/TODO: Added several lines to TODO. 2005-10-01 17:03 snakeru * xmpp/client.py: Fixed binding process. Formatiing fixes. 2005-10-01 16:58 snakeru * xmpp/protocol.py: Fixed first timestamp detection 2005-09-30 23:34 mikealbon * xmpp/client.py: SASL Timeout, Gajim #2066 2005-09-30 23:28 mikealbon * xmpp/client.py: Enable SSL on non-standard port. Gajim #2065 2005-09-30 22:13 mikealbon * xmpp/features.py: Asynchronous In-band Registration. Gajim patches #2035 #2318 2005-09-29 23:38 mikealbon * xmpp/protocol.py: Bumper pack of namespace definitions. Including gajim #2637. 2005-09-28 09:20 snakeru * xmpp/client.py: Docstring fixes. Fixed typo in Client.connect method docstring (Thanks to Andrew Diederich). Evaluated more descriptions of Component.__init__ and Component.__connect__ . 2005-09-23 20:32 normanr * xmpp/: browser.py, client.py, commands.py: Fixes to make commands work, when you're working with multiple jids and nodes. 2005-09-20 22:56 normanr * xmpp/TODO: some todo items 2005-09-17 17:15 normanr * xmpp/protocol.py: tidied disco and muc namespaces 2005-09-17 17:13 normanr * xmpp/commands.py: fix for items being returned on non-items disco 2005-09-16 16:28 snakeru * xmpp/TODO: Added TODO line about roster parsing traceback. 2005-09-16 16:15 snakeru * xmpp/TODO: Added another todo line about input chunking. 2005-09-16 15:59 snakeru * xmpp/TODO: Added keepalive feature in TODO list. 2005-09-09 06:12 snakeru * doc/examples/xsend.py: Added help message to sample config file. 2005-09-06 00:04 mikealbon * xmpp/transports.py: Added SRV record resolution for new client connections. This is using gajim changesets (2036 2037 2039 2040 3184 3407 3408 3409 3410 3411 3412 3413) Debugging through debug needs to be fixed. 2005-08-28 23:50 normanr * xmpp/commands.py: fixes for error constants 2005-08-18 22:03 normanr * xmpp/dispatcher.py: Added support for non-fatal exception handling, exceptions can also be logged to file. 2005-08-06 06:48 snakeru * xmpp/session.py: Fixed usage of .T. and .NT. notation according to recent change. 2005-08-06 06:44 snakeru * xmpp/simplexml.py: WARNING! Incompartible change! Now newtag=n.T.newtag do not creates new tag but only returns existing one (if possible). If you need to create tag use either .NT. method or attribute set (i.e. n.T.newtag=something). 2005-08-05 06:57 snakeru * xmpp/features.py: The setPrivacyList function used a nonexistent payload variable where it should use the list parameter (thanks to Michal Politowski). 2005-07-13 15:22 snakeru * xmpp/roster.py: Docstring fix 2005-07-07 23:34 normanr * xmpp/commands.py: Commands now work. Errors are also returned if continuing an invalid session. 2005-06-02 14:22 snakeru * xmpp/client.py: Changed cl.connected from 'tls' to 'ssl' in case of port 5223/443. 2005-06-02 14:19 snakeru * xmpp/client.py: List of default ssl ports is now [5223,443]. 2005-05-28 11:30 mikealbon * xmpp/commands.py: Lots of bugfixes -- thanks Norman 2005-05-26 07:04 snakeru * xmpp/: auth.py, client.py: Another SASL case was broken. Fix applied, tested against variety of servers. 2005-05-24 15:59 snakeru * xmpp/auth.py: Removed early FeaturesHandler call to not start auth before credentials got passed. 2005-05-24 15:28 snakeru * xmpp/client.py: Added parameter to auth() to disable SASL 2005-05-12 11:20 snakeru * xmpp/TODO: Added note about TLS issue 2005-05-12 11:00 snakeru * xmpp/client.py: Added return value description to connect() docstring. 2005-05-12 09:35 snakeru * xmpp/transports.py: Fixed TLS-not-disconnects bug 2005-05-11 07:42 snakeru * xmpp/roster.py: Added comment about roster's NodeProcessed behaivoir. 2005-05-11 07:38 snakeru * xmpp/roster.py: Roster Iq handler must raise NodeProcessed. Otherwise, iq's will hit default handler and will be sent back. 2005-05-09 19:31 snakeru * doc/index.html: Made tags to not open new windows. 2005-05-09 19:27 snakeru * doc/xmpppy_title.png: New design. Big thanks to Marek Kubica for it. 2005-05-09 19:09 snakeru * doc/: index.html, xmpppy.css: New design. Big thanks to Marek Kubica for it. 2005-05-09 16:51 snakeru * xmpp/dispatcher.py: Bugfix: RegisterHandler(...,makefirst=1) didn't work. 2005-05-08 10:03 snakeru * setup.py: Changed download url from whole project to xmpppy module 2005-05-08 09:54 snakeru * setup.py: Add reminder to fix source code release version string while making release 2005-05-08 06:51 snakeru * xmpp/: client.py, dispatcher.py: Added possibility to detect broken servers that didn't restart stream after tls start and disable tls for them. 2005-05-07 18:24 snakeru * xmpp/transports.py: Fixed traceback while connecting via proxy 2005-05-07 18:14 snakeru * xmpp/protocol.py: Fixed stupid typo in DataForm 2005-05-07 05:26 snakeru * xmpp/dispatcher.py: Added non-locking SendAndCallForResponse method to ease life of realtime clients. 2005-05-07 04:42 snakeru * xmpp/auth.py: Auth was failing when server declares XMPP stream (version="1.0") but not supports SASL. 2005-05-06 19:33 snakeru * xmpp/protocol.py: Added missing MUC attributes helper. Added 'instructions' field to XData.asDict() 2005-05-02 10:38 snakeru * xmpp/roster.py: Formatting fix. 2005-05-02 10:36 snakeru * xmpp/: dispatcher.py, protocol.py: Added stream errors classes along with default handler 2005-04-30 12:17 snakeru * xmpp/: client.py, auth.py: Fixed Non-SASL auth brocken with one of today's commits. 2005-04-30 10:56 snakeru * xmpp/: dispatcher.py, transports.py: Bugfix: TLS mode was unable to handle big (>1024 bytes) chunks of data. Was forced to change TCPsocket.receive() return values logic. 2005-04-30 10:53 snakeru * xmpp/client.py: Fixed auth logic: if SASL failed - then auth definitely failed too. 2005-04-30 10:14 snakeru * xmpp/transports.py: Minor changes in receive() code in preparation to fix TLS bug. 2005-04-30 10:10 snakeru * xmpp/dispatcher.py: Added two docstrings 2005-04-30 09:43 snakeru * xmpp/features.py: Fixed getRegInfo to not crash on query's CDATA 2005-04-30 09:33 snakeru * xmpp/commands.py: Formatteed/added several docstrings 2005-04-30 09:20 snakeru * xmpp/simplexml.py: Cosmetic docstrings changes 2005-04-30 09:17 snakeru * xmpp/protocol.py: Added NS_COMMANDS, NS_ENCRYPTED, NS_SIGNED namespaces. Added MUC iq attributes functions from jabberpy. 2005-04-30 09:13 snakeru * xmpp/browser.py: Fixed RegisterHandler calls to catch only 'get' iqs. Fixed DiscoHandler to raise NodeProcessed (or we should just return instead?) 2005-04-30 09:01 snakeru * xmpp/: auth.py, transports.py: Fixed plugout methods to not take parameter 2005-04-10 10:25 snakeru * xmpp/TODO: TODO for 0.2 release 2005-04-10 10:21 snakeru * xmpp/simplexml.py: Reduced overload caused by extensive usage of T/NT classes. 2005-04-10 10:09 snakeru * xmpp/client.py: Added back possibility of manual specification of server type (for Component) for case if ejabberd team (or others) will add features to component streams. Changed default port for component connection to 5347 (jabberd2 router). 2005-04-10 09:55 snakeru * xmpp/client.py: Replaced manual server type specification with autodetect 2005-03-09 16:18 snakeru * doc/examples/logger.py: Added presences tracking 2005-03-09 10:32 snakeru * doc/examples/logger.py: Bugfix: proxy was specified incorrectly 2005-03-08 23:18 snakeru * doc/index.html: index.html 2005-03-08 23:14 snakeru * doc/examples/README.py: Moved to "examples". 2005-03-08 22:57 snakeru * doc/examples/logger.py: Conference logging bot example 2005-03-08 22:48 snakeru * Makefile: Installer Makefile 2005-03-08 21:50 snakeru * xmpp/commands.py: Tuned "import"s stuff to be more in-line with library 2005-03-08 21:36 snakeru * xmpp/: auth.py, client.py, dispatcher.py, protocol.py: Tweaked library to make it play nice as jabberd2 legacy component. 2005-03-08 18:15 snakeru * xmpp/simplexml.py: Some tweaks about determining if node needs 'xmlns' attribute. 2005-03-07 11:34 snakeru * xmpp/__init__.py: Added commands module import 2005-03-07 11:07 snakeru * xmpp/auth.py: Preserved handlers during auth process to allow early handlers registration. 2005-02-25 07:49 snakeru * xmpp/roster.py: Changed (c) date range 2005-02-25 07:48 snakeru * xmpp/roster.py: Fixed Iq callback brocken last commit 2005-02-25 07:35 snakeru * xmpp/roster.py: "raise NodeProcessed" removed to allow userspace catch roster changes too 2005-02-21 13:52 snakeru * xmpp/dispatcher.py: Added etherx namespace to the default set to allow stream errors handling. 2005-02-17 10:16 snakeru * xmpp/roster.py: Bugfix: presences should not really inherit meta-info (like etc) 2005-02-16 18:33 snakeru * xmpp/roster.py: Bugfix: UNbroke accidentally brocken code. Shame on me. 2005-02-16 18:29 snakeru * xmpp/auth.py: Bugfix: (NonSASL) Added removal of empty node to achieve JiveMessenger compartibility (Tnx Brian Tipton) 2005-02-07 20:38 snakeru * xmpp/roster.py: BugFix: Roster.PresenceHandler should not raise NodeProcessed exception. 2005-01-31 15:10 mikealbon * xmpp/commands.py: Modified the handlers used. Result messages are not required for command processor use. 2005-01-21 13:16 mikealbon * xmpp/commands.py: Initial version of commands processor 2005-01-16 22:18 snakeru * doc/examples/bot.py: Xmpppy-based bot example 2005-01-16 20:32 snakeru * doc/examples/xsend.py: Old servers compartibility stuff added. Tnx google, randomthoughts. 2005-01-04 07:17 snakeru * xmpp/session.py: Session class added 2004-12-26 10:54 snakeru * setup.py: python distutils install tool 2004-12-26 10:40 snakeru * README: README rewrited 2004-12-26 10:34 snakeru * doc/index.html: Some more updates 2004-12-26 10:12 snakeru * doc/: advanced.html, basic.html, index.html: Documentation updated: expert docs written, advanced started. 2004-12-26 09:39 snakeru * doc/expert.html: Removed since api documentation is maintained via docstrings. 2004-12-25 22:06 snakeru * xmpp/: __init__.py, dispatcher.py, features.py, filetransfer.py, roster.py, transports.py: Added and/or modifyed docstrings. Now every method in library is documented\! Hurray\! 2004-12-24 21:56 snakeru * xmpp/: browser.py, protocol.py: Pydoc strings added 2004-12-23 22:11 snakeru * xmpp/: __init__.py, auth.py, client.py, dispatcher.py, simplexml.py: Docstrings merged. Most of them were ready already in (shame!) july. 2004-12-09 17:08 snakeru * xmpp/dispatcher.py: Bugfix: complete autodetection of default handler's namespace 2004-12-09 17:06 snakeru * xmpp/dispatcher.py: More wisdom for default handler's namespace determining 2004-12-09 16:34 snakeru * xmpp/dispatcher.py: Added some wisdom to determining of default handler's namespace. 2004-12-09 16:21 snakeru * xmpp/: auth.py, client.py, protocol.py: Fixed component auth that was brocken by dispatcher's changes. 2004-12-06 16:49 snakeru * xmpp/browser.py: Bugfix: typo in _DiscoveryHandler (thanks 2 Mike Albon) 2004-10-23 09:58 snakeru * xmpp/protocol.py: NS_DIALBACK added JID's node and domain now stored only lowercase Bugfix: don't allow empty type to go into error node Do not serialise error reply to error stanza (prevent error bouncing) 2004-10-23 09:53 snakeru * xmpp/dispatcher.py: "chained" handlers killed changing type of incomed stanza only if it is a simple Node (to allow pickling) 2004-10-23 09:51 snakeru * xmpp/auth.py: Bugfix: auth details should go into self._owner 2004-10-08 21:10 snakeru * xmpp/auth.py: Ensure that username and resourcename got from server's responce. 2004-10-08 21:06 snakeru * xmpp/dispatcher.py: Now stanza properties stored in it's attribute "props". 2004-10-08 21:01 snakeru * xmpp/features.py: Bugfix: don't traceback if DISCO/Browse timed out. 2004-09-25 21:05 snakeru * xmpp/simplexml.py: Rolled back ns vocabularies. They were potentially messing namespaces. 2004-09-25 20:52 snakeru * xmpp/simplexml.py: Allowed attribute values to be objects 2004-09-25 20:50 snakeru * xmpp/protocol.py: XMPP streams namespace added. One more XMPP stanza error condition added: Error conditions now differs by name: STREAM_, ERR_ and SASL_. Attribute 'to' and 'from' in protocol instances now JIDs - not strings. Added namespace to Protocol element's __init__s. Changed error forming process to involve correct namespace setting. 2004-09-25 20:46 snakeru * xmpp/dispatcher.py: Namespace handler now comes under the name "default". 2004-09-19 22:05 snakeru * xmpp/client.py: Plugging in now available only once. Now using SASL.auth() method instead of SASL() 2004-09-19 14:34 snakeru * xmpp/dispatcher.py: Added plugout method for proper destuction of Stream instance. Added RegisterNamespace method for registering default handlers for ns. Made UnregisterHandler immune to unregistering absent handler. 2004-09-19 14:31 snakeru * xmpp/simplexml.py: added destroy method to NodeBuilder to prevent memory leak 2004-09-19 14:28 snakeru * xmpp/transports.py: Added plugout method to TLS class for unregistering handlers. Added raising NodeProcessed in TLS handler according to dispatcher's architecture. 2004-09-19 14:19 snakeru * xmpp/protocol.py: Added SASL error conditions 2004-09-19 13:49 snakeru * xmpp/auth.py: SASL.auth method added. Removed credentials passing from PlugIn. plugout methods added for unregistering handlers. NodeProcessed exceptions now raised according to dispatcher architecture. 2004-09-17 21:28 snakeru * xmpp/: auth.py, dispatcher.py, transports.py: Added stanzas namespace support in dispatcher. 2004-09-17 21:22 snakeru * xmpp/protocol.py: Added xmpp streams namespace. Made stream-level error conditions render in proper xmlns. Removed error text backward compartibility positioning. 2004-09-17 21:19 snakeru * xmpp/simplexml.py: XML namespaces vocabulary introduced. Quick node access methods introduced. 2004-09-15 20:35 snakeru * xmpp/simplexml.py: Bugfix: more delicate namespaces processing. Slow (again) but sure. Bugfix: stream-level CDATA processing. Feature: stream open/close events system. 2004-09-15 20:30 snakeru * xmpp/transports.py: Fixed comment. 2004-09-15 20:22 snakeru * xmpp/roster.py: Bugfix: handle roster item deletion properly. Translated comment into english. 2004-09-15 20:19 snakeru * xmpp/protocol.py: Added 'jabber:client' and 'jabber:server' namespaces. 2004-09-15 16:57 snakeru * xmpp/filetransfer.py: Comments translated to english. 2004-09-15 16:51 snakeru * xmpp/dispatcher.py: Added sessions support. 2004-09-15 05:18 snakeru * xmpp/ietf-docs/draft-ietf-xmpp-core.html: Update to revision 24. 2004-09-13 12:32 snakeru * doc/examples/xsend.py: Fixed typo: SendInitialPresence => SendInitPresence. 2004-08-04 20:41 snakeru * xmpp/__init__.py: IBB is fixed and worth inclusion. 2004-08-04 20:39 snakeru * xmpp/__init__.py: IBB stuff is fixed and worth inclusion. 2004-08-04 20:30 snakeru * xmpp/: __init__.py, features.py, protocol.py: Stable 0.1 will not include browser and new DataForm class. 2004-08-04 19:35 snakeru * xmpp/: client.py, filetransfer.py: Fixed and tested IBB. Added usual debugging stuff to it. 2004-08-04 19:32 snakeru * xmpp/dispatcher.py: Bugfix: typeless stanzas were processed several times sometimes. 2004-08-04 19:26 snakeru * doc/basic.html: Corrections to text donated by Mike Albon. 2004-07-26 15:00 snakeru * xmpp/simplexml.py: Bugfix: nodebuilder was tracing on the first node. 2004-07-23 14:34 snakeru * xmpp/protocol.py: Added getQueryChildren method. WARNING: it behaves gust like getQueryPayload before. And the getQueryPayload is now different! 2004-07-23 14:31 snakeru * xmpp/simplexml.py: Made getPayload to return both CDATA and child nodes just like setPayload uses. 2004-07-23 14:27 snakeru * xmpp/simplexml.py: Fixed bug in CDATA handling code. The data will not be shifted between tags anymore. 2004-07-12 21:20 snakeru * xmpp/: features.py, protocol.py: DataForm class re-implemented to conform JEP-0004 more closely. 2004-07-11 21:32 snakeru * xmpp/protocol.py: Added support for multiple values. Bugfix: label is an option's property - not DataField's. 2004-07-11 21:01 snakeru * xmpp/protocol.py: Added import of ustr function from simplexml module. Bugfix: jid comparsion made less vulnerable to type mismatches. Added JID.__hash__ method. 2004-07-11 21:00 snakeru * xmpp/browser.py: Added support for several hosts on one connection. Argument Handler in setDiscoHandler converted to lowercase. 2004-06-30 05:30 snakeru * xmpp/browser.py: Added support for nodes like "http://jabber.org/protocol/commands". 2004-06-28 20:58 snakeru * xmpp/protocol.py: Added DataField class in preparation to DataForm rewrite. 2004-06-28 13:55 snakeru * xmpp/roster.py: Added raising NodeProcessed exception to mark already processed iq and presences. 2004-06-28 07:38 snakeru * xmpp/simplexml.py: Added Node.has_attr 2004-06-27 21:10 snakeru * xmpp/dispatcher.py: Bugfix: the returnStanzaHandler must not return error stanzas. 2004-06-27 20:24 snakeru * xmpp/: __init__.py, browser.py: Browser module tested, fixed and included into library structure. 2004-06-27 18:00 snakeru * xmpp/browser.py: Hand-crafted and logically debugged the heart - _traversePath. Now need to check other methods. 2004-06-27 15:30 snakeru * xmpp/: dispatcher.py, features.py, filetransfer.py, protocol.py: NodeProcessed mechaniks fixed: class moved to protocol module. try: except: block fixed to catch all needed exceptions. Default handler mechanics fixed. returnStanzaHandler moved from features to dispatcher. It will be default handler in 0.2. Dispatcher.UnregisterHandler fixed. 2004-06-27 15:03 snakeru * xmpp/protocol.py: Iq.buildReply made to appropriate set the queryNS value. Error text message now included in error body tag for compartibility with older protocol. 2004-06-26 10:26 snakeru * xmpp/dispatcher.py: Bugfix: already dispatched node must not be changed anymore by NodeBuilder. 2004-06-26 10:24 snakeru * xmpp/client.py: Bugfix: TLS failed to restart after disconnect. 2004-06-26 10:20 snakeru * xmpp/roster.py: Namespace declarations moved to protocol module. Protocol module imported to the local namespace. Bugfix: item deletion required Node class in local namespace. 2004-06-26 06:42 snakeru * xmpp/: auth.py, client.py, dispatcher.py, features.py, filetransfer.py, protocol.py, transports.py: All namespaces declarations moved to protocol module. Introduced politics of direct protocol module importing. 2004-06-26 06:14 snakeru * xmpp/__init__.py: Added direct import from protocol module. 2004-06-23 14:48 snakeru * xmpp/protocol.py: Added getQuerynode and setQuerynode methods. 2004-06-20 20:36 snakeru * doc/index.html: Hope that Mike will never see it. I am so ashamed... 2004-06-20 20:30 snakeru * doc/: advanced.html, expert.html: Empty file. 2004-06-20 20:29 snakeru * doc/basic.html: Unformatted but finished at the first look. 2004-06-20 20:28 snakeru * doc/index.html: Added links to documentation and Mike Albon's IRC transport. 2004-06-20 20:16 snakeru * xmpp/simplexml.py: Bugfix: use " to not corrupt XML on some attribute values. 2004-06-20 11:45 snakeru * doc/examples/xsend.py: Example script that is used in "simple" doc. 2004-06-20 10:39 snakeru * README: First documentation appeared. Added notice about official Debian's packages. 2004-06-18 05:40 snakeru * doc/basic.html: Some more bits. 2004-06-18 05:02 snakeru * doc/basic.html: Started attempt to write a docs for library. 2004-06-17 17:57 snakeru * xmpp/protocol.py: Bugfix: tag.getError() will not issue a traceback anymore if there is no error (thanks to sneakin). 2004-06-17 17:13 snakeru * xmpp/simplexml.py: Bugfix: bits like xml:lang='en' was processed incorrectly. ** This is a very crude hack. I must think more on this. 2004-06-03 15:25 snakeru * xmpp/: protocol.py, roster.py: Fixed bug with "@" and "/" characters in the resource string. 2004-06-03 14:38 snakeru * xmpp/simplexml.py: Bugfix: addChild now set's child.parent properly. 2004-05-28 20:08 snakeru * README: Some unimportant corrections. 2004-05-28 20:02 snakeru * README: Added "normal" README. 2004-05-25 12:46 snakeru * xmpp/roster.py: getRoster , getItem methods added 2004-05-25 12:46 snakeru * xmpp/client.py: getRoster method added. 2004-05-20 13:56 snakeru * xmpp/protocol.py: Fixed backtrace on unhandled condition case. 2004-05-20 09:09 snakeru * xmpp/: client.py, debug.py: Bugfix: debug_flags was in "debug" module namespace instead of being Debug class attribute. 2004-05-17 21:25 snakeru * xmpp/protocol.py: JID.__ne__ method added. 2004-05-17 15:30 snakeru * xmpp/client.py: DeregisterDisconnectHandler renamed to UnregisterDisconnectHandler. 2004-05-17 11:32 snakeru * xmpp/__init__.py: Added NS_XXX importing into module's namespace. 2004-05-14 07:40 snakeru * xmpp/roster.py: Added getItems, keys and __getitem__ methods (limited mapping interface). Bugfix: setItem used incorrect XML. Self contact corrected to have all (though dummy) parameters. 2004-05-05 08:34 snakeru * xmpp/: auth.py, client.py: Removed "#!/usr/bin/python" headers to please lintian. 2004-05-04 10:28 snakeru * xmpp/: auth.py, client.py, dispatcher.py, features.py, protocol.py: Changed all "type" in functions arguments to "typ" . WARNING: VERY INCOMPARTIBLE CHANGES! This is one more step away from jabberpy API. 2004-05-04 09:58 snakeru * xmpp/filetransfer.py: Very preliminary. It worked recently but poorly and may be broken already. 2004-05-04 09:54 snakeru * xmpp/: features.py, protocol.py: Protocol.Error syntax changed. WARNING: incompartible changes. 2004-05-03 18:57 snakeru * xmpp/: features.py, protocol.py: Error nodes creating and setting made more (I hope) intuitive. WARNING: uncompartible changes. 2004-05-03 07:33 snakeru * xmpp/protocol.py: Python 2.1 compartibility in Protocol.__init__. Bugfix: Protocol element properties is child's namespaces - w/o dependency of parent node namespace. 2004-05-03 07:29 snakeru * xmpp/simplexml.py: Bugfix: preserve namespace when cloning node. Bugfix: fixed traceback in NodeBuilder on non-Node object upgrading. 2004-05-02 20:23 snakeru * xmpp/: auth.py, client.py, dispatcher.py, roster.py, transports.py: Implemented common plugins framework. 2004-04-29 21:21 snakeru * xmpp/simplexml.py: Node cloning improved. Full cloning mode introduced. NodeBuilder can now take initial node as the base for building. 2004-04-29 21:14 snakeru * xmpp/protocol.py: Message.buildReply and Iq.buildReply introduced. 2004-04-29 21:10 snakeru * xmpp/dispatcher.py: Events introduced. Cycle (null) handlers introduced. 2004-04-29 21:06 snakeru * xmpp/client.py: Default resource name "xmpppy" now used only when auth with non-xmpp compliant jabberd server. In the other cases it uses server-provided resource name. 2004-04-29 20:53 snakeru * xmpp/protocol.py: DataForm now can use prototype node for initialisation (as other protocol elements). DataForm: workaround for broken jabberd1.4 added to handle double tag. DataForm mapping methods added. 2004-04-29 20:46 snakeru * xmpp/features.py: 'jid' replaced by 'host' in registration methods. Documentation added to registration methods. BugTypo: 'res' instead of 'resp' Bugfix: DataForm doesn't take nodename as parameter. 2004-04-26 21:27 snakeru * xmpp/ietf-docs/: draft-ietf-xmpp-core.html, draft-ietf-xmpp-im.html: Update to current upstream version. 2004-04-25 07:12 snakeru * xmpp/: auth.py, client.py, dispatcher.py, features.py, simplexml.py, transports.py: Date extended in license text. 2004-04-25 07:07 snakeru * xmpp/protocol.py: Date extended in license text. Empty node removed from error stanza. 2004-04-18 11:12 snakeru * xmpp/dispatcher.py: Added "default handler" mechanizm. "Process" function documented. 2004-04-18 11:09 snakeru * xmpp/features.py: returnStanzaHandler added. 2004-04-18 11:06 snakeru * xmpp/protocol.py: Added translation of error codes to error conditions. Default error condition changed to 2004-04-18 08:24 snakeru * xmpp/protocol.py: XMPP-Core stanza and stream level errors support added. 2004-04-18 06:36 snakeru * xmpp/: auth.py, features.py, protocol.py: Function "resultNode" replaced by "isResultNode". Function "errorNode" replaced by "isErrorNode". 2004-03-25 18:25 snakeru * xmpp/: dispatcher.py, protocol.py: Changed dispatching policy: check for ALL child namespaces - not for only first in Iq stanza. 2004-03-25 18:24 snakeru * xmpp/client.py: Cleanup: import of features no more needed. 2004-03-11 07:49 snakeru * xmpp/simplexml.py: All character data is now *STORED* in utf-8 not only printed. Bugfix: fancy output was incorrect on data output of child nodes. 2004-03-03 18:03 snakeru * doc/index.html: Web page xmpppy.sf.net 2004-02-24 08:20 snakeru * xmpp/dispatcher.py: Added "NodeProcessed" mechanism to allow handlers stop further stanza processing. 2004-02-20 14:16 snakeru * xmpp/__init__.py: Added revision control comment line. 2004-02-14 12:16 snakeru * xmpp/: dispatcher.py, transports.py: Added experimental support for live reconnection. 2004-02-14 12:11 snakeru * xmpp/client.py: Bugfix: Client.connect doesn't always returned true when connection estabilished. Added experimental support for live reconnection. 2004-02-11 21:27 snakeru * xmpp/client.py: Made tests like isConnected()[4:] possible. 2004-02-11 21:24 snakeru * xmpp/: client.py, transports.py: Made isConnected return more meningful result (tcp|tls+old_auth|sasl) 2004-02-11 21:02 snakeru * xmpp/client.py: Added isConnected method. 2004-02-11 15:53 snakeru * xmpp/: auth.py, client.py, dispatcher.py, transports.py: Fix: Previous client.py commit broke jabberd2-compartible mechanisms. 2004-02-10 19:25 snakeru * xmpp/client.py: Bugfix: Component used 'client' string in debug output. Common stuff abstracted from Client and Component to CommonClient class. Client.connect and Component.connect methods merged to new method: CommonClient.connect. 2004-02-10 19:16 snakeru * xmpp/auth.py: Fixed error text saying that we can do only PLAIN authentication. 2004-02-09 10:05 snakeru * xmpp/: auth.py, client.py: connect() and auth() methods now returns result of operation. 2004-02-09 10:03 snakeru * xmpp/transports.py: PlugIn methods now returns results of connection. connect() method doesn't call 'disconnected' on failed connect. 2004-02-09 10:01 snakeru * xmpp/simplexml.py: Changes in "fancy" node output. Even more CDATA corruption ;) 2004-01-26 08:30 snakeru * xmpp/__init__.py: Simple import of all modules. 2004-01-26 08:25 snakeru * xmpp/client.py: Bugfix: non-sasl auth was not recognized. 2004-01-20 10:51 snakeru * xmpp/protocol.py: JID.getStripped now returns lower case JID (questionable change). DataForm now represents itself as tag. 2004-01-20 10:49 snakeru * xmpp/client.py: Added (again) default port for component class. Disconnect method copied from client to component class. 2004-01-20 10:46 snakeru * xmpp/features.py: Bugfixes in privacy lists mangling stuff. 2004-01-15 11:58 snakeru * xmpp/transports.py: Maked early start of TLS when connecting to port 5223 possible. 2004-01-15 11:57 snakeru * xmpp/client.py: Bugfix: SASL authentication must be completed before resource binding. Added TLS early start when connecting to port 5223. 2004-01-12 10:35 snakeru * xmpp/client.py: Made TLS and SASL use more flexible to work with ejabberd server. 2004-01-12 10:32 snakeru * xmpp/auth.py: Added "any time" SASL auth status. 2004-01-12 10:31 snakeru * xmpp/simplexml.py: Added fancy XML formatting (indents and newlines). 2004-01-12 08:40 snakeru * xmpp/auth.py: Maked use of Dispatcher's features tag caching. Fixed issues with values quoting in ejabberd's challenge response. 2004-01-12 08:34 snakeru * xmpp/: dispatcher.py, transports.py: Maked dispatcher to cache features tag. 2004-01-10 09:35 snakeru * xmpp/protocol.py: Fixed case-handling in JIDs comparsions 2004-01-09 09:14 snakeru * xmpp/protocol.py: Added comparsion methods. 2004-01-08 20:10 snakeru * xmpp/auth.py: Maked use of resultNode and errorNode service functions. Added component:accept authentication. 2004-01-08 20:08 snakeru * xmpp/client.py: Bugfixes: replaced "m" with "self" in many cases in Client code. Bugfix: Fixed client TLS init to start only if server supports. Added Component code. Cleaned up tetsing stuff in the end of file. 2004-01-08 19:58 snakeru * xmpp/dispatcher.py: Changed WaitForResponse to always return received Node if it were really received. Maked send to stamp not only "ID" field on outgoung stanzas nor also a "from" filed. 2004-01-08 19:56 snakeru * xmpp/features.py: Maked use of errorNode and resultNode conditional functions. 2004-01-08 19:54 snakeru * xmpp/protocol.py: Two conditional service functions added: errorNode and resultNode. 2004-01-08 08:17 snakeru * xmpp/simplexml.py: payload again can be of non-[] non-() type. Optimised adding child node when child already ready. 2004-01-07 11:41 snakeru * xmpp/: features.py, protocol.py: Syntactic changes and bugfixes in protocol.DataForm. 2004-01-07 11:40 snakeru * xmpp/simplexml.py: Bugfix: tag.getTags were broken. 2003-12-15 17:04 snakeru * xmpp/auth.py: Fixed incompartibilityes with jabberd2 in MD5-DIGEST algorythm. 2003-12-14 21:32 snakeru * xmpp/: auth.py, browser.py, client.py, dispatcher.py, features.py, protocol.py, roster.py, simplexml.py, transports.py: Tuned SASL (though it still not working), maked it to restart Dispatcher after auth. Added bind (though it also not working on my server). Added features import. Added jabber:x:data handling into protocol. Added roster control methods into roster. 2003-12-14 21:13 snakeru * xmpp/features.py: Service/agents discovery, [un]registration and password change, privacy lists handling. 2003-12-14 21:11 snakeru * xmpp/features.py: This file prevents main branch from adding the same file. 2003-12-14 20:41 snakeru * xmpp/features.py: Initial revision 2003-12-14 20:41 snakeru * xmpp/: auth.py, client.py, dispatcher.py, features.py, protocol.py, roster.py, simplexml.py: Added service discovery, [un]registration, privacy lists handling. 2003-12-13 10:30 snakeru * xmpp/: auth.py, client.py, simplexml.py: Added and tested SASL PLAIN. Added and tested SASL DIGEST-MD5. Though it works only on test example from RFC2831 :( Added SASL test code to client. 2003-12-12 21:28 snakeru * xmpp/: auth.py, browser.py, client.py, debug.py, dispatcher.py, protocol.py, roster.py, simplexml.py, transports.py, ietf-docs/draft-ietf-xmpp-core.html, ietf-docs/draft-ietf-xmpp-im.html: Initial revision 2003-12-12 21:28 snakeru * xmpp/: auth.py, browser.py, client.py, debug.py, dispatcher.py, protocol.py, roster.py, simplexml.py, transports.py, ietf-docs/draft-ietf-xmpp-core.html, ietf-docs/draft-ietf-xmpp-im.html: Working items: roster, events mechanism, starttls, Non-SASL authorization. xmpppy-0.4.1/Makefile0000644000175000000500000000034710213407633013347 0ustar normansrc #MODULESDIR=/usr/lib/($PYTHONVERSION)/site-packages install: # Add here commands to install the package into debian/python-xmpp [ -d $(MODULESDIR)/xmpp ] || mkdir $(MODULESDIR)/xmpp install -m 0644 xmpp/*py $(MODULESDIR)/xmpp xmpppy-0.4.1/MANIFEST0000644000175000000500000000043510511303633013032 0ustar normansrcREADME setup.py Makefile ChangeLog xmpp/__init__.py xmpp/auth.py xmpp/browser.py xmpp/client.py xmpp/commands.py xmpp/debug.py xmpp/dispatcher.py xmpp/features.py xmpp/filetransfer.py xmpp/jep0106.py xmpp/protocol.py xmpp/roster.py xmpp/session.py xmpp/simplexml.py xmpp/transports.py xmpppy-0.4.1/README0000644000175000000500000000411310163474375012575 0ustar normansrc Introduction to xmpppy. http://xmpppy.sf.net/ This is my work to replace the jabberpy with the current and maintained project. Now the project nears feature freese of 0.2 branch. Almost all goals are achieved already. Though the main goal was to write a documentation - at least a line for every feature of library. Yesterday I have checked in last docstrings for all yet undocumented modules and now I can say that this issue is resolved (at least for 0.2 release level). Documentation exists in three formats. - The first is the examples that I wrote to show xmpppy in action. This is two simple scripts - README.py and xsend.py. - The second is the html pages where I try to describe the idea of library and the ways the goals are achieved. - Third is the docstrings. I am currently using epydoc but other tools should work too (at least the pydoc works) Installation If you are using Debian (sarge or above) you can simply run apt-get install python-xmpp and you will get the current stable release of xmpppy installed. After installation you can do 'import xmpp'. Though currently debian contains 0.1 release of xmpppy so if you want to use 0.2 branch you should install it manually (python2.3 required). Here you have several options: - run 'python setup.py install' from xmpppy distribution as root. All should work nice. - if you don't like python installator - just copy xmpp directory into python's site-packages directory (this is what setup.py does). - If you have no intention to install library system-wide (or just have no privileges to do it) you can copy xmpp directory just in your application's directory. Example: myxmpppytry/ xmpp/ ...xmpppy modules test.py If you have any questions about xmpppy usage or you have find a bug or want to share some ideas - you are welcome in xmpppy-devel maillist - see http://lists.sourceforge.net/lists/listinfo/xmpppy-devel for details of subscription. 2004.12.26 Alexey Nezhdanov xmpppy-0.4.1/setup.py0000755000175000000500000000264610731031757013435 0ustar normansrc#!/usr/bin/python # -*- coding: koi8-r -*- from distutils.core import setup,sys import os if sys.version < '2.2.3': from distutils.dist import DistributionMetadata DistributionMetadata.classifiers = None DistributionMetadata.download_url = None # Set proper release version in source code also!!! setup(name='xmpppy', version='0.4.1', author='Norman Rasmussen', author_email='normanr@users.sourceforge.net', url='http://xmpppy.sourceforge.net/', description='XMPP-IM-compliant library for jabber instant messenging.', long_description="""This library provides functionality for writing xmpp-compliant clients, servers and/or components/transports. It was initially designed as a \"rework\" of the jabberpy library but has become a separate product. Unlike jabberpy it is distributed under the terms of GPL.""", download_url='http://sourceforge.net/project/showfiles.php?group_id=97081&package_id=103821', packages=['xmpp'], license="GPL", platforms="All", keywords=['jabber','xmpp'], classifiers = [ 'Topic :: Communications :: Chat', 'License :: OSI Approved :: GNU General Public License (GPL)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Natural Language :: English', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', ], )