summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
AgeCommit message (Collapse)Author
2011-08-03Merge branch 'develop' into stream_featuresLance Stout
2011-08-03Merge branch 'develop' into stream_featuresLance Stout
2011-07-27Add support for HTTP Proxy connections.Lance Stout
2011-07-04Added wait parameter to disconnect.Lance Stout
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-01Merge branch 'develop' into stream_featuresLance Stout
2011-07-01So using sys.excepthook to catch errors only works once.Lance Stout
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-06-20Merge branch 'develop' into stream_featuresLance Stout
2011-06-20Fix stanza clobbering when replying to errors.sleek-1.0.0-beta5sleek-1.0-Beta51.0.0-beta51.0-Beta5Lance Stout
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-10Merge branch 'develop' into stream_featuresLance Stout
2011-06-08Added session_end event and some docs.Lance Stout
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-01Merge branch 'develop' into stream_featuresLance Stout
2011-06-01Cache stanza if sending fails.Lance Stout
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-05-31Merge branch 'develop' into stream_featuresLance Stout
Conflicts: sleekxmpp/clientxmpp.py
2011-05-31Apply connection backoff to reconnect attempts.Lance Stout
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-31Cleanup logging and exception handling.Lance Stout
The syntax and attribute errors raised during a disconnect/reconnect attempt are now caught and produce nicer log messages.
2011-05-27Don't use the send queue for stream initialization.Lance Stout
Use the parameter now=True to skip the queue when sending Iq stanzas, or using xmpp.send().
2011-05-27Fix typo for SSL certificate use.Lance Stout
2011-05-27Add exponential backoff to connection attempts.Lance Stout
Delay will approximately double between attempts (random variation). See issue #67.
2011-05-27Added support for testind disconnect errors.Lance Stout
2011-05-20Merge branch 'develop' into stream_featuresLance Stout
2011-05-20Fix double roster entry issue with Unicode.Lance Stout
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-20Merge branch 'develop' into stream_featuresLance Stout
Conflicts: sleekxmpp/clientxmpp.py
2011-04-11Mark scheduler thread as a daemon.Lance Stout
2011-03-24Merge branch 'develop' into stream_featuresLance Stout
2011-03-24Allow a stanza plugin to override a parent's interfaces.Lance Stout
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-22Merge branch 'develop' into stream_featuresLance Stout
2011-03-22Updated XEP-0128 plugin to work with the new XEP-0030 plugin.Lance Stout
Required fixing a few bugs in StanzaBase related to iterable substanzas.
2011-03-18Merge branch 'develop' into stream_featuresLance Stout
Conflicts: sleekxmpp/xmlstream/stanzabase.py
2011-03-18Change namespace inclusion in strings.Lance Stout
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-18Merge branch 'develop' into stream_featuresLance Stout
2011-03-18Fix self.disconnect(reconnect=True) not working.Lance Stout
2011-02-23Bring back the signal handlers (and the "killed" event).Lance Stout
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-14Merge branch 'develop' into stream_featuresLance Stout
Conflicts: sleekxmpp/xmlstream/stanzabase.py
2011-02-14Use the _build_stanza method.Lance Stout
2011-02-14Remap old method names in a better way.Lance Stout
This should prevent some reference cycles that will cause garbage collection issues.
2011-02-14More attempts at fixing garbage collection.Lance Stout
Don't keep a reference to stanzas in Callback objects.
2011-02-14Break references that can prevent garbage collection.Lance Stout
2011-02-13Simplification when removing a deletable handler.Lance Stout
2011-02-13Make one-off Callbacks ready for deletion after the prerun step.Lance Stout
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-11XMPPError exceptions can keep a stanza's contents.Lance Stout
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-01-27Update tostring methods.Lance Stout
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-27Make stanza.plugins an OrderedDict.Lance Stout
This allows you to determine the order in which substanzas were added in the original XML.
2011-01-27Recognize stanzas that don't use the default namespace.Lance Stout
2011-01-26Cleanup for stanzabase.Lance Stout
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-26Upgraded how subitem works.Lance Stout
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-19Make extending stanza objects nicer.Lance Stout
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-16Raise the event 'socket_error' when a socket error occurs.Lance Stout
Will be most useful for debugging and responding to failed connection attempts.
2011-01-14Add a note for debug statement when running scheduled events.Lance Stout
Fixes the intermittent DEBUG ((),) messages that give no explanation. Will now show as: DEBUG Scheduled event: ((), )
2011-01-13Fix bug in JID class. Attribute .jid now works properly.Lance Stout
2011-01-05Allow JID objects to be compared with strings.Lance Stout
Two JIDs match if they have the same full JID value.