diff options
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r-- | sleekxmpp/stanza/__init__.py | 6 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream/__init__.py | 5 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream/bind.py | 27 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream/sasl.py | 104 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream/session.py | 26 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream/tls.py | 50 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream_error.py (renamed from sleekxmpp/stanza/stream/error.py) | 0 | ||||
-rw-r--r-- | sleekxmpp/stanza/stream_features.py (renamed from sleekxmpp/stanza/stream/features.py) | 0 |
8 files changed, 2 insertions, 216 deletions
diff --git a/sleekxmpp/stanza/__init__.py b/sleekxmpp/stanza/__init__.py index 05df8837..4bd37dc5 100644 --- a/sleekxmpp/stanza/__init__.py +++ b/sleekxmpp/stanza/__init__.py @@ -11,7 +11,5 @@ from sleekxmpp.stanza.error import Error from sleekxmpp.stanza.iq import Iq from sleekxmpp.stanza.message import Message from sleekxmpp.stanza.presence import Presence -from sleekxmpp.stanza.stream import StreamFeatures -from sleekxmpp.stanza.stream import Bind -from sleekxmpp.stanza.stream import Session -from sleekxmpp.stanza.stream import StreamError +from sleekxmpp.stanza.stream_features import StreamFeatures +from sleekxmpp.stanza.stream_error import StreamError diff --git a/sleekxmpp/stanza/stream/__init__.py b/sleekxmpp/stanza/stream/__init__.py index a386bbac..2cb79673 100644 --- a/sleekxmpp/stanza/stream/__init__.py +++ b/sleekxmpp/stanza/stream/__init__.py @@ -6,8 +6,3 @@ See the file LICENSE for copying permission. """ - -from sleekxmpp.stanza.stream.error import StreamError -from sleekxmpp.stanza.stream.features import StreamFeatures -from sleekxmpp.stanza.stream.bind import Bind -from sleekxmpp.stanza.stream.session import Session diff --git a/sleekxmpp/stanza/stream/bind.py b/sleekxmpp/stanza/stream/bind.py deleted file mode 100644 index 165afcb4..00000000 --- a/sleekxmpp/stanza/stream/bind.py +++ /dev/null @@ -1,27 +0,0 @@ -""" - SleekXMPP: The Sleek XMPP Library - Copyright (C) 2010 Nathanael C. Fritz - This file is part of SleekXMPP. - - See the file LICENSE for copying permission. -""" - -from sleekxmpp.stanza import Iq -from sleekxmpp.stanza.stream import StreamFeatures -from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin - - -class Bind(ElementBase): - - """ - """ - - name = 'bind' - namespace = 'urn:ietf:params:xml:ns:xmpp-bind' - interfaces = set(('resource', 'jid')) - sub_interfaces = interfaces - plugin_attrib = 'bind' - - -register_stanza_plugin(Iq, Bind) -register_stanza_plugin(StreamFeatures, Bind) diff --git a/sleekxmpp/stanza/stream/sasl.py b/sleekxmpp/stanza/stream/sasl.py deleted file mode 100644 index e55a72ad..00000000 --- a/sleekxmpp/stanza/stream/sasl.py +++ /dev/null @@ -1,104 +0,0 @@ -""" - SleekXMPP: The Sleek XMPP Library - Copyright (C) 2010 Nathanael C. Fritz - This file is part of SleekXMPP. - - See the file LICENSE for copying permission. -""" - -from sleekxmpp.stanza import StreamFeatures -from sleekxmpp.xmlstream import ElementBase, StanzaBase, ET -from sleekxmpp.xmlstream import register_stanza_plugin - - -class Mechanisms(ElementBase): - - """ - """ - - name = 'mechanisms' - namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' - interfaces = set(('mechanisms', 'required')) - plugin_attrib = name - is_extension = True - - def get_required(self): - """ - """ - return True - - def get_mechanisms(self): - """ - """ - results = [] - mechs = self.findall('{%s}mechanism' % self.namespace) - if mechs: - for mech in mechs: - results.append(mech.text) - return results - - def set_mechanisms(self, values): - """ - """ - self.del_mechanisms() - for val in values: - mech = ET.Element('{%s}mechanism' % self.namespace) - mech.text = val - self.append(mech) - - def del_mechanisms(self): - """ - """ - mechs = self.findall('{%s}mechanism' % self.namespace) - if mechs: - for mech in mechs: - self.xml.remove(mech) - - -class Success(StanzaBase): - - """ - """ - - name = 'success' - namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' - interfaces = set() - plugin_attrib = name - - -class Failure(StanzaBase): - - """ - """ - - name = 'failure' - namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' - interfaces = set() - plugin_attrib = name - - -class Auth(StanzaBase): - - """ - """ - - name = 'auth' - namespace = 'urn:ietf:params:xml:ns:xmpp-sasl' - interfaces = set(('mechanism', 'value')) - plugin_attrib = name - - def setup(self, xml): - StanzaBase.setup(self, xml) - self.xml.tag = self.tag_name() - - def set_value(self, value): - self.xml.text = value - - def get_value(self): - return self.xml.text - - def del_value(self): - self.xml.text = '' - - -register_stanza_plugin(StreamFeatures, Mechanisms) diff --git a/sleekxmpp/stanza/stream/session.py b/sleekxmpp/stanza/stream/session.py deleted file mode 100644 index 87f21857..00000000 --- a/sleekxmpp/stanza/stream/session.py +++ /dev/null @@ -1,26 +0,0 @@ -""" - SleekXMPP: The Sleek XMPP Library - Copyright (C) 2010 Nathanael C. Fritz - This file is part of SleekXMPP. - - See the file LICENSE for copying permission. -""" - -from sleekxmpp.stanza import Iq -from sleekxmpp.stanza.stream import StreamFeatures -from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin - - -class Session(ElementBase): - - """ - """ - - name = 'session' - namespace = 'urn:ietf:params:xml:ns:xmpp-session' - interfaces = set() - plugin_attrib = 'session' - - -register_stanza_plugin(Iq, Session) -register_stanza_plugin(StreamFeatures, Session) diff --git a/sleekxmpp/stanza/stream/tls.py b/sleekxmpp/stanza/stream/tls.py deleted file mode 100644 index d85f9b49..00000000 --- a/sleekxmpp/stanza/stream/tls.py +++ /dev/null @@ -1,50 +0,0 @@ -""" - SleekXMPP: The Sleek XMPP Library - Copyright (C) 2010 Nathanael C. Fritz - This file is part of SleekXMPP. - - See the file LICENSE for copying permission. -""" - -from sleekxmpp.stanza import StreamFeatures -from sleekxmpp.xmlstream import StanzaBase, ElementBase -from sleekxmpp.xmlstream import register_stanza_plugin - - -class STARTTLS(ElementBase): - - """ - """ - - name = 'starttls' - namespace = 'urn:ietf:params:xml:ns:xmpp-tls' - interfaces = set(('required',)) - plugin_attrib = name - - def get_required(self): - """ - """ - return True - - -class Proceed(StanzaBase): - - """ - """ - - name = 'proceed' - namespace = 'urn:ietf:params:xml:ns:xmpp-tls' - interfaces = set() - - -class Failure(StanzaBase): - - """ - """ - - name = 'failure' - namespace = 'urn:ietf:params:xml:ns:xmpp-tls' - interfaces = set() - - -register_stanza_plugin(StreamFeatures, STARTTLS) diff --git a/sleekxmpp/stanza/stream/error.py b/sleekxmpp/stanza/stream_error.py index cf59a7fa..cf59a7fa 100644 --- a/sleekxmpp/stanza/stream/error.py +++ b/sleekxmpp/stanza/stream_error.py diff --git a/sleekxmpp/stanza/stream/features.py b/sleekxmpp/stanza/stream_features.py index 5be2e55f..5be2e55f 100644 --- a/sleekxmpp/stanza/stream/features.py +++ b/sleekxmpp/stanza/stream_features.py |