Vijay Pandurangan
2332970cf2
elide unnecessary copy
2011-11-19 16:02:41 -08:00
Vijay Pandurangan
48af3d3322
remove unnecessary copies when only one handler matches. This was taking up ~ 15% of CPU on moderate load.
2011-11-19 15:59:38 -08:00
Lance Stout
429c94d6a9
Tidy up logging calls.
2011-11-19 12:07:57 -08:00
Vijay Pandurangan
deb52ad350
This change stops sleekxmpp from spending huge amounts of time unnecessarily computing logging data that may never be used. This is a HUGE performance improvement; in some of my test runs, unnecessary string creation was accounting for > 60% of all CPU time.
...
Note that using % in a string will _always_ perform the sting substitutions, because the strings are constructed before the function is called. So log.debug('%s' % expensiveoperation()) will take about the same CPU time whether or not the logging level is DEBUG or INFO. if you use , no substitutions are performed unless the string is actually logged
2011-11-20 03:39:05 +08:00
Vijay Pandurangan
6f3cc77bb5
This change stops sleekxmpp from spending huge amounts of time unnecessarily computing logging data that may never be used. This is a HUGE performance improvement; in some of my test runs, unnecessary string creation was accounting for > 60% of all CPU time.
...
Note that using % in a string will _always_ perform the sting substitutions, because the strings are constructed before the function is called. So log.debug('%s' % expensiveoperation()) will take about the same CPU time whether or not the logging level is DEBUG or INFO. if you use , no substitutions are performed unless the string is actually logged
2011-11-19 11:30:44 -08:00
Lance Stout
1baf139ca4
Bump next release version to 1.0-RC4
2011-11-18 16:40:17 -08:00
Lance Stout
d4c1ff5309
Also fire changed_status when the status text changes for a resource.
2011-11-18 13:57:41 -08:00
Lance Stout
22868c3924
Fix changed_status event
...
Once again only fires when a resource's presence show value changes.
2011-11-18 13:39:02 -08:00
Lance Stout
0c86f8288d
No need to continue processing loop if an error ocurred and auto_reconnect=False.
2011-11-14 11:21:05 -08:00
Lance Stout
5a6a65fd9f
Fix typo
2011-11-14 11:20:53 -08:00
Lance Stout
43c4d23896
Explicitly test for inequality in JIDs.
...
Fixes issue #113
2011-11-14 09:15:43 -08:00
Lance Stout
9f9e8db814
Add use_ssl parameter to ClientXMPP.connect
2011-11-11 01:52:18 -08:00
Lance Stout
b8efcc7cf0
Don't just call self.disconnect in self.reconnect.
...
It messes up the auto_reconnect value and causes the XML processing
loop to spin wildly with errors on a stream disconnect.
2011-11-08 19:23:53 -08:00
Lance Stout
888e286a09
Continue trying to reconnect, even if the attempt fails.
...
The transition from disconnected to connected states must be done in a
loop in case the transition fails, not just once and hope it worked.
2011-11-07 01:13:34 -08:00
Lance Stout
1a93a187f0
Fix a crash when removing a contact.
...
Original author: louiz
2011-11-06 08:33:03 -08:00
Lance Stout
a8d5da5091
Restore original behaviour for auto_authorize and auto_subscribe.
...
The change to using the new roster broke the original auto_* values
and used per-roster versions. The original auto_* values will now set
the behaviour globally. Use the per-roster values to override for a
specific JID.
2011-11-06 08:25:29 -08:00
Lance Stout
e2720fac9e
FIX SCRAM-SHA-1-PLUS
...
The mechanism name was being correctly de-plussed, but then we used the
original, -PLUS, name to extract the hash, finding SHA-1-PLUS and therefore
finding no match.
Test-Information:
Tested with Sleek against an Isode M-Link with SCRAM-SHA-1-PLUS available.
Author: dwd
2011-10-27 15:16:54 -04:00
Lance Stout
4374729f20
Update the docs for XEP-0060 publish method.
2011-10-11 20:37:50 -04:00
Lance Stout
87999333cb
Fix MUC methods to optionally specify the sending JID.
...
Should fix issue #107
2011-10-10 11:31:03 -04:00
Lance Stout
335dc2927b
Break reference cycle to fix potential memory leaks for callback handlers.
2011-10-08 17:31:30 -04:00
Lance Stout
ccbef6b696
Fix typos in the roster update method.
2011-10-07 18:13:50 -04:00
Lance Stout
3e384d3cfe
XEP-0009 will likely be updated to use <base64 /> instead of <Base64 />
...
Both are supported when reading, but <base64 /> will be used for output.
2011-10-05 12:09:50 -04:00
Lance Stout
e33949c397
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-10-04 10:37:42 -04:00
Lance Stout
eccac859ad
Fix missing import statement.
...
Fixes issue #105
2011-10-04 10:36:52 -04:00
Correl Roush
3607c5b792
Make RPC events threaded
...
Allows, for example, an RPC service to make remote RPC calls with its
own connection without blocking its own thread waiting for the result.
2011-10-03 14:32:48 -04:00
Lance Stout
e37adace62
Allow SASL mechanism to be set when creating a ClientXMPP instance.
...
Instead of using:
ClientXMPP(jid, password, plugin_config={
'feature_mechanisms': {'use_mech': 'SOME-MECH'}})
You can use:
ClientXMPP(jid, password, sasl_mech='SOME-MECH')
If you need to change the mechanism after instantiation, use:
xmpp['feature_mechanisms'].sasl.mech = 'SCRAM-MD5'
2011-09-28 22:48:30 -04:00
Lance Stout
d10f591bf4
Expand live stream testing capabilities.
2011-09-28 17:26:29 -04:00
Lance Stout
262da78ca7
Fix del_event_handler for Python3 (different semantics for filter()).
...
Fixes issue #103
2011-09-23 12:03:49 -04:00
Lance Stout
0b83edf439
Fix regression for handling the case where the server terminates the stream.
...
The processing loop was continuing to call __read_xml after </stream>
was received, which caused SyntaxErrors (can't find starting element).
This should fix issue #102
2011-09-22 01:32:44 -04:00
Nathan Fritz
cf7fcf496e
SyntaxError requires a restart
2011-09-19 11:53:09 -07:00
Lance Stout
1765271f84
Make get_node_config block by default.
2011-09-02 11:52:56 -07:00
Lance Stout
0ec79f8dc3
Tweak setup.py, and bump dev version to RC3.
2011-09-01 16:47:30 -07:00
Lance Stout
6f72c05ebf
Add whitespace keepalive option.
...
May be disabled by setting:
self.whitespace_keepalive = False
The keepalive interval can be adjusted using:
self.whitespace_keepalive_interval = 300
The default interval is 5min.
2011-09-01 16:24:09 -07:00
Nathan Fritz
20cacc84ba
remove ping schedule on disconnect
2011-09-01 15:51:43 -07:00
Lance Stout
24a14a0284
Mark pubsub state stanzas as non-standard.
2011-09-01 15:29:05 -07:00
Lance Stout
efa4a9b330
More stanza cleanup for pubsub.
2011-09-01 14:20:58 -07:00
Lance Stout
39ec1cff19
Some more minor cleanup.
2011-09-01 14:03:11 -07:00
Lance Stout
24c5f8d374
Clean up pubsub#event stanzas.
2011-09-01 14:01:58 -07:00
Lance Stout
d6b0158ddb
Clean up pubsub#owner stanzas.
2011-09-01 13:47:55 -07:00
Lance Stout
7e5e9542e9
Add support for notify attribute when retracting an item.
2011-09-01 13:36:11 -07:00
Lance Stout
d7fc2aaa9c
Add ability to get global/node default subscription options.
2011-09-01 13:25:35 -07:00
Lance Stout
8471a485d1
Clean up pubsub stanzas.
2011-09-01 13:12:26 -07:00
Lance Stout
462b375c8f
Owners can modify subscriptions/affiliations. With tests.
...
94% coverage for the main pubsub plugin! (91% including stanzas)
2011-09-01 12:09:24 -07:00
Lance Stout
afbd506cfc
Users can retrieve their affiliations now, with tests.
2011-09-01 11:30:55 -07:00
Lance Stout
ec01e45ed1
Add ability for a user to get retrieve subscriptions, with tests.
2011-09-01 11:19:25 -07:00
Lance Stout
993829b23f
Add tests for pubsub subscription options.
2011-09-01 10:44:14 -07:00
Lance Stout
002257b820
Add tests for retrieving pubsub items.
2011-09-01 09:27:10 -07:00
Lance Stout
0af35c2224
Fix memory reference bugs.
2011-09-01 00:50:45 -07:00
Lance Stout
76bc0a2ba6
XEP-0060 v1.13 dictates publishing/retracting one item at a time.
2011-08-31 23:48:22 -07:00
Lance Stout
3f9ca0366b
Add test for purging a pubsub node.
2011-08-31 21:09:25 -07:00
Lance Stout
b68785e19e
Retract stanzas are behaving oddly when using stanza values.
2011-08-31 16:03:32 -07:00
Lance Stout
46f23f7348
Test publishng an item with options.
2011-08-31 14:55:37 -07:00
Lance Stout
09252baa71
Test publishing a single item.
2011-08-31 14:31:20 -07:00
Lance Stout
3623a7a16a
More pubsub unit tests!
2011-08-31 14:05:29 -07:00
Lance Stout
cc504ab07c
Fix pubsub get_items.
...
- item_ids checked for None
- pubsub node is set
2011-08-31 10:56:43 -07:00
Lance Stout
2500a0649b
Fix requesting pubsub node configuration, and add tests.
...
- <default /> doesn't have a type attribute in the XEP
- <configure /> isn't used anymore for requesting default configuration
2011-08-31 10:43:33 -07:00
Lance Stout
5ec4e4a026
Added pubsub error stanza.
...
iq['error']['pubsub']['condition']
iq['error']['pubsub']['unsupported']
2011-08-31 00:42:37 -07:00
Lance Stout
c3df4dd052
Create a tox config for automating tests for different Python versions.
...
To use:
sudo pip install tox
tox
2011-08-31 00:00:12 -07:00
Lance Stout
628978fc8c
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-08-30 23:11:11 -07:00
Nathan Fritz
7fb9d68714
fixed form accessors in pubsub stanzas
2011-08-30 23:10:13 -07:00
Lance Stout
e0a1c477d0
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-08-30 23:03:51 -07:00
Nathan Fritz
b70565720f
fixed test further... but now I have an out of order problem
2011-08-30 23:03:04 -07:00
Lance Stout
33ac0c9dd6
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-08-30 22:45:08 -07:00
Nathan Fritz
4699bdff60
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-08-30 22:44:34 -07:00
Nathan Fritz
354641a3ce
added publish-options element
2011-08-30 22:44:19 -07:00
Lance Stout
58a43e40c7
Get/set pubsub subscription options.
2011-08-30 22:27:21 -07:00
Lance Stout
13fdab0139
Test and fix XEP-0060 delete_node()
2011-08-30 21:57:11 -07:00
Lance Stout
2ce617b2ce
Fix typo
2011-08-30 09:24:46 -07:00
Lance Stout
63e0496c30
Finish up all major actions in the current XEP-0060.
...
Still need tests and docs.
2011-08-29 23:05:14 -07:00
Lance Stout
850e3bb99b
Stub out missing functionality for pubsub
2011-08-29 21:38:41 -07:00
Lance Stout
2d90deb96a
The ifrom parameter doesn't need special treatment.
2011-08-26 22:06:32 -07:00
Lance Stout
3fb3f63e51
Add docs + extended Iq send arguments to pubsub methods.
2011-08-26 16:57:37 -07:00
Lance Stout
d12949ff1c
Fix typos in XEP-0060, start of docs and tests.
2011-08-26 12:14:57 -07:00
Lance Stout
e3e985220e
Simplify the main process loop.
2011-08-25 17:08:20 -07:00
Lance Stout
802dd8393d
Make the timeout for event queue checks configurable.
...
Now defaults xmlstream.WAIT_TIMEOUT, and settable with
self.wait_timeout.
The new default timeout is 1sec instead of 5sec.
2011-08-25 16:45:34 -07:00
Lance Stout
fe6bc31c60
Added XMLStream.configure_dns.
...
This can be overridden to do custom configuration for the DNS resolver,
or any other DNS related tasks such as calling the system's res_init().
2011-08-25 16:18:26 -07:00
Lance Stout
2162d6042e
Session timeout now defaults to 45sec, but can be adjusted.
...
e.g.
self.session_timeout = 15
It is also managed by XMLStream instead of ClientXMPP now.
2011-08-25 15:40:13 -07:00
Lance Stout
b8a4ffece9
Handle sending stanzas in chunks if the socket has poor performance.
2011-08-25 15:08:45 -07:00
Lance Stout
d929e0deb2
Shutdown socket before closing.
2011-08-25 13:48:43 -07:00
Lance Stout
4c08c9c524
Update scheduler with locks and ability to remove tasks.
...
Scheduled tasks must have a unique name.
2011-08-25 13:34:30 -07:00
Lance Stout
63b8444abe
Add overridable method self.configure_socket().
...
Allows for setting app specific socket timeouts and other socket options.
2011-08-25 00:22:26 -07:00
Lance Stout
84f9505a8d
Fix handling of DNS exceptions.
2011-08-24 22:40:57 -07:00
Lance Stout
ede59ab40e
Clean and get setup.py working once and for all.
...
Fixes:
README.rst now included
Double line spacing removed from long_description
Source package now includes tests, examples, etc using Manifest.in
README.rst typos fixed
Added README.rst section on installing dnspython for Python3
Version bumped to RC2
Version is now taken from sleekxmpp.version.__version__ without
having to pull in the entire library
Added 'test' command for setup.py
Simplified testall.py
Docs build cleanly from source package after installation
2011-08-24 22:09:02 -07:00
Lance Stout
f92f96325a
Make Iq exceptions more discoverable and simpler to use.
...
IqError and IqTimeout now extend XMPPError, so if you don't care
about the difference, you can use:
try:
self.do_something_with_iqs()
except XMPPError:
# Error? Timeout? I don't care!
pass
If you do need to distinguish between timeouts and error replies,
you can still continue to use:
try:
self.do_somethin_with_iqs()
except IqError as err:
pass
except IqTimeout:
pass
If you don't catch any Iq errors and you're processing a stanza
then an error response will be sent, just like normal if you raise
XMPPError or any other exception, except that the error messages
will be generic to prevent leaking too much information.
2011-08-19 01:04:20 -07:00
Lance Stout
e02a42a008
Route all unhandled exceptions through XMLStream.exception.
...
Or through an equivalent override.
2011-08-18 16:12:51 -07:00
Lance Stout
3e51126e18
PEP8 edits
2011-08-18 02:46:48 -07:00
Lance Stout
a714fa82b2
Remove extra, unhelpful presence debug log.
2011-08-18 02:46:08 -07:00
Lance Stout
e86e6eae81
Up the timeout to 30sec instead of 10sec.
2011-08-18 01:10:25 -07:00
Nathan Fritz
f75b6bf955
added inline documentation for new dns methods
2011-08-18 01:04:01 -07:00
Nathan Fritz
fb78bf0996
fixed manual address definition
2011-08-18 00:59:27 -07:00
Lance Stout
cd7cd30b4c
Fix exceptions for Python3
2011-08-18 00:47:07 -07:00
Nathan Fritz
4ea22ff69b
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-08-18 00:35:37 -07:00
Nathan Fritz
3853898ab3
DNS is now properly checked and different answers are tried for each reconnect until exhausted
2011-08-18 00:35:18 -07:00
Lance Stout
3fc20e10f5
Add some convenience methods to rosters.
...
Can now use len(self.client_roster) to get the number of JIDs in
the roster, and self.client_roster.groups() to get a dict of
groups and the JIDs in those groups.
2011-08-18 00:07:37 -07:00
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
Lance Stout
9c5885c6b6
Let XEP-0202 specify the local timezone offset in the config.
2011-07-03 15:41:22 -07:00
Lance Stout
ec3a14e6d9
Updated XEP-0202 plugin to new format and use XEP-0082.
2011-07-03 15:30:06 -07:00
Lance Stout
c98f5d4450
Fix some bugs in time handling.
...
Namely, minutes and seconds were reversed.
2011-07-03 13:41:15 -07:00
Lance Stout
2e8e542bc9
Added XEP-0203 Delayed Delivery plugin.
2011-07-03 12:43:34 -07:00
Lance Stout
7ccc67c06d
Added XEP-0082 plugin.
...
This should make things much easier for any stanza that uses timestamps.
2011-07-03 12:21:47 -07:00
Lance Stout
20df6348a4
Merge branch 'develop' into exceptions
2011-07-03 00:39:14 -07:00
Lance Stout
48fb7006f7
Merge branch 'develop' into roster
2011-07-03 00:39:02 -07:00
Lance Stout
9a6eb333e6
Merge branch 'develop' into stream_features
2011-07-03 00:38:22 -07:00
Lance Stout
086bf89d69
Added XEP-0066: Out-of-Band Data
2011-07-03 00:36:36 -07:00
Lance Stout
0224d028e7
SASL failure event now includes the failure stanza.
...
Broke SASL stanzas into separate files.
Fixed typo in feature_bind.
2011-07-02 23:09:29 -07:00
Lance Stout
540d749695
Fix ordering bug when retrieving an error condition.
2011-07-02 22:50:31 -07:00
Lance Stout
219df582da
It isn't 2010 anymore.
...
I keep forgetting to update the copyright on new code.
2011-07-02 22:49:34 -07:00
Lance Stout
b898b14b77
Use a set to track negotiated features.
...
Added guards to prevent renegotiating STARTTLS or SASL in cases where
servers don't behave properly.
2011-07-02 22:30:55 -07:00
Lance Stout
fba235a801
Simplify SASL mech registration.
...
Moved SASL registration completely to the feature plugin, instead of
keeping a portion of it in ClientXMPP.
2011-07-02 21:57:50 -07:00
Lance Stout
b0297af38d
Finish cleaning up stream feature organization.
...
Fixed missing references that weren't caught due to leftover pyc
file allowing tests to keep working when they shouldn't have.
2011-07-02 21:43:02 -07:00
Lance Stout
04def6d925
Merge branch 'develop' into stream_features
2011-07-01 15:19:37 -07:00
Lance Stout
7057984831
Merge branch 'develop' into roster
2011-07-01 15:19:05 -07:00
Lance Stout
2a2ac73845
So using sys.excepthook to catch errors only works once.
...
The error bubbles through the event processing loop, breaking it and
hanging the application.
Instead, there is now a .exception(e) method on XMLStream which may
be overridden or reassigned that will receive all unhandled exceptions
(read: not XMPPError) from event and stream handlers.
2011-07-01 15:18:10 -07:00
Lance Stout
634f5d691b
Continued reorganization and streamlining.
2011-07-01 14:45:55 -07:00
Lance Stout
754ac5092a
Reorganize features into plugins.
2011-06-30 15:40:22 -07:00
Lance Stout
9ed972ffeb
Fix SASL mechanism selection bug.
...
ANONYMOUS was being treated as PLAIN, mechanism was being chosen
purely from supported mechanisms, not those provided by the server.
Broke nested handler methods into top-level methods.
2011-06-29 14:05:27 -07:00
Lance Stout
3b1f3fddf0
Reorganized stream level stanzas.
2011-06-28 11:06:44 -07:00
Lance Stout
fa716457a5
Merge branch 'develop' into stream_features
2011-06-20 16:27:55 -07:00
Lance Stout
847510c6b5
Merge branch 'develop' into exceptions
2011-06-20 16:27:39 -07:00
Lance Stout
774e0f2022
Merge branch 'develop' into roster
2011-06-20 16:27:25 -07:00
Lance Stout
d8d9e8df16
Fix stanza clobbering when replying to errors.
...
If a stanza handler raised an exception, the exception was processed
and replied by the modified stanza, not a stanza with the original
content.
A copy is now made before handler processing, and if an exception occurs
it is the copy that processes the exception using the original content.
2011-06-20 16:25:56 -07:00
Lance Stout
d1e12cd46f
Need to store unavailable presence as last sent if broadcasted.
2011-06-18 14:39:17 -07:00
Lance Stout
adf6d49fd1
Store unavailable presence as last sent presence.
2011-06-18 14:36:19 -07:00
Lance Stout
ce145b04ac
Integrate roster with ClientXMPP.
...
Roster updates are now passed through to the roster when using
self.update_roster, etc.
2011-06-16 16:09:15 -07:00
Lance Stout
29d775e675
Integrate roster with BaseXMPP.
...
Last sent stanzas are saved regardless of if the roster is used
directly or self.send_presence
2011-06-16 16:03:31 -07:00
Lance Stout
251a47db8c
Split roster.py into a directory.
2011-06-16 14:15:22 -07:00
Lance Stout
393d702e77
Merge branch 'develop' into exceptions
2011-06-15 10:56:49 -07:00
Lance Stout
4efd41f1ba
Merge branch 'develop' into stream_features
2011-06-15 10:56:33 -07:00
Lance Stout
58aa944a5e
Fix another roster issue.
...
Caused by same issue of a JID being in the roster, but with an
incomplete entry.
2011-06-15 10:55:36 -07:00
Lance Stout
a3597d6deb
Merge branch 'develop' into roster
...
Conflicts:
sleekxmpp/basexmpp.py
2011-06-14 14:24:25 -07:00
Lance Stout
8fada4d015
Merge branch 'develop' into exceptions
2011-06-14 14:18:40 -07:00
Lance Stout
5d11ab269d
Merge branch 'develop' into stream_features
2011-06-14 14:10:52 -07:00
Lance Stout
dd41a85efc
Fix issue with components and roster.
...
If the roster contained a JID, but not any resource presence data, then
an error would occur when accessing self.roster[jid]['presence'].
2011-06-14 14:03:54 -07:00
Lance Stout
6d59f55fd4
Merge branch 'develop' into exceptions
2011-06-10 15:15:01 -07:00
Lance Stout
7a60e4b458
Merge branch 'develop' into stream_features
2011-06-10 15:14:51 -07:00
Lance Stout
937dce8e65
Merge branch 'develop' into roster
2011-06-10 15:14:37 -07:00
Nathan Fritz
e2d18170b0
old xep_0050 plugin is now loadable
2011-06-10 04:14:01 +00:00
Lance Stout
e219c0f976
Added session_end event and some docs.
...
For now, session_end is the same as disconnected, but once support is
added later for stream management, the two events will become distinct.
Plugins should add handlers for session_end for cleaning any session
state.
2011-06-08 10:24:25 -07:00
Lance Stout
5c1562f36b
Merge branch 'develop' into exceptions
2011-06-08 10:02:38 -07:00
Lance Stout
823c13707d
Merge branch 'develop' into stream_features
2011-06-08 10:02:22 -07:00
Lance Stout
8eb59072b4
Merge branch 'develop' into roster
2011-06-08 10:01:52 -07:00
Lance Stout
4266ee0fa4
Fix XEP-0050 issue with Unicode string type checking.
2011-06-08 10:00:28 -07:00
Lance Stout
3a62908703
Send component handshake immediately.
2011-06-08 10:00:01 -07:00
Lance Stout
20d053807d
IqTimeout now references the original sent stanza.
...
A little extra bit of docs for IqError.
2011-06-01 15:28:33 -07:00
Lance Stout
8aa4396e44
Begin experimental use of exceptions.
...
Provides IqTimeout and IqError which are raised when an Iq response
does not arrive in time, or it arrives with type='error'.
2011-06-01 15:17:22 -07:00
Lance Stout
8f9100c762
Merge branch 'develop' into stream_features
2011-06-01 15:17:13 -07:00
Lance Stout
788a5b73f9
Merge branch 'develop' into roster
2011-06-01 15:17:04 -07:00
Lance Stout
1469323350
Cache stanza if sending fails.
...
The stanza will be sent first once the send queue is reactivated
after session start.
Stanzas sent by skipping the queue will not be cached.
2011-06-01 15:10:44 -07:00
Lance Stout
83a73ac9b7
Merge branch 'develop' into stream_features
...
Conflicts:
sleekxmpp/clientxmpp.py
2011-05-31 11:05:54 -07:00
Lance Stout
5ed27bf5f6
Merge branch 'develop' into roster
2011-05-31 10:59:14 -07:00
Lance Stout
a81162edd2
Apply connection backoff to reconnect attempts.
...
Backoff was only being done for the initial connection attempt
before. Now any reconnection will start with a minimum 1 sec
delay which will approximately double between attempts.
2011-05-31 10:55:15 -07:00
Lance Stout
8080b4cae2
Cleanup logging and exception handling.
...
The syntax and attribute errors raised during a disconnect/reconnect
attempt are now caught and produce nicer log messages.
2011-05-31 10:23:05 -07:00
Lance Stout
1735c194cd
Don't use the send queue for stream initialization.
...
Use the parameter now=True to skip the queue when
sending Iq stanzas, or using xmpp.send().
2011-05-27 17:00:57 -07:00
Lance Stout
6997b2fbf8
Fix typo for SSL certificate use.
2011-05-27 16:39:45 -07:00
Lance Stout
b81ab97900
Add exponential backoff to connection attempts.
...
Delay will approximately double between attempts (random variation).
See issue #67 .
2011-05-27 14:42:40 -07:00
Lance Stout
384e1a92b7
Added support for testind disconnect errors.
2011-05-27 11:01:30 -07:00
Lance Stout
9851a2a057
Merge branch 'develop' into stream_features
2011-05-20 21:41:44 -04:00
Lance Stout
c49a8e9114
Save progress
2011-05-20 17:42:40 -04:00
Lance Stout
6b274a2543
Fix double roster entry issue with Unicode.
...
JIDs with Unicode values were being encoded by the JID class
instead of leaving them as just Unicode strings.
It may still be a good idea to use
from __future__ import unicode_literals
pretty much everywhere though.
Fixes issue #88 .
2011-05-20 16:48:13 -04:00
Lance Stout
a269be485f
Merge branch 'develop' into stream_features
2011-05-20 13:46:46 -04:00
Lance Stout
d3bd9cd31d
Merge branch 'develop' into roster
2011-05-20 13:46:36 -04:00
Lance Stout
6a07e7cbe3
Handle callback return value case.
2011-05-20 13:46:12 -04:00
Lance Stout
e2de82ac8d
Merge branch 'develop' into stream_features
...
Conflicts:
sleekxmpp/clientxmpp.py
2011-05-20 13:26:21 -04:00
Lance Stout
e3b14bc5a9
Merge branch 'develop' into roster
...
Conflicts:
sleekxmpp/clientxmpp.py
tests/test_stream_roster.py
2011-05-20 13:23:48 -04:00
Lance Stout
9f1648328f
Resolve timeout errors for get_roster.
...
See issue #89
Using get_roster will now return the same types of values as
Iq.send. If a timeout occurs, then the event 'roster_timeout'
will be fired. A successful call to get_roster will also
raise the 'roster_received' event.
To ensure that the get_roster call was successful, here
is a pattern to follow:
def __init__(self, ...):
...
self.add_event_handler('session_start', self.session_start)
self.add_event_handler('roster_timeout', self.roster_timeout)
self.add_event_handler('roster_received', self.roster_received)
def session_start(self, e):
self.send_presence()
self.get_roster()
def roster_timeout(self, e):
# Optionally increase the timeout period
self.get_roster(timeout=self.response_timeout * 2)
def roster_received(self, iq):
# Do stuff, roster has been initialized.
...
2011-05-20 12:56:00 -04:00
Lance Stout
8e46aa7054
Merge branch 'develop' into roster
2011-04-26 16:33:32 -04:00
Lance Stout
5399fdd3a9
Add support for testing that no stanzas are sent in tests.
...
Use: self.send(None)
2011-04-26 16:32:58 -04:00
Nathan Fritz
8a22597180
added has_jid to roster
2011-04-15 17:43:12 -07:00
Nathan Fritz
016aac69f6
Pubsub/Unsubscribe was not getting registered
2011-04-14 17:35:20 -07:00
Nathan Fritz
e919906c8c
Pubsub/Unsubscribe was not getting registered
2011-04-14 17:34:33 -07:00
Nathan Fritz
46dc6eac88
remove roster item state responsibility from clients
2011-04-14 16:27:27 -07:00
Lance Stout
b9bf30e095
Merge branch 'develop' into roster
2011-04-11 14:23:39 -04:00
Lance Stout
1d891858b6
Mark scheduler thread as a daemon.
2011-04-11 14:22:32 -04:00
Lance Stout
6b05938573
Merge branch 'develop' into roster
2011-04-08 16:41:45 -04:00
Lance Stout
87ccd804ff
Add version info.
...
May now use sleekxmpp.__version__ and sleekxmpp.__version_info__.
2011-04-08 16:39:39 -04:00
Lance Stout
d7ba7cc72a
Use underscore method name.
...
Since camelcase names are aliased to the underscored name at startup,
if the underscored version is replaced later, the camelCase name does
not reflect the change.
2011-04-08 16:14:22 -04:00
Lance Stout
f125c11a81
Merge branch 'develop' into stream_features
2011-03-24 13:15:09 -04:00
Lance Stout
77601f7262
Merge branch 'develop' into roster
2011-03-24 13:15:00 -04:00
Lance Stout
d94811d81d
Added new implementation for XEP-0086.
2011-03-24 13:14:26 -04:00
Lance Stout
6d45971411
Allow a stanza plugin to override a parent's interfaces.
...
Each interface, say foo, may be overridden in three ways:
set_foo
get_foo
del_foo
To declare an override in a plugin, add the class field
overrides as so:
overrides = ['set_foo', 'del_foo']
Each override must have a matching set_foo(), etc method
for implementing the new behaviour.
To enable the overrides for a particular parent stanza,
pass the option overrides=True to register_stanza_plugin.
register_stanza_plugin(Stanza, Plugin, overrides=True)
Example code:
class Test(ElementBase):
name = 'test'
namespace = 'testing'
interfaces = set(('foo', 'bar'))
sub_interfaces = set(('bar',))
class TestOverride(ElementBase):
name = 'test-override'
namespace = 'testing'
plugin_attrib = 'override'
interfaces = set(('foo',))
overrides = ['set_foo']
def setup(self, xml):
# Don't include an XML element in the parent stanza
# since we're adding just an attribute.
# If adding a regular subelement, no need to do this.
self.xml = ET.Element('')
def set_foo(self, value):
print("overrides!")
self.parent()._set_attr('foo', 'override-%s' % value)
register_stanza_plugin(Test, TestOverride, overrides=True)
Example usage:
>>> t = TestStanza()
>>> t['foo'] = 'bar'
>>> t['foo']
'override-bar'
2011-03-24 12:25:17 -04:00
Lance Stout
bf2f2782b7
Merge branch 'develop' into stream_features
2011-03-24 09:36:35 -04:00
Lance Stout
d9be51b2ef
Merge branch 'develop' into roster
2011-03-24 09:36:26 -04:00
Lance Stout
a3d111be12
Added new XEP-0050 implementation.
...
Backward incompatibility alert!
Please see examples/adhoc_provider.py for how to use the new
plugin implementation, or the test examples in the files
tests/test_stream_xep_0050.py and tests/test_stanza_xep_0050.py.
Major changes:
- May now have zero-step commands. Useful if a command is
intended to be a dynamic status report that doesn't
require any user input.
- May use payloads other than data forms, such as a
completely custom stanza type.
- May include multiple payload items, such as multiple
data forms, or a form and a custom stanza type.
- Includes a command user API for calling adhoc commands
on remote agents and managing the workflow.
- Added support for note elements.
Todo:
- Add prev action support.
You may use register_plugin('old_0050') to continue using the
previous XEP-0050 implementation.
2011-03-24 09:35:36 -04:00
Lance Stout
d6f2e51b05
Allow SleekTest to wait longer when checking for sent stanzas.
...
Now timeouts at 0.5sec instead of 0.1sec, which should prevent test
failures from stanzas being delayed longer than usual.
2011-03-23 20:23:49 -04:00
Lance Stout
feb7f892ea
Fix typo.
2011-03-23 19:00:20 -04:00
Lance Stout
694673b9bd
Merge branch 'develop' into stream_features
2011-03-23 10:01:21 -04:00
Lance Stout
393259c24b
Merge branch 'develop' into roster
2011-03-23 10:01:10 -04:00
Lance Stout
833f95b53a
Cleaned XEP-0249 plugin, added tests.
2011-03-23 10:00:32 -04:00
Lance Stout
306bdd8021
Merge branch 'develop' into stream_features
2011-03-22 20:48:28 -04:00
Lance Stout
756c4c032f
Merge branch 'develop' into roster
2011-03-22 20:48:09 -04:00
Lance Stout
4b1fadde4b
Updated XEP-0128 plugin to work with the new XEP-0030 plugin.
...
Required fixing a few bugs in StanzaBase related to iterable
substanzas.
2011-03-22 20:42:43 -04:00
Lance Stout
a9685a00b3
Merge branch 'develop' into stream_features
...
Conflicts:
sleekxmpp/clientxmpp.py
2011-03-22 12:08:27 -04:00
Lance Stout
e1360ae049
Merge branch 'develop' into roster
2011-03-22 12:00:01 -04:00
Lance Stout
86a6b40fd8
Updated doc for connect()
2011-03-22 11:59:27 -04:00
Lance Stout
7ef6abb2a3
May pass use_tls=False to connect().
...
Will disable the use of TLS for the session.
2011-03-22 11:56:55 -04:00
Lance Stout
af45b51f4f
Fix error with session feature.
2011-03-18 17:57:49 -04:00
Lance Stout
566ec8a5f9
Merge branch 'develop' into stream_features
...
Conflicts:
sleekxmpp/xmlstream/stanzabase.py
2011-03-18 17:39:43 -04:00
Lance Stout
b048f8d733
Merge branch 'develop' into roster
2011-03-18 17:36:35 -04:00
Lance Stout
dbf6780345
Change namespace inclusion in strings.
...
ElementBase instances will display the top-most namespace by default.
StanzaBase instances will NOT display the top-most namespace by default.
May pass True or False to __str__ to override.
2011-03-18 17:34:07 -04:00
Lance Stout
450c313340
Fix error in stanza handler registration in XEP-0092.
2011-03-18 17:30:29 -04:00
Lance Stout
f2c99798a6
Merge branch 'develop' into stream_features
2011-03-18 15:51:44 -04:00
Lance Stout
f65f88325b
Merge branch 'develop' into roster
2011-03-18 15:51:27 -04:00
Lance Stout
996ca52471
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-03-18 15:48:38 -04:00
Lance Stout
6244857746
Fix self.disconnect(reconnect=True) not working.
2011-03-18 15:47:21 -04:00
Florent Le Coz
5635265203
Avoid infinite loop on version result
...
We need to check if type="get". otherwise we will send our version
when we will receive the version of the remote entity, and thus
going in an infinite loop.
2011-03-16 06:45:06 +08:00
Lance Stout
42c8f6ae87
Merge branch 'develop' into roster
2011-02-24 16:19:45 -05:00
Lance Stout
45ccb31356
Remove the occasional warning about XEP-0059 not loaded.
2011-02-24 16:13:44 -05:00
Lance Stout
1a81b2f464
Add tests for XEP-0085, fix some bugs.
2011-02-24 14:15:02 -05:00
Lance Stout
77251452c1
Updated the XEP-0085 plugin.
...
Can now be used as so:
>>> msg['chat_state']
''
>>> msg
<message />
>>> msg['chat_state'] = 'paused'
>>> msg
<message>
<paused xmlns="http://jabber.org/protocol/chatstates " />
</message>
>>> msg['chat_state']
'paused'
>>> del msg['chat_state']
>>> msg
<message />
2011-02-24 12:10:29 -05:00
Lance Stout
4df3aa569b
Bring back the signal handlers (and the "killed" event).
...
Now done more responsibly, saving any existing signal handlers
and calling them when an interrupt occurs in addition to the
one Sleek installs.
NOTE: You may need to explicitly use "kill <process id>" in
order to trigger the proper signal handler execution, and
to raise the "killed" event.
2011-02-23 10:20:04 -05:00
Nathan Fritz
2e2e16e281
fixes to ping: auto-ping off by default, fixed ping-time of zero bug, fixed class name mismatch
2011-02-15 15:24:58 -08:00
Lance Stout
d5b3a52827
Merge branch 'develop' into stream_features
...
Conflicts:
sleekxmpp/xmlstream/stanzabase.py
2011-02-14 16:26:23 -05:00
Lance Stout
e4f3b777f9
Reset the roster on disconnect instead of replacing it.
2011-02-14 16:24:49 -05:00
Lance Stout
a278f79bdb
Merge branch 'develop' into roster
...
Conflicts:
sleekxmpp/clientxmpp.py
2011-02-14 16:18:44 -05:00
Lance Stout
d709f8db65
Use the _build_stanza method.
2011-02-14 13:50:59 -05:00
Lance Stout
75584d7ad7
Remap old method names in a better way.
...
This should prevent some reference cycles that will cause garbage
collection issues.
2011-02-14 13:49:43 -05:00
Lance Stout
e0f9025e7c
More attempts at fixing garbage collection.
...
Don't keep a reference to stanzas in Callback objects.
2011-02-14 11:30:04 -05:00
Lance Stout
9004e8bbf2
Break references that can prevent garbage collection.
2011-02-14 11:13:41 -05:00
Lance Stout
8b5511c7ec
Simplification when removing a deletable handler.
2011-02-13 16:40:04 -05:00
Lance Stout
34f6195ca5
Return the name of the registered callback.
...
Instead of the actual callback object, return just the name of
the callback object created when using iq.send(callback=..).
This will help prevent memory leaks by not keeping an additional
reference to the object, but still allows for the callback to be
canceled by using self.remove_handler("handler_name").
2011-02-13 16:30:57 -05:00
Lance Stout
70af52d74c
Make one-off Callbacks ready for deletion after the prerun step.
...
Waiting until the actual run step means that the handler is not
marked for deletion when checked in the __spawn_event() thread,
causing the callback to stay in the handler list.
2011-02-13 16:28:06 -05:00
Lance Stout
ca2b4a188a
Return the registered callback when using iq.send(callback=foo).
...
Allows for a callback to be canceled by unregistering the
returned handler.
2011-02-12 11:01:43 -05:00
Lance Stout
0d32638379
XMPPError exceptions can keep a stanza's contents.
...
This allows exceptions to include the original
content of a stanza in the error response by including
the parameter clear=False when raising the exception.
2011-02-11 15:20:26 -05:00
Lance Stout
c4b1212c44
Updated XEP-0199 plugin.
...
Now has docs and uses the new plugin format.
2011-02-11 00:30:45 -05:00
Nathan Fritz
3463bf46c6
added option to return false on ping error, added ping example
2011-02-10 13:45:35 -08:00
Lance Stout
13a01beb07
Fix same error for get_info default behaviour.
2011-02-09 09:12:44 -05:00
Lance Stout
145f577bde
Fix get_items default behaviour.
2011-02-09 08:58:00 -05:00
Florent Le Coz
72ead3d598
Replace the print statement by a log.debug call
...
This print syntax is deprecated in python3, so
the plugin was working only with python2
2011-02-09 10:02:14 +08:00
Florent Le Coz
4b71fba64c
Fix the xep_0009 import (no more relatives)
...
Also, remove trailing spaces in all files
of this plugin
2011-02-09 10:02:14 +08:00
Lance Stout
606c369173
Some more roster tweaks.
2011-02-08 19:15:50 -05:00
Stefan de Konink
1ed06bebcd
This fixes the configuration stuff, because type is form not submit with setNodeConfiguration.
2011-02-07 23:55:46 +08:00
Lance Stout
aa1996eba6
Fixed failing tests from new XEP-0009 plugin
2011-02-07 10:18:15 -05:00
Nathan Fritz
683f717cf7
fixed merge
2011-02-05 04:54:52 -08:00
Lance Stout
3c871920b1
Make the roster backend settable.
2011-02-02 12:05:34 -05:00
Lance Stout
de6170a13d
Merge branch 'develop' into roster
...
Conflicts:
sleekxmpp/basexmpp.py
2011-02-02 09:13:22 -05:00
Lance Stout
5313338c3a
Fixes for XEP-0202
2011-01-31 15:40:00 -05:00
Lance Stout
1a270dc05c
First pass at re-worked stream features.
...
Stream features now use stanza objects!
Features are given a ranking that expresses the dependency
relationships (since only one feature is negotiated at a time, the
dependency graph can be replaced by a line).
>>> xmpp.register_feature('my_feature', _my_handler,
>>> restart=True, # Requires stream restart
>>> order=600) # Ranking (out of ~ 10,000,
>>> # lower #'s executed first)
SASL mechanisms may now be added or disabled as needed. Each mechanism
is given a priority value indicating the order in which the client
wishes for mechanisms to be tried. Higher priority numbers are executed
first.
>>> xmpp.register_sasl_mechanism('SASL-MECH', _mech_handler,
>>> priority=0)
Disabling a SASL mechanism:
>>> xmpp.remove_sasl_mechanism('ANONYMOUS')
2011-01-28 00:49:37 -05:00
Lance Stout
bd9bf3f1c7
Update tostring methods.
...
Will now always show top-level namespace, unless it is the same
as the stream's default namespace. Also added the XMPP stream
namespace to the namespace map as 'stream'.
2011-01-27 18:05:05 -05:00
Lance Stout
cd800d636a
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-01-27 16:05:15 -05:00
Lance Stout
40642b2cd1
Make StreamError work properly.
...
Now uses the correct namespaces and condition names.
2011-01-27 16:02:57 -05:00
Lance Stout
35ef8f9090
Make stanza.plugins an OrderedDict.
...
This allows you to determine the order in which substanzas
were added in the original XML.
2011-01-27 16:01:35 -05:00
Lance Stout
38dc35840e
Recognize stanzas that don't use the default namespace.
2011-01-27 15:59:50 -05:00
Florent Le Coz
b4004cd4d6
xep_0045: fix the 'to' value when configuring room
2011-01-27 09:34:32 +08:00
Lance Stout
0c8a8314b2
Cleanup for stanzabase.
...
Use stanza.values instead of _get/set_stanza_values where used.
ElementBase stanzas can now use .tag
May use class method tag_name() for stanza classes.
ElementBase now has .clear() method.
2011-01-26 11:27:41 -05:00
Lance Stout
4e757c2b56
Upgraded how subitem works.
...
May now use register_stanza_plugin(Foo, Bar, iterable=True)
to add to the set of stanza classes used for iterable
substanzas. It is no longer necessary to manually specify
the contents of subitem if the new method is used.
2011-01-26 10:04:36 -05:00
Stefan de Konink
c3be6ea0b2
My hunch is that these should also be updated.
2011-01-23 02:08:29 +08:00
Lance Stout
da332365d4
Make extending stanza objects nicer.
...
A stanza object may add is_extension = True to its class definition
to provide a single new interface to a parent stanza.
For example:
import sleekxmpp
from sleekxmpp import Iq
from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin, ET
class Foo(ElementBase):
"""
Test adding just an attribute to a parent stanza.
Adding subelements works as expected.
"""
is_extension = True
interfaces = set(('foo',))
plugin_attrib = 'foo'
def setup(self, xml):
# Don't include an XML element in the parent stanza
# since we're adding just an attribute.
# If adding a regular subelement, no need to do this.
self.xml = ET.Element('')
def set_foo(self, val):
self.parent()._set_attr('foo', val)
def get_foo(self):
return self.parent()._get_attr('foo')
def del_foo(self):
self.parent()._del_attr('foo')
register_stanza_plugin(Iq, Foo)
i1 = Iq()
i2 = Iq(xml=ET.fromstring("<iq xmlns='jabber:client' foo='bar' />"))
>>> i1['foo'] = '3'
>>> i1
'3'
>>> i1
'<iq id="0" foo="3" />'
>>> i2
'<iq id="0" foo="bar" />'
>>> i2['foo']
'bar'
>>> del i2['foo']
>>> i2
'<iq id="0" />'
2011-01-19 19:49:13 -05:00
Lance Stout
6f4c2f22f3
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-01-19 17:50:05 -05:00
Lance Stout
493df57035
Fix thirdparty imports for Python3
2011-01-19 17:49:39 -05:00
Florent Le Coz
897a9ac333
Do not traceback when DNS resolution time out.
...
Just log that the resolution timed out, and fall back
to the hostname from the JID in this case
2011-01-20 06:34:08 +08:00
Lance Stout
acc2d071ac
Fix disco add_item.
...
If no JID is specified for the item, use xmpp.boundjid.full.
2011-01-19 17:27:53 -05:00
Lance Stout
d3b1f8c476
Fix namespace for Nick stanza.
2011-01-19 16:47:18 -05:00
Lance Stout
f1db2fc156
Fix error in disco add_item.
...
None values were not being treated properly.
2011-01-19 12:08:28 -05:00
Lance Stout
2004ddd678
Add StreamError stanza and a stream_error event.
...
Note that the stream may automatically attempt to
reconnect when a stream error is received.
2011-01-16 13:22:52 -05:00
Lance Stout
cb85d4a529
Raise the event 'socket_error' when a socket error occurs.
...
Will be most useful for debugging and responding to failed
connection attempts.
2011-01-16 13:07:39 -05:00
Lance Stout
ead3af3135
Make it easier to import OrderedDict
2011-01-15 17:15:33 -05:00
Lance Stout
a2891d7608
Fix how disco plugin looks up info and items for clients.
2011-01-15 10:08:35 -05:00
Lance Stout
d7dea0c6cc
Add a note for debug statement when running scheduled events.
...
Fixes the intermittent DEBUG ((),) messages that give no
explanation.
Will now show as:
DEBUG Scheduled event: ((), )
2011-01-14 12:07:25 -05:00
Lance Stout
65931bb384
Merge branch 'develop' into roster
2011-01-13 22:16:46 -05:00
Lance Stout
632827f213
Fix bug in JID class. Attribute .jid now works properly.
2011-01-13 10:21:20 -05:00
Lance Stout
b71550cec7
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2011-01-13 10:20:34 -05:00
Dann Martens
b68e7bed40
Fixed typo.
2011-01-13 15:04:16 +01:00
Dann Martens
4be6482ff3
Fixed 'nil' bug in unmarshalling.
2011-01-13 13:42:01 +01:00
Dann Martens
0a3a7b5a70
Removed binding XML namespace experiments.
2011-01-13 11:37:58 +01:00
Dann Martens
3a12cdbd13
Introduced new XEP-0009 into develop.
2011-01-13 08:40:53 +01:00
Lance Stout
7d93d1824b
Fix setup.py and old_0004.py typo bugs.
2011-01-12 12:22:48 -05:00
Lance Stout
ba0d699d83
Fix ordering error in Iq._set_stanza_values.
...
If iq['query'] was set before a plugin that used the query
element was set, then the query element was duplicated.
2011-01-12 08:55:33 -05:00
Lance Stout
a5d53b3349
Fix method call error.
2011-01-10 16:33:30 -05:00
Lance Stout
4487a90623
Add self.client_roster to make things simpler for clients.
2011-01-10 16:28:49 -05:00
Lance Stout
05da8cc3d1
Merge branch 'develop' into roster
2011-01-10 16:27:18 -05:00
Te-je Rodgers
fe3f8dde4b
added plugin for xep-0249
2011-01-11 04:11:05 +08:00
Lance Stout
23e499998f
Merge branch 'develop' into roster
2011-01-09 10:04:09 -05:00
Lance Stout
acdf9e2d22
Need to run post_init properly.
2011-01-09 10:03:32 -05:00
Lance Stout
2076d506b4
Update the XEP-0092 plugin to the new style.
2011-01-08 22:38:13 -05:00
Florent Le Coz
68ce47c905
Allow XEP 0092 to send os information
...
Doesn't send these information by default, only if provided in the
config dict (as the 'os' key)
2011-01-09 10:08:44 +08:00
Lance Stout
7c7fa0f008
Add support for XEP-0059 to XEP-0030 plugin.
2011-01-08 11:19:31 -05:00
Lance Stout
a8e3657487
Added new XEP-0059 plugin.
...
Contributed by Erik Reuterborg Larsson (who).
2011-01-08 10:58:47 -05:00
Lance Stout
13a2f719f4
Add reattempt to ClientXMPP.connect
2011-01-07 16:41:31 -05:00
Lance Stout
2908751020
Allow JID objects to be compared with strings.
...
Two JIDs match if they have the same full JID value.
2011-01-05 20:16:15 -05:00
Lance Stout
c156a4f723
Merge branch 'develop' into roster
2011-01-05 16:53:33 -05:00
Lance Stout
8b29431cde
More clarification in docs for XEP-0030 plugin.
2011-01-04 19:39:10 -05:00
Lance Stout
4b145958fa
Clarify docs for disco.get_info.
2011-01-04 18:38:21 -05:00
Lance Stout
e08b0054b2
Keep things lined up.
2010-12-29 15:01:50 -05:00
Andrzej Bieniek
596e135a03
Fixed typo in comment.
2010-12-28 21:32:28 +00:00
Lance Stout
e55e213c78
Fix some typos.
2010-12-28 16:17:08 -05:00
Lance Stout
8749f5e09b
Make the new XEP-30 plugin retain older API signatures.
2010-12-28 15:43:00 -05:00
Lance Stout
b3353183f3
Added ordereddict implementation to thirdparty.
...
See http://pypi.python.org/pypi/ordereddict and
http://code.activestate.com/recipes/576693/ .
2010-12-21 17:33:31 -05:00
Lance Stout
3657bf6636
Merge branch 'develop' into roster
2010-12-21 11:33:40 -05:00
Lance Stout
f97f6e5985
More documentation for XEP-0030 plugin.
2010-12-21 11:33:03 -05:00
Lance Stout
34c374a1e1
Make tests pass for catching exceptions.
...
May now use sys.excepthook to catch exceptions
from threaded handlers.
2010-12-17 13:11:03 -05:00
Lance Stout
506eccf84d
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2010-12-17 10:44:32 -05:00
Florent Le Coz
982bf3b2ec
RootStanza raises unexpected exceptions
...
We now raise the unexpected exceptions instead of sending
them on the network.
- avoids flood (sending a traceback on a MUC, for example…) and
maybe some security issues.
- lets you handle the traceback (catch it to handle
it properly, or with except_hook, etc)
- an exception cannot be raised without you knowing
2010-12-17 23:43:48 +08:00
Lance Stout
53a5026301
Almost done with xep-30; added more docs.
2010-12-16 23:52:17 -05:00
Lance Stout
0aee445e69
Use daemon threads instead of signals.
...
Daemonized threads exit once the main program has quit,
and the only threads left running are all daemon threads.
Should fix hanging clients while not trampling over anyone
else's signal handlers.
2010-12-16 22:21:50 -05:00
Lance Stout
adade2e5ec
Merge branch 'develop' into roster
2010-12-16 22:03:56 -05:00
Lance Stout
0ea014fe41
Updated the list of plugins in sleekxmpp.plugins.__init__
2010-12-16 18:29:56 -05:00
Lance Stout
62b190d0ff
Fixed specifying 'from' values in XEP-0045 plugin.
...
Methods now accept either an ifrom or mfrom parameter
to specify a 'from' value. Client connections should not
need to use these, but component connections must use them.
2010-12-16 18:14:33 -05:00
Lance Stout
4b57b8131f
Added support for using SSL CA certificates.
...
Originally provided by Brian Beggs (macdiesel)
and Thom Nichols (tomstrummer).
2010-12-16 17:30:08 -05:00
Lance Stout
988a90a176
Added MUC invite handler to XEP-0045 plugin.
...
Originally contributed by damium/romeira, with some
modifications.
Also, converted tabs to spaces to prepare for future cleanup.
2010-12-16 16:18:49 -05:00
Lance Stout
67775fb8bd
Use boundjid in plugins instead of the deprecated accessors.
...
Originally contributed by skinkie, with a few modifications.
2010-12-16 15:38:00 -05:00
Lance Stout
e81683beee
Some Python 3.1+ compatibility fixes.
...
Originally contributed by filipegiusti.
2010-12-16 15:29:17 -05:00
Lance Stout
d9c25ee65c
Added more options to the make_iq_* methods.
...
May include a to and from JID in make_iq_* calls.
May pass an existing iq stanza to most of them instead of generating
a new stanza.
make_iq now accepts a 'to' value, 'type' value, and 'query' value to
simplify things a bit more.
2010-12-16 15:25:04 -05:00
Lance Stout
1ebc7f4d4b
Implement a few more static node handlers.
2010-12-15 19:22:21 -05:00
Lance Stout
2c5b77ae2e
And some more docs.
2010-12-15 18:57:45 -05:00
Lance Stout
d8aae88526
The documentation effort continues.
...
Also, need to start working on a replacement for the XEP-30 page in the
wiki since the API has changed significantly.
2010-12-15 17:58:15 -05:00
Lance Stout
2f4bdfee1b
Update some docs.
2010-12-13 15:58:59 -05:00
Lance Stout
c16913c999
Merge branch 'develop' into roster
...
Conflicts:
sleekxmpp/basexmpp.py
2010-12-13 14:36:53 -05:00
Lance Stout
f4451fe6b7
First pass at a new XEP-0030 plugin.
...
Now with dynamic node handling goodness.
Some things are not quite working yet, in particular:
set_items
set_info
set_identities
set_features
And still need more unit tests to round things out.
2010-12-09 18:57:27 -05:00
Lance Stout
f474d378ef
Add support for using xml:lang values.
...
Support is only for adding literal XML content
to stanzas. Full support for things like multiple
message bodies with different xml:lang values is
still in the works.
2010-12-07 23:07:40 -05:00
Lance Stout
defc252c7d
Fix several errors in SleekTest.
...
Notably, not sending an expected stanza will not silently pass.
2010-12-07 23:04:37 -05:00
Lance Stout
19bd1e0485
Actually make the Iq callbacks work for real.
2010-12-07 23:04:04 -05:00
Lance Stout
5f2fc67c40
Added option for iq.send to accept a callhandler.
...
The callback will be a stream level handler, and will not
execute in its own thread. If you must have a thread, have the
callback function raise a custom event, which can be processed
by another event handler, which may run in an individual thread,
like so:
def handle_reply(self, iq):
self.event('custom_event', iq)
def do_long_operation_in_thread(self, iq):
...
self.add_event_handler('custom_event', self.do_long_operation_in_thread)
...take out already prepared iq stanza...
iq.send(callback=self.handle_reply)
2010-12-07 17:19:39 -05:00
Lance Stout
8ead33fc3b
Fixed typo
2010-11-18 16:23:18 -05:00
Lance Stout
ab25301953
Adding stream tests for XEP-0030.
...
Fixed some errors when responding to disco requests.
2010-11-18 15:50:45 -05:00
Lance Stout
291b118aca
XEP-0030 bug fixes.
2010-11-18 11:22:11 -05:00
Lance Stout
db7fb10e95
Add rename_node method to disco plugin.
2010-11-18 01:15:34 -05:00
Lance Stout
9214dc6610
Add rename_node method to disco plugin.
2010-11-18 01:12:11 -05:00
Lance Stout
58b95e4ae4
Merge branch 'develop' of github.com:fritzy/SleekXMPP into roster
2010-11-18 00:44:51 -05:00
Lance Stout
60d3afe6b6
Added __repr__ for JIDs.
2010-11-18 00:03:39 -05:00
Lance Stout
e648f08bad
Fix stream test errors.
2010-11-17 16:08:14 -05:00
Lance Stout
7ba6d5e02d
Fix Node set to None error.
2010-11-17 16:01:27 -05:00
Lance Stout
ea48bb5ac5
Fixed some live stream test errors.
...
Added test demonstrating using multiple stream clients
in a single test.
2010-11-17 15:45:16 -05:00
Lance Stout
6ee8a2980c
Fix RESPONSE_TIMEOUT dependency loops.
2010-11-17 15:13:09 -05:00
Lance Stout
debf909359
Merge branch 'develop' into roster
2010-11-17 14:33:09 -05:00
Lance Stout
b8114b25ed
Make live stream tests work better.
...
SleekTest can now use matchers when checking stanzas, using
the method parameter for self.check(), self.recv(), and self.send():
method='exact' - Same behavior as before
'xpath' - Use xpath matcher
'id' - Use ID matcher
'mask' - Use XML mask matcher
'stanzapath' - Use StanzaPath matcher
recv_feature and send_feature only accept 'exact' and 'mask' for now.
2010-11-17 13:43:15 -05:00
Lance Stout
0d4d84b2fa
Cleaned basexmpp.py
2010-11-17 10:13:45 -05:00
Lance Stout
d2aca3e7e0
Remove extraneous files.
2010-11-17 02:04:36 -05:00
Lance Stout
26aca2b789
Merge branch 'roster' of github.com:fritzy/SleekXMPP into roster
...
Conflicts:
sleekxmpp/basexmpp.py
sleekxmpp/roster.py
sleekxmpp/test/sleektest.py
tests/test_stream_presence.py
tests/test_stream_roster.py
2010-11-17 02:01:12 -05:00
Lance Stout
5424ede413
More cleanup.
2010-11-17 01:54:30 -05:00
Lance Stout
20112f8e16
More docs!
2010-11-17 01:49:51 -05:00
Lance Stout
4260a754e5
Added more docs.
2010-11-17 01:49:51 -05:00
Lance Stout
ce30f72738
Added docs for main Roster class.
2010-11-17 01:49:51 -05:00
Lance Stout
69d430dd75
Cleaned up names.
2010-11-17 01:49:51 -05:00
Lance Stout
673545c7e4
First pass at integrating the new roster manager.
2010-11-17 01:49:19 -05:00
Nathan Fritz
45991e47ee
scheduler no longer waits for the next event before exiting
2010-11-16 17:58:20 -08:00
Nathan Fritz
b8f40eb843
xep_0199 ping now uses scheduler instead of dedicated thread
2010-11-16 17:43:05 -08:00
Florent Le Coz
b73a859031
Add a groupchat_subject event
...
Use this event to get notified of the subject changes (or to get the
subject of the room when joining one)
2010-11-10 05:54:22 +08:00
Florent Le Coz
9dbf246f0b
Doesn't fail if host has NO SRV record
...
Just catch an other exception type coming from the dns resolver that
could be raised with hosts like "anon.example.com" which just don't have
any SRV record.
2010-11-09 01:53:41 +08:00
Lance Stout
4fb77ac878
Logging no longer uses root logger.
...
Each module should now log into its own logger.
2010-11-06 01:28:59 -04:00
Lance Stout
d0c506f930
Simplified SleekTest.
...
* check_stanza does not require stanza_class parameter. Introspection!
* check_message, check_iq, and check_presence removed -- use check
instead.
* stream_send_stanza, stream_send_message, stream_send_iq, and
stream_send_presence removed -- use send instead.
* Use recv instead of recv_message, recv_presence, etc.
* check_jid instead of check_JID
* stream_start may accept multi=True to return a new SleekTest instance
for testing multiple streams at once.
2010-11-05 21:18:48 -04:00
Lance Stout
7351fe1a02
Fix bug introduced while fixing another bug.
...
Threaded event handlers now handle exceptions again.
2010-11-04 14:35:35 -04:00
Nathan Fritz
38c2f51f83
fixed indent errors
2010-11-04 11:39:41 -07:00
Lance Stout
1bf34caa5b
Fixes for XEP-0199 plugin.
...
Quick fixes to get the XEP-0199 plugin working until a proper cleanup is
done.
2010-11-03 14:04:18 -04:00
Lance Stout
5769935720
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2010-11-03 12:39:44 -04:00
Lance Stout
0214db7545
Catch exceptions for direct events.
...
Events triggered with direct=True will have exceptions caught.
Note that all event handlers in a direct event will currently run
in the same thread.
2010-11-03 12:38:13 -04:00
Lance Stout
ffc6f031d9
Updated namespaced used in the XEP-0199 plugin.
2010-11-03 12:37:26 -04:00
Lance Stout
9e248bb852
Fix bug in XEP-0030 plugin.
...
xep_0030 still referenced event_handlers. Added the method event_handled
which will return the number of registered handlers for an event to
resolve the issue.
2010-10-31 18:27:52 -04:00
Lance Stout
973890e2c9
Added try/except for setting signal handlers.
...
Setting signal handlers from inside a thread is not supported in Python,
but some applications need to run Sleek from a child thread.
SleekXMPP applications that run inside a child thread will NOT be able
to detect SIGHUP or SIGTERM events. Those must be caught and managed by
the main program.
2010-10-28 10:42:23 -04:00
Lance Stout
9c08e56ed0
SSL and signal fixes.
...
Made setting the SIG* handlers conditional on if the signal defined for
the OS.
Added the attribute ssl_version to XMLStream to set the version of SSL
used during connection. It defaults to ssl.PROTOCOL_TLSv1, but OpenFire
tends to require ssl.PROTOCOL_SSLv23.
2010-10-27 19:27:47 -04:00
Lance Stout
4f69a03bb1
More cleanup.
2010-10-27 15:02:21 -04:00
Lance Stout
c2c18acd6a
More docs!
2010-10-27 13:36:23 -04:00
Lance Stout
12ead36f96
Added more docs.
2010-10-27 10:51:58 -04:00
Lance Stout
41a642e06c
Added docs for main Roster class.
2010-10-27 09:27:00 -04:00
Lance Stout
c6ed4b8a1d
Cleaned up names.
2010-10-27 08:09:50 -04:00
Lance Stout
65aa6573df
First pass at integrating the new roster manager.
2010-10-26 23:47:17 -04:00
Lance Stout
b888610525
Added XEP-202 Entity Time plugin.
...
Contributed by Cesar Alcalde.
2010-10-25 21:26:25 -04:00
Lance Stout
6d68706326
Added XEP-0012 Last Activity plugin.
...
Contributed by Cesar Alcalde.
2010-10-25 20:37:02 -04:00
Lance Stout
5bdcd9ef9d
Made exceptions work.
...
Raising an XMPPError exception from an event handler now works, even if
from a threaded handler.
Added stream tests to verify.
We should start using XMPPError, it really makes things simple!
2010-10-25 15:09:56 -04:00
Lance Stout
ac330b5c6c
Fixed bug in presence subscription handling.
...
Subscription requests and responses were not setting the correct 'to'
attribute.
2010-10-25 12:52:32 -04:00
Lance Stout
185d7cf28e
More JID unit tests.
...
sleekxmpp.xmlstream.jid now has 100% coverage!
2010-10-24 19:06:54 -04:00
Lance Stout
8aa3d0c047
Fixed got_offline triggering bug.
2010-10-24 18:56:50 -04:00
Lance Stout
9e3d506651
Fixed resource bug in JIDs.
...
JIDs without resources will return '' instead of the bare JID.
Cleaned up JID tests, and added check_JID to SleekTest.
2010-10-24 18:22:41 -04:00
Lance Stout
2f3ff37a24
Make SleekTest streams register all plugins.
...
Makes test coverage nicer.
2010-10-24 17:35:11 -04:00
Lance Stout
1f09d60a52
ComponentXMPP saves all of its config data now.
...
ComponentXMPP was ignoring plugin_config and plugin_whitelist
parameters, making register_plugins() fail.
2010-10-24 17:33:11 -04:00
Lance Stout
d9aff3d36f
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2010-10-24 12:11:34 -04:00
Lance Stout
04cc48775d
Fixed error in client roster handling.
...
The roster result iq was not being passed to the roster update
handler.
2010-10-24 12:08:59 -04:00
Nathan Fritz
27ebb6e8f6
presence no longer replies when exception is caught and tweaks to presence events
2010-10-21 16:59:15 -07:00
Lance Stout
8f55704928
Fixed mixed text and elements bug in tostring.
...
XML of the form <a>foo <b>bar</b> baz</a> was outputted as
<a>foo <b>bar</b> baz baz</a>.
Includes unit test.
2010-10-21 16:21:28 -04:00
Nathan Fritz
d88999691c
misc small tweaks
2010-10-20 20:14:26 -07:00
Nathan Fritz
c4699b92e6
pep8 fixes on core library
2010-10-20 19:43:53 -07:00
Nathan Fritz
ce69213a1e
when disconnected, reset the roster
2010-10-20 19:33:40 -07:00
Nathan Fritz
77eab6544f
reconnect if session isn't established within 15 seconds
2010-10-20 19:18:27 -07:00
Nathan Fritz
11264fe0a8
capture SIGHUP and SIGTERM (windows) and disconnect; also testall no longer loads string26 with python3
2010-10-20 17:30:12 -07:00
Nathan Fritz
11a6e6d2e0
fixed logic error in state machine
2010-10-20 16:57:47 -07:00
Nathan Fritz
6e34b2cfdd
fixed disconnect
2010-10-20 16:32:50 -07:00
Lance Stout
e18354ae0e
Continue converting to underscored names.
2010-10-18 09:06:54 -04:00
Lance Stout
4375ac7d8b
Underscore names by default.
...
Stanza objects now accept the use of underscored names.
The CamelCase versions are still available for backwards compatibility,
but are discouraged.
The property stanza.values now maps to the old getStanzaValues and
setStanzaValues, in addition to _set_stanza_values and
_get_stanza_values.
2010-10-17 22:04:42 -04:00
Lance Stout
faec86b3be
Import plugins from string referenced modules.
2010-10-17 15:47:24 -04:00
Lance Stout
505a63da3a
Cleanup, restore PEP8.
2010-10-16 21:15:31 -04:00
Florent Le Coz
93fbcad277
Fix the error on non-number priority
...
The priority is not a number: we consider it 0 as a default
2010-10-17 09:01:53 +08:00
Florent Le Coz
3625573c7d
Default history is 0
2010-10-17 09:01:53 +08:00
Florent Le Coz
d9e7f555e6
MUC leave message and MUC history request
...
It is now possible to ask for "any number of history stanzas" when
joining a muc (with history=None).
Also we use "maxchars" when asking NO history ("0") since it's a MUST in
the XEP.
And you can specify a message when leaving a MUC.
2010-10-17 09:01:52 +08:00
Florent Le Coz
2755d732a4
Remove deprecation warnings
...
Remove all the deprecation warnings by using only boundjid.
And also fix a indentation error.
2010-10-17 08:55:30 +08:00
Florent Le Coz
2d18d905a5
Anonymous authentication
...
Implemented ANONYMOUS authentication on the ClientXMPP class.
To use it, you just need to provide a domain (e.g 'anon.example.com')
with an optional resource (e.g 'anon.example.com/resource') as the JID,
with no password. The JID class has been improved to accept
domains as fulljid.
You can test this with echo_client.py
python echo_client.py -j anon.louiz.org/ # anonymous with a resource
# defined by the server
python echo_client.py -j anon.louiz.org/resource # anonymous with given
# resource
The "normal" authentication method still works exactly like before.
2010-10-17 08:55:30 +08:00
Nathan Fritz
8b5c1010de
fixed JID to accept server/domain/host as the same
2010-10-14 16:34:16 -07:00
Nathan Fritz
95ad8a1878
fixed stream test not disconnecting cleanly
2010-10-14 16:27:44 -07:00
Nathan Fritz
aeb7999e6a
don't import statemachine
2010-10-14 16:08:50 -07:00
Nathan Fritz
8468332381
fixed stream tests
2010-10-14 15:53:10 -07:00
Nathan Fritz
dc001bb201
deprecated jid, fulljid, server, user, resource properties and added boundjid JID
2010-10-14 15:50:54 -07:00
Nathan Fritz
0d0b963fe5
fixed socket name collision in xmlstream.py and fixed python 3.x compatibility
2010-10-14 10:58:07 -07:00
Nathan Fritz
a41a4369c6
disconnect cleanly
2010-10-13 18:21:05 -07:00
Nathan Fritz
7ad7a29a8f
new state machine in place
2010-10-13 18:15:21 -07:00
Lance Stout
a8b948cd33
SleekTest may now run against a live stream.
...
Moved SleekTest to sleekxmpp.test package.
Corrected error in XML compare method.
Added TestLiveSocket to run stream tests against live streams.
Modified XMLStream to work with TestLiveSocket.
2010-10-07 19:43:51 -04:00
Lance Stout
e02ffe8547
Corrected test errors.
...
There was a bug in the XML compare method.
2010-10-07 19:42:28 -04:00
Lance Stout
42bfca1c87
Removed debug log statement.
2010-10-07 19:41:33 -04:00
Lance Stout
0fffbb8200
Unit test reorganization.
...
Moved SleekTest to sleekxmpp.test.
Organized test suites by their focus.
- Suites focused on testing stanza objects are named test_stanza_X.py
- Suites focused on testing stream behavior are name test_stream_X.py
2010-10-07 10:58:13 -04:00
Lance Stout
21c32c6e1c
Moved the pubsub tester to conn_tests.
2010-10-07 10:28:38 -04:00
Lance Stout
78141fe5f3
Fixed dealing with deleting handlers.
...
The call to .index() may raise a ValueError if the item is not in the
list. So both the .index() and .pop() calls should be in the try block.
2010-10-07 09:17:28 -04:00
Lance Stout
799645f13f
Updated method names.
...
Using underscored names where possible.
2010-10-06 18:45:11 -04:00
Lance Stout
c294c1a85c
More PEP8 compliance cleanups.
...
Cleaned up the atom entry stanza.
2010-10-06 15:12:39 -04:00
Lance Stout
cbe76c8a70
Cleaned up the Scheduler.
2010-10-06 15:03:21 -04:00
Lance Stout
77b8f0f4bb
Fixed whitespace issue.
2010-10-06 14:31:33 -04:00
Lance Stout
ed366b338d
Moved ClientXMPP to clientxmpp.py.
...
Cleaned up the __init__.py files.
2010-10-06 14:20:32 -04:00
Lance Stout
9e2cada19e
Missed a few docstrings.
2010-10-06 14:09:14 -04:00
Lance Stout
d0ccbf6b7a
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2010-10-06 14:06:02 -04:00
Lance Stout
e1866ab328
Made first pass at cleaning up ClientXMPP.
...
Added self.stream_ns to BaseXMPP.
Moved connected/disconnected events and logging to XMLStream.
2010-10-06 14:03:19 -04:00
fritzy
3ffa09ba7c
deal with deleting handlers that are no longer there
2010-10-06 17:58:03 +00:00
Lance Stout
a7410f2146
Made a first pass at cleaning up ComponentXMPP.
2010-10-06 10:47:05 -04:00
Lance Stout
178608f4c0
XMLStream cleanup.
...
Added RestartStream as a top level item in sleekxmpp.xmlstream.
Fixed trailing whitespace.
2010-10-06 10:45:36 -04:00
Lance Stout
9f0baec7b2
Made first pass at cleaning BaseXMPP.
...
Have not intregrated the new JID class yet.
2010-10-01 23:56:46 -04:00
Lance Stout
433c147627
Fixed typo in XEP-0033 plugin.
2010-10-01 21:25:27 -04:00
Lance Stout
9a34c9a9a1
Modified event handling to use the event queue.
...
Updated tests to match. (Needed to add a small wait to make sure
the event got through the queue before checking the results.)
2010-10-01 13:49:58 -04:00
Lance Stout
2662131124
Fixed tostring bug when using mapped namespaces.
2010-10-01 12:41:35 -04:00
Lance Stout
bb219595a7
Moved event functions to XMLStream.
...
This is just a transplant, modifying event to use the main
event queue has not been implemented yet.
2010-10-01 12:24:49 -04:00
Lance Stout
fcdd57ce54
Moved add_handler, send, and sendXML to XMLStream.
2010-10-01 11:15:51 -04:00
Lance Stout
5522443e0e
Moved getNewId and getId to XMLStream.
...
This prepares the way for moving add_handler to XMLStream.
Since stanzas, matchers, and handlers in any XML stream will typically
use unique IDs, XMLStream is a good place for these methods.
2010-10-01 10:46:37 -04:00
Lance Stout
55cfe69fef
Cleaned up trailing whitespace.
2010-10-01 10:09:10 -04:00
Lance Stout
6de87a1cbf
Fixed line lengths and trailing whitespace.
...
The pep8 command is now pleased.
2010-09-30 13:06:16 -04:00
Lance Stout
7c10ff16fb
Made a first pass at cleaning up XMLStream.
...
A few extra methods are mentioned in the docs, but those have not
been moved to XMLStream from BaseXMPP yet.
2010-09-30 12:56:22 -04:00
Nathan Fritz
c258d2f19d
added room events for specific rooms, added buildForm to xep_0004 plugin
2010-09-23 00:51:23 +00:00
fritzy
d576e32f7a
Merge branch 'develop' of git@github.com:fritzy/SleekXMPP into develop
2010-09-02 20:01:28 +00:00
Lance Stout
9bef4b4d4d
Move the examples to a top-level examples directory.
2010-09-01 14:47:42 -04:00
Lance Stout
5c3066ba30
Updated all of the matcher classes in sleekxmpp.xmlstream.matcher.
...
Matchers are now PEP8 compliant and have documentation.
2010-09-01 14:28:43 -04:00
Lance Stout
576eefb097
Fixed line spacing in filesocket.py to please pep8.
2010-09-01 14:25:30 -04:00
Lance Stout
aebd115ba2
A few cleanups to make things simpler.
2010-09-01 14:20:34 -04:00
fritzy
6dfea828be
xep-0004 merge should deal with dictionaries
2010-08-31 14:44:24 +00:00
Lance Stout
3749c1b88c
Fixed ElementBase.match to match using sub_interface elements.
2010-08-30 17:12:10 -04:00
Lance Stout
998741b87e
Fixed typos in ElementBase._fix_ns
2010-08-30 15:25:59 -04:00
Lance Stout
9c62bce206
Updated ElementBase.match to respect namespaces with slashes.
...
Required adding option to _fix_ns to not propagate namespaces to child elements.
2010-08-30 14:55:30 -04:00
Lance Stout
f5ae27da4f
Fix some documentation typos.
2010-08-27 18:16:09 -04:00
Lance Stout
89fb15e896
Updated the suite of handler classes with documentation.
...
Updated XMLStream to return True or False from removeHandler to indicate if the handler
existed and was removed.
Waiter handlers now unregister themselves after timing out.
2010-08-27 16:42:26 -04:00
Lance Stout
bb6f4af8e2
Added unit tests for StanzaBase.
2010-08-27 12:22:35 -04:00
Lance Stout
6677df39f2
Updated xmlstream.filesocket.
2010-08-27 11:29:48 -04:00
Lance Stout
a2c515bc97
Updated StanzaBase with documentation.
2010-08-27 11:07:20 -04:00
Lance Stout
ca6ce26b0d
Added comments to _fix_ns to clarify the cleaning procedure.
2010-08-26 18:40:58 -04:00
Lance Stout
00d7952001
Fixed ElementBase._fix_ns and related methods to respect namespaces which contain forward slashes.
2010-08-26 18:18:00 -04:00
Lance Stout
56766508b3
Fixed indentation in StanzaBase.
2010-08-26 14:19:36 -04:00
Lance Stout
5c59f5baca
Clarify ElementBase documentation.
2010-08-26 14:07:09 -04:00
Lance Stout
e16b37d2be
Fixed line lengths in ElementBase to comply with PEP8.
2010-08-26 13:55:23 -04:00
Lance Stout
d68bc2ba07
Finished the update of ElementBase with docs and unit tests.
...
Corrected bugs in equality comparisons between stanzas.
2010-08-26 13:49:36 -04:00
Lance Stout
10298a6eab
Updated the remaining ElementBase methods.
...
Remaining ElementBase todos:
Write the class documentation for ElementBase.
Write unit tests for the __magic__ methods.
2010-08-26 10:08:22 -04:00
Lance Stout
a3580dcef9
Fixed ElementBase.match to respect namespaces.
2010-08-25 14:54:09 -04:00
Lance Stout
1eaa9cb28c
Updated ElementBase.match and added unit tests.
2010-08-25 14:40:16 -04:00
Lance Stout
5d458bf6c2
Updated ElementBase._delSub and added unit tests.
...
_delSub can now accept a path and will optionally remove any empty parent elements after deleting the target elements.
2010-08-25 10:52:07 -04:00
Lance Stout
2fa58a74ab
Fixed indenting issue.
2010-08-24 09:44:09 -04:00
Lance Stout
c8f406d1b3
Updated ElementBase._setSubText and added unit tests.
...
_setSubText can now handle elements specified by an XPath expression, and
will build up the element tree as needed, reusing an existing elements in
the path.
2010-08-24 09:37:42 -04:00
Lance Stout
203986dd7c
Updated ElementBase._getSubText and added unit tests.
...
Also added ElementBase._fix_ns() to apply the stanza namespace to elements that don't have a namespace.
2010-08-24 08:55:37 -04:00
fritzy
f4ecf0bac4
fixed a but in stanza_pubsub
2010-08-22 06:08:48 +00:00
fritzy
345656926e
added form compatibility with old api, stanzas now bool() to True on 2.x, jid attributes will return '' if not set
2010-08-21 22:48:43 +00:00
Nathan Fritz
c05ddcb7f5
Merge branch 'develop' of git@github.com:fritzy/SleekXMPP into develop
2010-08-19 19:54:09 -07:00
Nathan Fritz
eb9e72fe3e
added some xep-0004 compatibility changes
2010-08-19 19:53:56 -07:00
Lance Stout
8a0616b3e0
Updated ElementBase methods _getAttr, _setAttr, and _delAttr with docs and tests.
2010-08-19 20:41:26 -04:00
Lance Stout
b71cfe0492
Small cleanup in ElementBase.__setitem__
2010-08-19 19:14:18 -04:00
Lance Stout
fac3bca1f6
Updated ElementBase.__delitem__ and added unit tests.
2010-08-19 19:11:12 -04:00
Nathan Fritz
d150b35464
fixed todo merge
2010-08-19 16:09:47 -07:00
Nathan Fritz
21b7109c06
fixed jobs
2010-08-19 16:09:00 -07:00
Lance Stout
e4240dd593
Updated ElementBase.__setitem__ and added unit tests.
2010-08-19 14:21:58 -04:00
Lance Stout
2f6f4fc16d
Updated ElementBase.__getitem__ with docs and unit tests.
2010-08-13 21:33:11 -04:00
Lance Stout
fe49b8c377
Updated getStanzaValues and setStanzaValues with docs and unit tests.
2010-08-13 20:05:24 -04:00
Lance Stout
b580a3138d
Updated ElementBase.enable and ElementBase.initPlugin
2010-08-13 12:51:07 -04:00
Lance Stout
c20fab0f6c
Updated ElementBase.setup, and added unit tests.
2010-08-13 12:24:47 -04:00
Lance Stout
415520200e
Updated ElementBase.__init__
2010-08-13 10:26:33 -04:00
Lance Stout
747001d33c
Adjust first level indenting in ElementBase to prepare for cleanup.
2010-08-13 10:15:52 -04:00
Lance Stout
b0fb205c16
Updated registerStanzaPlugin and the XML test type.
2010-08-13 10:12:51 -04:00
Lance Stout
4b52007e8c
Cleaned stanzabase imports.
2010-08-12 23:24:09 -04:00
Lance Stout
b40a489796
Updated roster stanza with docs and PEP8 style.
2010-08-11 23:32:14 -04:00
Lance Stout
c09e9c702c
Updated sleekxmpp.exceptions with PEP8 style and docs.
2010-08-11 18:21:12 -04:00
Lance Stout
4d1f071f83
Updated the use of tostring in xmlstream.py
...
Now uses the xmlns and stream parameters to reduce the number of
extra xmlns attributes used in the logging output.
Added self.default_ns to XMLStream just to be safe.
2010-08-05 23:11:22 -04:00
Lance Stout
3c0dfb56e6
Update tostring docs to clarify what the xmlns and stanza_ns parameters do.
2010-08-05 20:43:38 -04:00
Lance Stout
e077204a16
Replaced the ToString class with a tostring function.
...
The sleekxmpp.xmlstream.tostring and sleekxmpp.xmlstream.tostring26 packages
have been merged to sleekxmpp.xmlstream.tostring. The __init__.py file will
import the appropriate tostring function depending on the Python version.
The setup.py file has been updated with the package changes.
ElementBase is now a direct descendent of object and does not subclass ToString.
Stanza objects now return their XML contents for __repr__.
2010-08-05 20:26:41 -04:00
Lance Stout
c54466596f
Modified sleekxmpp.xmlstream.tostring to import ToString class based on Python version.
...
The package sleekxmpp.xmlstream.tostring26 remains for now until stanzabase is updated, but is no longer needed.
2010-08-04 14:41:37 -04:00
Lance Stout
aa1dbe97e0
Updated and simplified new JID class to have more documentation and use PEP8 style.
2010-08-04 00:33:28 -04:00
Lance Stout
fec69be731
Update nick stanza with documentation and PEP8 style.
2010-08-03 18:32:53 -04:00
Lance Stout
183a3f1b87
Updated XHTML-IM stanza with documentation and PEP8 style.
2010-08-03 17:58:18 -04:00
Lance Stout
41ab2b8460
Updated presence stanza with documentation and PEP8 style.
2010-08-03 17:30:34 -04:00
Lance Stout
939ae298c2
Updated message stanzas and tests with documentation and PEP8 style.
2010-08-03 12:26:36 -04:00
Lance Stout
1cedea2804
Added optional default value to _getAttr.
2010-07-30 14:11:24 -04:00
Lance Stout
cbed8029ba
Updated, cleaned, and documented Iq stanza class. Also added unit tests.
2010-07-29 23:58:25 -04:00
Lance Stout
1da3e5b35e
Added unit tests for error stanzas. Corrected error in deleting conditions.
2010-07-29 23:55:13 -04:00
Lance Stout
60a183b011
Added useful imports to the xmlstream, xmlstream.handler, and xmlstream.matcher __init__.py files to make it simpler to import common classes.
2010-07-29 20:18:04 -04:00
Lance Stout
a49f511a2f
Added RESPONSE_TIMEOUT constant to sleekxmpp.xmlstream to serve as a single place to specify a default timeout value when waiting for a stanza response.
2010-07-29 20:16:57 -04:00
Lance Stout
25f43bd219
Updated error stanza to be PEP8 compliant and include documentation.
2010-07-29 11:06:10 -04:00
Lance Stout
d148f633f3
Modified ElementBase _getSubText, _setSubText, and _delSubText to
...
use the namespace in a tag name if one is given and to use
self.namespace otherwise.
2010-07-29 11:04:21 -04:00
Lance Stout
e8e934fa95
Fixed some PEP8 errors in RootStanza (trailing whitespace and line length)
2010-07-29 11:02:42 -04:00
Lance Stout
bd92ef6acf
Updated RootStanza to use registerStanzaPlugin, and be PEP8 compliant.
2010-07-28 13:14:41 -04:00
Nathan Fritz
2b6454786a
Merge branch 'experimental' of git@github.com:fritzy/SleekXMPP into experimental
2010-07-26 18:13:54 -07:00
Nathan Fritz
a349a2a317
removed jid from stanzabase to external file
2010-07-26 18:13:34 -07:00
Nathan Fritz
2cb82afc2c
updated and moved jid class -- jids now have setters
2010-07-26 18:13:09 -07:00
Lance Stout
c8989c04f3
Replaced traceback calls to use logging.exception where applicable.
2010-07-26 21:02:25 -04:00
Lance Stout
ec860bf9e2
Add StateManager as replacement for StateMachine.
2010-07-26 19:44:42 -04:00
Lance Stout
d0a5c539d8
Fix shebang lines to use #!/usr/bin/env python instead of hard coding a python version.
2010-07-23 19:47:54 -04:00
Joe Hildebrand
d70a6e6f32
Issue 26. Only set from address in reply() for components
2010-07-20 13:55:48 -07:00
Nathan Fritz
ca2c421e6c
fixed resource binding element to conform to spec
2010-07-20 11:20:47 -07:00
Nathan Fritz
9fcd2e93a3
don't send resource in bind request if you don't have one
2010-07-20 11:15:59 -07:00
Lance Stout
75afefb5c6
Upated xep_0045 to use old_0004 for now.
2010-07-20 13:23:35 -04:00
Lance Stout
b67b930596
Updated xep_0050 to use old_0004 for now.
2010-07-20 12:27:22 -04:00
Lance Stout
7ad0143687
Updated pubsub stanzas to use xep_0004 stanza objects, and updated tests to match.
2010-07-20 12:18:38 -04:00
Lance Stout
de24e9ed45
Lots of XEP-0004 bug fixes.
...
Forms have default type of 'form'
setFields now uses a list of tuples instead of a dictionary because ordering is important.
getFields defaults to returning a list of tuples, but the use_dict parameter can change that
2010-07-20 12:16:57 -04:00
Lance Stout
9724efa123
Please tab nanny.
2010-07-20 12:16:06 -04:00
Lance Stout
690eaf8d3c
Updated license notices to use the correct MIT format. Also corrected references to nonexistant license.txt to LICENSE.
2010-07-20 11:19:49 -04:00
Lance Stout
9ca4bba2de
Update XEP-0128 to use new xep_0004
2010-07-20 00:34:24 -04:00
Lance Stout
bb927c7e6a
Updated presence stanza to include a 'show' interface. Presence stanza tests updated accordingly.
2010-07-20 00:04:34 -04:00
Lance Stout
b5a14a0190
Can now pass a name to add_handler so that the handler can be reliably removed later.
...
Updated uses of add_handler to include a name.
2010-07-19 19:19:33 -04:00
Nathan Fritz
fec8578cf6
stanza should not have setValues/getValues because that conflicts with attribute accessors
2010-07-19 15:38:48 -07:00
Nathan Fritz
f80b3285d4
indent problem on stanzabase
2010-07-19 14:57:21 -07:00
Nathan Fritz
130a148d34
added fromXML/getXML compatiblity to the new xep-0004 w/ deprecated warnings
2010-07-19 13:53:41 -07:00
Nathan Fritz
16104b6e56
made Lance's new XEP-4 stanzas the default, and put xep-0004 as old_0004
2010-07-19 13:36:28 -07:00
Lance Stout
d5e42ac0e7
Condensed all of the stanzaPlugin functions into a single registerStanzaPlugin function.
...
Updated plugins and tests to use new function.
2010-07-19 13:58:53 -04:00
Lance Stout
e6bec8681e
Added implementation for XEP-0128 Service Discovery Extensions.
...
Uses the alt_0004 plugin for jabber❌ data stanza objects.
2010-07-19 04:22:31 -04:00
Lance Stout
797e92a6a3
Fixed error in updateRoster when the name keyword parameter is left out.
...
The Roster stanza object builds item elements manually, and did not handle the
case where the name attribute is set to None, which would crash SleekXMPP.
2010-07-19 04:12:54 -04:00
Lance Stout
1ef112966b
Merge branch 'develop' of git://github.com/fritzy/SleekXMPP into develop
2010-07-19 04:02:28 -04:00
Nathan Fritz
078c71ed3f
accidental debugging return left in the code from last commit
2010-07-15 14:25:10 -07:00
Nathan Fritz
bae082f437
fixed updateRoster and delRosterItem
2010-07-15 11:53:35 -07:00
Lance Stout
48f0843ace
Added initial stanza object version of the xep_0004 plugin. Items/reported elements still need to be unit tested
2010-07-14 11:59:58 -04:00
Lance Stout
b1c997be1d
Reworked the Gmail notification plugin to use stanza objects and expose more information.
2010-07-11 22:01:51 -04:00
Lance Stout
d0cb400c54
Fixed tabs to please tab nanny.
2010-07-11 21:43:51 -04:00
Lance Stout
37ada49802
Fixed indentation to please tab nanny during unit tests.
2010-06-27 17:39:16 -04:00
Lance Stout
059cc9ccc4
Fixed several errors in xep_0033 plugin.
...
The method getAddresses was removing addresses by mistake.
Several instances of using self.attrib instead of self.xml.attrib.
2010-06-27 17:32:16 -04:00
Lance Stout
309c9e74eb
Fixed error in setState() method.
2010-06-27 16:34:48 -04:00
Lance Stout
6041cd1952
Fixed typo
2010-06-27 16:33:59 -04:00
Lance Stout
acb53ba371
Fixed tab and spacing issue to please the Tab Nanny during unit tests.
2010-06-27 10:14:21 -04:00
Lance Stout
646a609c0b
Added plugin and tests for XEP-0033, Extended Stanza Addresses.
...
XEP-0033 can be useful for interacting with XMPP<->Email gateways.
2010-06-22 23:22:50 -04:00
Lance Stout
8bb0f5e34c
Needed to use copy.deepcopy() to copy XML objects to make sure that the entire tree is copied.
2010-06-07 19:55:39 -04:00
Lance Stout
3c939313d2
Modified basexmpp.event() to pass a copy of the event data to each handler.
2010-06-06 23:19:07 -04:00
Lance Stout
9962f1a664
Added a __copy__ method to both ElementBase and StanzaBase.
...
Stanzas may now be copied using copy.copy(), which will be useful to prevent
stanza objects from being shared between event handlers.
2010-06-06 23:12:54 -04:00
Lance Stout
253de8518c
Modified xmlstream.py to pass a clean stanza object to each stream handler.
...
The previous version passed the same stanza object to each registered handler,
which can cause issues when the stanza object is modified by one handler. The next
handler receives the stanza with the modifications, not the original stanza.
2010-06-03 22:56:57 -04:00
Nathan Fritz
a38735cb2a
added very, very, very basic atom stanza
2010-06-02 15:54:44 -07:00
Lance Stout
e700a54d11
Return result of iq.send() for disco requests. Events are still triggered, but now the caller can determine if there was a timeout.
2010-06-02 15:59:10 -04:00
Lance Stout
6469cdb4ca
Merge branch 'develop' of git://github.com/fritzy/SleekXMPP into develop
2010-06-02 15:57:18 -04:00
Nathan Fritz
18e27d65ce
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
2010-06-01 21:45:15 -07:00
Nathan Fritz
0c39567f20
hack fix for session before bind
2010-06-01 21:44:54 -07:00
Nathan Fritz
f5491c901f
if binding and session are advertised in the same go, do session first
2010-06-01 21:40:52 -07:00
Lance stout
f5cae85af5
Make sure that the id parameter used in xmpp.makeIq is converted to a string.
...
Otherwise, SleekXMPP will barf on trying to serialize an integer when it expects text.
2010-06-01 10:52:37 -04:00
Lance stout
01e8040a07
Added additional parameter to xep_0030's getInfo and getItems methods.
...
By using dfrom, a server component may send disco requests using any of its JIDS.
2010-06-01 10:51:03 -04:00
Nathan Fritz
aa916c9ac8
included jobs plugin
2010-05-31 13:57:39 -07:00
Lance stout
332eea3b3b
Make sure that the node is alway set in disco responses.
2010-05-31 13:35:15 -04:00
Lance stout
109af1b1b6
Merge branch 'xep_0085' into develop
2010-05-31 13:31:11 -04:00
Lance stout
629f6e76a9
Added implementation and tests for XEP-0085 - Chat State Notifications.
...
Chat states may be set using:
msg['chat_state'].active()
msg['chat_state'].composing()
msg['chat_state'].gone()
msg['chat_state'].inactive()
msg['chat_state'].paused()
Checking a chat state can be done with either:
msg['chat_state'].getState()
msg['chat_state'].name
When a message with a chat state is receieved, the following events
may occur:
chatstate_active
chatstate_composing
chatstate_gone
chatstate_inactive
chatstate_paused
where the event data is the message stanza. Note that currently these
events are also triggered for messages sent by SleekXMPP, not just those
received.
2010-05-31 13:24:14 -04:00
Nathan Fritz
82a3918aa4
Scheduler waits too longer, and pubsubstate registration was backwards
2010-05-31 03:36:25 -07:00
Lance stout
cff3079a04
Added missing 'internal-server-error' condition to error stanza interface.
2010-05-31 05:30:50 +08:00
Lance stout
4f864a07f5
Touched up the style of creating an Iq stanza.
2010-05-31 05:30:49 +08:00
Lance stout
938066bd50
Added 'resource-constraint' to the list of error conditions.
2010-05-31 05:30:48 +08:00
Lance Stout
fd573880eb
Updated the XEP-0030 plugin to work with stanza objects instead of manipulating XML directly.
...
Four new events have been added:
disco_info - A disco#info result has been received
disco_info_request - A disco#info request has been received
disco_items - A disco#items result has been received
disco_items_request - A disco#items request has been received
For disco_info_request and disco_items_request two default handlers are registered. These handlers will only run if they are the only handler for these two events so that multiple responses are not returned and cause errors.
In your own handlers for these two events, you can call the default handlers to preserve the static node behaviour as so:
self.plugin['xep_0030'].handle_disco_info(iq, True)
The forwarded=True will disable the check for other registered handlers.
Agents can now dynamically respond to disco requests by using these events.
(cherry picked from commit 0fc3381492a8bd75e6a9858539a972334881d8ff)
2010-05-31 05:30:45 +08:00
Nathan Fritz
2f1ba368e2
control-c fixes
2010-05-28 19:19:28 -07:00
Nathan Fritz
3a28f9e5d2
added pubsub state stanzas and scheduled events
2010-05-27 04:58:57 -07:00
Nathan Fritz
0bda5fd3f2
adding scheduler
2010-05-26 18:32:28 -07:00
Nathan Fritz
fa92bc866b
fixed dns unicode problem
2010-05-26 11:37:01 -07:00
Nathan Fritz
f4bc9d9722
plugins now are checked for post_init having ran when process() is called
2010-05-26 10:51:51 -07:00
Hernan E Grecco
f18c790824
Fixed error registering a plugin. To add a feature to another plugin, it should look into xmpp.plugin dict
2010-05-26 06:49:01 +08:00
Nathan Fritz
f165b4b52b
Merge branch 'master' of git@github.com:fritzy/SleekXMPP
2010-05-24 19:34:49 -07:00
Nathan Fritz
7ebc006516
updated README, index fix for component
2010-05-24 19:33:24 -07:00
Lance Stout
5ca4ede5ac
Added a flag to registerPlugin to control calling the plugin's post_init method.
2010-05-25 07:28:48 +08:00
Lance Stout
35f4ef3452
Modified the return values for several methods so that they can be chained.
...
For example:
iq.reply().error().setPayload(something.xml).send()
2010-05-25 07:28:43 +08:00
Lance Stout
828cba875f
Added the error attribute 'code' to the Error object interface.
2010-05-25 07:28:43 +08:00
Nathan Fritz
3920ee3941
added plugin indexing to components
2010-05-24 14:27:13 -07:00
Lance Stout
c004f042f9
Added del_event_handler to remove handler functions for a given event.
...
All registered handlers for the event which use the given function will
be removed.
Using this method allows agents to reconfigure their behaviour on the fly
without needing to add extra state information to event handling functions.
2010-05-21 03:54:48 +08:00
Nathan Fritz
ae41c08fec
added test for unsolicided unavailable presence and fixed bug to make it pass
2010-05-12 18:07:20 -07:00
Nathan Fritz
223507f36f
fixed a rather large memory leak
2010-05-12 13:45:36 -07:00
Nathan Fritz
8515cef117
refactored presence tracking and fixed jidInRoom
2010-05-11 15:12:13 -07:00
Nathan Fritz
c4fa3ab654
pubsub test work
2010-04-23 01:34:28 -07:00
Nathan Fritz
602a6d8491
bugfixes and continuing to work on pubsub tests
2010-04-22 21:24:28 -07:00
Nathan Fritz
37b571c55a
added pubsub#event stanzas, multi-subtypes iterable stanzas, pubsub#event test coverage
2010-04-21 23:51:37 -07:00
Nathan Fritz
2a30e3fe0c
started work on pubsub#event stanzas
2010-04-20 00:53:13 -07:00
Nathan Fritz
212660091f
added pubsub tests and fixed match on iterator error
2010-04-19 01:03:27 -07:00
Nathan Fritz
35c157f9d8
changed_status event now happens with got_offline/got_online events
2010-04-18 21:16:47 -07:00
Nathan Fritz
80e7e0d0ee
adding tests, fixed stanzapath matching to match keys, fixed pubsub#owner stanzas
2010-04-14 01:23:17 -07:00
Nathan Fritz
2f9f649d98
bugfix for .disconnect() hanging
2010-04-13 19:48:35 -07:00
Nathan Fritz
fef511fd51
bugfix for .disconnect() hanging
2010-04-13 19:35:47 -07:00
Matthias Rieber
85c3d97d2a
fixed presence stanza. priority can be set.
2010-04-08 15:15:15 +08:00
Nathan Fritz
2384858f5e
fixed html-im stanza plugin
2010-04-07 23:56:44 -07:00
Nathan Fritz
dd77d2165d
added missing docstrings to tests and added deprecated warning to basexmpp.send when using xml mask waiting
2010-04-07 23:32:15 -07:00
Nathan Fritz
ecd5a172ed
replaced usage of deprecated iq result on send. Fixed old send result to use stanzas instead of ElementTree
2010-04-07 23:10:32 -07:00
Nathan Fritz
935ee4d14e
changed license to MIT
2010-03-26 14:32:16 -07:00
Nathan Fritz
bf5dc0f7b8
closed bug #8 -- double auth response
2010-03-26 14:02:10 -07:00
Nathan Fritz
ec97c351de
fixed bug #7 -- muc roster leak
2010-03-26 13:59:29 -07:00
Nathan Fritz
0fc9072e5d
fixed bug #16 Roster not updating
2010-03-26 13:55:03 -07:00
Nathan Fritz
0659ddeff0
added memleak test and attempted to fix presence leak
2010-03-26 13:27:13 -07:00
Nathan Fritz
7383f72367
stanzabase indent fix
2010-03-24 17:18:39 -07:00
Nathan Fritz
95d2614f21
fix for bug #18
2010-03-24 16:03:16 -07:00
Nathan Fritz
d4a490e3f0
fixed xmlstream filesocket issue
2010-03-15 10:19:45 -07:00
Nathan Fritz
c239fb1f90
added muc functionality
2010-03-04 09:47:42 -08:00
Nathan Fritz
8d5dbfa691
fixed some presence bugs
2010-02-27 02:02:08 +00:00
Nathan Fritz
e06cdec81a
fixed some unicode problems for 2.6
2010-02-25 01:12:15 +00:00
Nathan Fritz
ed60867a63
Merge branch 'develop'
2010-02-15 21:44:50 -08:00
Nathan Fritz
0dcbe92d1e
got rid of stupid iq set/get/error/result methods
2010-02-15 21:42:27 -08:00
Nathan Fritz
ac1d76b23d
tweaked presence handler
2010-02-15 15:45:57 -08:00
Nathan Fritz
58375955a9
added send queueing to avoid mixed sending
2010-02-15 02:13:44 -08:00
Nathan Fritz
06fa1fcf33
Merge branch 'develop'
2010-01-29 23:58:14 -08:00
Nathan Fritz
5e736f4b97
fixed setup.py issue with unicode in 3.x
2010-01-29 23:57:57 -08:00
Nathan Fritz
4d87098590
Merge branch 'develop'
2010-01-29 02:12:45 -08:00
Nathan Fritz
23b9930c44
added separate tostring files
2010-01-29 02:11:45 -08:00
Nathan Fritz
395618d3d3
fixed unicode problems in 2.6
2010-01-29 02:04:15 -08:00
Nathan Fritz
8ad32d2065
Merge branch 'master' of git@github.com:fritzy/SleekXMPP
2010-01-27 19:38:31 -08:00
Nathan Fritz
167bf70e0b
fixed status change issue
2010-01-27 19:37:26 -08:00
Nathan Fritz
f159328dc4
Merge branch 'master' of github.com:fritzy/SleekXMPP
2010-01-27 15:09:45 -08:00
Nathan Fritz
a4ec7413e4
fixed 2.6 compatibility for componentxmpp
2010-01-27 15:09:23 -08:00
Nathan Fritz
65dd83d4e1
Merge branch 'master' of github.com:fritzy/SleekXMPP
2010-01-25 10:40:50 -08:00
Nathan Fritz
6e4c1128ec
removed stupid monkeypatch for filesocket
2010-01-25 10:40:44 -08:00
Nathan Fritz
3dbd496de8
fixed presence['type'] w/ show value bug and added test to prove
2010-01-23 01:08:21 -08:00
Nathan Fritz
6b130eb947
unhandled iq's should only respond to errors when type=get/set
2010-01-20 01:42:53 -08:00
Nathan Fritz
7a9a86af3d
fixed matcher bug introduced with stanza matching
2010-01-15 21:36:53 -08:00
Nathan Fritz
e39a2395d7
xep 30 and 50 always reply from jid iq sent to
2010-01-15 21:07:28 -08:00
Nathan Fritz
5345e9a46b
fixed bug from duplicate append methods in stanzabase
2010-01-14 07:37:44 -08:00
Nathan Fritz
6e1aa0690f
Completed basic test coverage of xmlns http://jabber.org/protocol/pubsub stanzas
2010-01-13 09:04:05 -08:00
Nathan Fritz
d14045f5a6
added stanza.get(key, defaultvalue)
2010-01-09 13:17:08 -08:00
Nathan Fritz
2193d5c962
added filesocket.py for 2.6 compatibility
2010-01-08 07:45:26 -08:00
Nathan Fritz
13d7328886
muc message stanza enhancements
2010-01-08 23:08:12 +00:00
Nathan Fritz
218c7318e0
* added tests
2010-01-08 07:01:19 +00:00
Nathan Fritz
137ef61523
* fix to xep 78
2010-01-08 06:06:44 +00:00
Nathan Fritz
a8ff3586d3
* python 2.6 compatibility
2010-01-08 06:03:02 +00:00
Nathan Fritz
0af468b435
* fixed stanza.keys()
2010-01-08 05:26:37 +00:00
Nathan Fritz
8e3168e145
* added first stanza tests
...
* added stanza.keys()
* stanza.getValues() now return substanzas and plugins
* stanza.setValues() now can read substanzas and plugins
* stanzas can now be iterable if stanza.subitem is set to a class
2010-01-08 01:45:11 +00:00
Nathan Fritz
b54221f2a9
* pubsub#owner and pubsub namespace stanzas written
2010-01-07 23:52:52 +00:00
Nathan Fritz
093644ffbd
* major stanza improvements
...
* raise XMPPError in handler to reply with error stanza
* started work on pubsub stanzas
2010-01-05 21:56:48 +00:00
Nathan Fritz
805afa4bc1
* fixed unhandled iqs
2009-12-22 10:05:53 +00:00
Nathan Fritz
07018c0afa
* fixed many stanza bugs
...
* added stanza unhandled (unhandled iqs now reply with feature-not-implemented)
* added stanza exceptions (stanzas may now reply with exceptions when their handler raises an exception)
2009-12-17 01:54:22 +00:00
Nathan Fritz
6897a0b57c
* added error, htmlim, roster, and nick stanza plugins
2009-12-15 04:37:10 +00:00
Nathan Fritz
ca044a4934
makeMessage and makePresence now use new stanza classes
...
fixed component usage of stanzas
2009-12-15 04:31:46 +00:00
Nathan Fritz
8854509ccd
* started converstion to stanza objects
2009-12-11 01:29:46 +00:00
Nathan Fritz
a031dd24a6
tweaked stanzas for easy use
2009-12-10 07:33:59 +00:00
Nathan Fritz
007b04dd30
* added proper message and iq stanzas. presence left to do
2009-12-10 01:23:03 +00:00
Nathan Fritz
6be17ebbe2
* clean up offline contacts
2009-11-11 03:14:16 +00:00
Nathan Fritz
1fa1f7dcc6
* added init option for component namespace
2009-10-29 03:22:50 +00:00
Nathan Fritz
a22100bb38
* namespace tweak for components
2009-10-29 03:12:32 +00:00
Nathan Fritz
44aa526635
* fixed bugs with XEP 50 for components
...
* configuration-less nodes
2009-10-29 02:34:23 +00:00
Nathan Fritz
8dbf53594b
* fixed bug with setting boolean values in forms
...
* added setValues to forms
2009-10-27 01:05:30 +00:00
Nathan Fritz
f84f02acff
x:data form improvements
2009-10-19 08:35:15 +00:00
Nathan Fritz
e3a5211b6d
* fixes
2009-10-19 05:27:00 +00:00
Nathan Fritz
14331e2c96
* added form update
2009-10-19 05:18:36 +00:00
Nathan Fritz
349b1c0b28
* added form merging
2009-10-19 05:16:43 +00:00
Nathan Fritz
a18051c164
* fixed type-o
2009-10-05 18:18:37 +00:00
Nathan Fritz
5dc967a360
removed apply()s from xep 50
2009-10-05 17:44:59 +00:00
Nathan Fritz
2349f849e3
bugfixes
2009-09-25 17:35:10 +00:00
Nathan Fritz
e59d43ff3e
* fixed unavailable status in sendPresence
...
* fixed jabber:client filtering for components
2009-09-15 18:42:47 +00:00
Nathan Fritz
cb360c9479
* fixes
2009-09-05 07:38:29 +00:00
Nathan Fritz
5593848490
* gmail plugin now works in python3
2009-09-01 17:27:39 +00:00
Nathan Fritz
b9f7af885c
* fixed some python3 transition bugs
...
* added status options to muc joining
2009-09-01 17:24:52 +00:00
Nathan Fritz
32ef496502
added module config for number of threads
2009-09-01 00:06:46 +00:00
Nathan Fritz
436841fa6f
brought components over to python 3.x
2009-08-31 23:02:19 +00:00
Nathan Fritz
05c9ea5c1d
* converted sleekxmpp to Python 3.x
...
* sleekxmpp no longer spawns threads for callback handlers -- there are now two threads: one for handlers and one for reading. callback handlers can get results from the read queue directly with the "wait" handler which is used in .send() for the reply catching argument.
2009-08-31 22:46:31 +00:00
Nathan Fritz
00d46ee2b0
* fixed xmlstream bugs with unexpected disconnect
2009-08-21 00:26:57 +00:00
Nathan Fritz
9cbc29149f
fixed typo
2009-07-11 22:17:49 +00:00
Nathan Fritz
7a15d14c93
added incoming_filter
2009-07-11 21:46:31 +00:00
Nathan Fritz
171bb30e83
base message and presence events detect xmlns being used
2009-07-11 20:47:03 +00:00
Nathan Fritz
a280e3c140
xmlmask now ignores namespace on subdomains properly if ignore_ns is set
2009-07-11 20:34:27 +00:00
Nathan Fritz
d9b812a73b
fixed relative import
2009-07-11 19:51:04 +00:00
Nathan Fritz
a3b94d51fb
fixed import bug in component
2009-07-11 19:41:24 +00:00
Nathan Fritz
226f719597
components now ignore namespaces in matching completely for server compatibility
2009-07-11 19:31:20 +00:00
Remko Tronçon
a1ece44368
Fixed typo.
2009-07-11 18:20:47 +00:00
Nathan Fritz
ce8bf4a367
made disconnect cleaner
2009-06-25 06:49:58 +00:00
Nathan Fritz
94f58ec3cb
2009-06-24 06:09:20 +00:00
Nathan Fritz
a9262c4e0a
* bugfixes
2009-06-16 11:59:55 +00:00
Nathan Fritz
5fbf0f84d7
fixed pubsub test
2009-06-12 19:27:29 +00:00
Nathan Fritz
96b103b275
moved seesmic branch to trunk
2009-06-03 22:56:51 +00:00