summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-10-17 21:38:22 -0400
committerLance Stout <lancestout@gmail.com>2010-10-17 22:04:42 -0400
commit4375ac7d8b9e62f34a4d3754a90b3538d5e978a3 (patch)
treec7da6dddc72ecd299f16d5dd82a4d81f8b0146fa /sleekxmpp/basexmpp.py
parentfaec86b3be38756510fb3534c7615db75ecd53b7 (diff)
downloadslixmpp-4375ac7d8b9e62f34a4d3754a90b3538d5e978a3.tar.gz
slixmpp-4375ac7d8b9e62f34a4d3754a90b3538d5e978a3.tar.bz2
slixmpp-4375ac7d8b9e62f34a4d3754a90b3538d5e978a3.tar.xz
slixmpp-4375ac7d8b9e62f34a4d3754a90b3538d5e978a3.zip
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.
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 3db29a9a..8197f6a7 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -21,7 +21,7 @@ from sleekxmpp.stanza.nick import Nick
from sleekxmpp.stanza.htmlim import HTMLIM
from sleekxmpp.xmlstream import XMLStream, JID, tostring
-from sleekxmpp.xmlstream.stanzabase import ET, registerStanzaPlugin
+from sleekxmpp.xmlstream import ET, register_stanza_plugin
from sleekxmpp.xmlstream.matcher import *
from sleekxmpp.xmlstream.handler import *
@@ -142,9 +142,9 @@ class BaseXMPP(XMLStream):
self.registerStanza(Presence)
# Initialize a few default stanza plugins.
- registerStanzaPlugin(Iq, Roster)
- registerStanzaPlugin(Message, Nick)
- registerStanzaPlugin(Message, HTMLIM)
+ register_stanza_plugin(Iq, Roster)
+ register_stanza_plugin(Message, Nick)
+ register_stanza_plugin(Message, HTMLIM)
def process(self, *args, **kwargs):
"""
@@ -256,8 +256,8 @@ class BaseXMPP(XMLStream):
Defaults to 0.
ifrom -- The from JID to use for this stanza.
"""
- return self.Iq().setStanzaValues({'id': str(id),
- 'from': ifrom})
+ return self.Iq()._set_stanza_values({'id': str(id),
+ 'from': ifrom})
def make_iq_get(self, queryxmlns=None):
"""
@@ -268,8 +268,8 @@ class BaseXMPP(XMLStream):
Arguments:
queryxmlns -- The namespace of the query to use.
"""
- return self.Iq().setStanzaValues({'type': 'get',
- 'query': queryxmlns})
+ return self.Iq()._set_stanza_values({'type': 'get',
+ 'query': queryxmlns})
def make_iq_result(self, id):
"""
@@ -278,8 +278,8 @@ class BaseXMPP(XMLStream):
Arguments:
id -- An ideally unique ID value. May use self.new_id().
"""
- return self.Iq().setStanzaValues({'id': id,
- 'type': 'result'})
+ return self.Iq()._set_stanza_values({'id': id,
+ 'type': 'result'})
def make_iq_set(self, sub=None):
"""
@@ -291,7 +291,7 @@ class BaseXMPP(XMLStream):
Arguments:
sub -- A stanza or XML object to use as the Iq's payload.
"""
- iq = self.Iq().setStanzaValues({'type': 'set'})
+ iq = self.Iq()._set_stanza_values({'type': 'set'})
if sub != None:
iq.append(sub)
return iq
@@ -309,10 +309,10 @@ class BaseXMPP(XMLStream):
Defaults to 'feature-not-implemented'.
text -- A message describing the cause of the error.
"""
- iq = self.Iq().setStanzaValues({'id': id})
- iq['error'].setStanzaValues({'type': type,
- 'condition': condition,
- 'text': text})
+ iq = self.Iq()._set_stanza_values({'id': id})
+ iq['error']._set_stanza_values({'type': type,
+ 'condition': condition,
+ 'text': text})
return iq
def make_iq_query(self, iq=None, xmlns=''):