Commit graph

609 commits

Author SHA1 Message Date
Lance Stout
004eabf809 Update plugins that use Iq stanzas to work with new exceptions. 2011-08-17 21:30:47 -07:00
Lance Stout
62230fc970 Return '' instead of None from form fields with no values. 2011-08-17 21:22:03 -07:00
Lance Stout
9fdd85d9f1 I've seen people complain about Sleek taking so long to disconnect.
Added logging to say that we're waiting for the server to end the stream
from its end.
2011-08-13 08:58:07 -07:00
Lance Stout
331db30f8f Add form.field back in for backwards compatibility. 2011-08-13 08:34:23 -07:00
Lance Stout
017d7ec62b Add tests for setting a form's type to 'submit' or 'cancel'.
Form fields now remember their current type if the type is deleted. This
allows for fields to properly format their values if set after the form
has been changed to the 'submit' type.
2011-08-13 01:28:18 -07:00
Lance Stout
c26b716164 Update XEP-0050 to use new IQ exceptions.
IqError is now caught and forwarded to the command error handler referenced
in the session.

Errors are now caught and processed by the session's error handler
whether or not the results Iq stanza includes the <command> substanza.

Added the option for blocking command calls. The blocking option is set
during start_command with block=True. Subsequent command flow methods use
session['block'] to determine their blocking behaviour.

If you use blocking commands, then you will need to wrap your command calls
in a try/except block for IqTimeout exceptions.
2011-08-13 00:10:06 -07:00
Lance Stout
bd427849fb Reduce the maximum delay between connection retries to 10min. 2011-08-12 17:17:05 -07:00
Lance Stout
484efff156 Merge branch 'develop' into roster
Conflicts:
	setup.py
	sleekxmpp/clientxmpp.py
2011-08-12 16:47:58 -07:00
Nathan Fritz
8f1d0e7a79 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-12 16:36:03 -07:00
Nathan Fritz
88184ff955 fixed indenting and merged in exceptions branch 2011-08-12 16:35:36 -07:00
Nathan Fritz
bd8c110f00 Merge branch 'exceptions' into develop 2011-08-12 16:35:15 -07:00
Nathan Fritz
0050c51124 updated pubsub plugin to use stanzas 2011-08-12 16:32:09 -07:00
Lance Stout
9b7ed73f95 Reorganize XEP-0004.
Changes:
    May now use underscored method names
    form.field is replaced by form['fields']
    form.get_fields no longer accepts use_dict parameter, it always
        returns an OrderedDict now
    form.set_fields will accept either an OrderedDict, or a list
        of (var, dict) tuples as before.
    Setting the form type to 'submit' will remove extra meta data
        from the form fields, leaving just the 'var' and 'value'
    Setting the form type to 'cancel' will remove all fields.
2011-08-11 21:59:55 -07:00
Lance Stout
156b3200e3 Don't include ping stanza in the ping result. 2011-08-10 09:05:43 -07:00
Lance Stout
572becad44 Enable forcing a specififc SASL mech:
xmpp = ClientXMPP(jid, password, {
    'feature_mechanisms': {'use_mech':'PLAIN'}})
2011-08-09 00:51:49 -07:00
Lance Stout
75f23d1130 Fix XEP-0078 using the new stream feature workflow.
Honestly, this is mainly just a demo/proof of concept that we
can handle dependencies and ordering issues with stream features.

DON'T use XEP-0078 if you are able to use the normal SASL method,
which should be the case unless you are dealing with a very old
XMPP server implementation.
2011-08-06 12:30:56 -07:00
Lance Stout
e83fae3a6f Save the stream ID when the stream starts. 2011-08-06 00:44:32 -07:00
Lance Stout
5be5b8c02b If no config for a plugin is given, try using self.plugin_config.
Sleek loads a few plugins by default, which made it difficult to
configure or even disable them.

Now, if a plugin is registered without any configuration, then
sleek will try finding a configuration in self.plugin_config.
2011-08-06 00:41:14 -07:00
Lance Stout
6c4cb2bf00 Merge branch 'master' into develop
Adds hotfix for ANONYMOUS mech support.

Conflicts:
	sleekxmpp/__init__.py
2011-08-05 14:08:32 -07:00
Lance Stout
148a23579c Hotfix for ANONYMOUS mech support.
Updates version to 1.0-Beta6.1
2011-08-05 14:06:58 -07:00
Lance Stout
ea95811c4c The next release will be 1.0 RC1 2011-08-05 09:01:50 -07:00
Lance Stout
47bc50d9fb Cosmetic PEP8 fixes. 2011-08-04 22:37:22 -07:00
Lance Stout
93a4a3f8a0 Fix Python3 issue with dict.has_key() 2011-08-04 22:36:23 -07:00
Lance Stout
b7cd119b0c Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-04 21:50:14 -07:00
Nathan Fritz
7f90de887a added block as process option and updated documentation. added typical use example to ClientXMPP. 2011-08-04 21:49:32 -07:00
Lance Stout
6c8a135612 Fix imports using __all__. 2011-08-04 21:49:15 -07:00
Lance Stout
caec2976d7 Fix Python3 bug.
Use int() instead of long()
2011-08-04 20:34:23 -07:00
Lance Stout
4d8933abdf Actually, we can work around needing dateutil.
If dateutil is present, we'll use that. If not, we'll use
some regexes from the fixed_datetime module.
2011-08-04 20:22:07 -07:00
Lance Stout
6eac0606cf Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-04 19:07:04 -07:00
Lance Stout
89cffd43f4 Merge branch 'develop' into roster
Conflicts:
	setup.py
2011-08-04 11:52:17 -07:00
Lance Stout
b9764cc120 Clean up and unify tostring once and for all.
Packaging for Python3 just got easier.
2011-08-04 11:41:36 -07:00
Lance Stout
7cd39a6aad Fix imports for xep_0060 2011-08-04 11:38:14 -07:00
Lance Stout
a0767f6af6 Sadly, dateutil is not actually part of the standard lib.
Thus, using the XEP-0082 and XEP-0202 introduces a dependency
on the dateutil package (installable using pip install python-dateutil).

Maybe we'll be able to rework how these plugins work to avoid
needing dateutil, but for now this will have to do.
2011-08-04 00:07:30 -07:00
Nathan Fritz
9ffdba8643 the great xep_0060 re-organization in preperation for rewrite 2011-08-03 23:56:24 -07:00
Lance Stout
9591cd3a7e Merge branch 'stream_features' into develop 2011-08-03 18:35:01 -07:00
Nathan Fritz
db92fa2330 started transition to xep_0060 rewrite 2011-08-03 18:11:00 -07:00
Lance Stout
d94517d9ca Merge branch 'develop' into stream_features 2011-08-03 17:37:15 -07:00
Lance Stout
0bec040cfe Make sure to keep David Cridland's license and copyright. 2011-08-03 17:08:45 -07:00
Lance Stout
3918ddb075 Merge branch 'develop' into stream_features 2011-08-03 17:02:33 -07:00
Lance Stout
d4091dbde6 Integrate a modified version of Dave Cridland's Suelta SASL library. 2011-08-03 17:00:51 -07:00
Lance Stout
d7fe724145 Merge branch 'develop' into exceptions 2011-07-27 19:36:04 -07:00
Lance Stout
ad978700fc Merge branch 'develop' into roster 2011-07-27 19:35:42 -07:00
Lance Stout
e022b2a36c Add support for HTTP Proxy connections. 2011-07-27 19:35:03 -07:00
Lance Stout
ad032e5ed7 Fix error with DNS selection.
Missed a renaming of 'priority' to 'item'
2011-07-27 18:40:57 -07:00
Kim Alvefur
45412fd404 Do a weighted choice among the highest prioritized items based on weight instead of a weighted choice based on priorities. 2011-07-16 11:00:59 +08:00
Lance Stout
1d22a04721 Added support for custom OOB transfer handlers.
Accepting download requests can be done using:

    self['xep_0066'].register_url_handler(handler=self.oob_download)
    # Add jid=... to specify a handler for a particular JID for a
    # componenent.

    def oob_download(self, iq):
        if iq['from'] not in self.custom_oob_whitelist:
            raise XMPPError('not-authorized')
        try:
            data = urllib2.urlopen(iq['oob_transfer']['url'])
            file = open('oob_download', 'w+')
            file.write(data.read())
            file.close()
            data.close()
        except:
            raise XMPPError('item-not-found')
2011-07-05 09:22:17 -07:00
Lance Stout
5efb170e1d Added wait parameter to disconnect.
If wait=True, then the disconnect call will block until
the send queue has emptied.

WARNING: Using wait=True when more stanzas are being added to the
queue than can be processed such that the queue is never empty
will cause the disconnect call to block indefinitely without actually
disconnecting.
2011-07-04 18:47:57 -07:00
Lance Stout
cccccdcc0a Add logging to XEP-0066. 2011-07-03 20:39:03 -07:00
Lance Stout
8d384ce44f Added XEP-0224 Attention plugin. 2011-07-03 20:37:21 -07:00
Lance Stout
4d6e7c7dbb Update version number to beta6.
XEP-0092 now uses sleekxmpp.__version__ as a default version number.
2011-07-03 15:47:12 -07:00