From 9596616b424417f8a03657dfc3c958eb92147a3b Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 12 Mar 2012 19:50:27 -0700 Subject: Move feature_mechanisms to new system. --- sleekxmpp/features/feature_mechanisms/__init__.py | 11 ++++++++++- sleekxmpp/features/feature_mechanisms/mechanisms.py | 14 +++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'sleekxmpp/features') diff --git a/sleekxmpp/features/feature_mechanisms/__init__.py b/sleekxmpp/features/feature_mechanisms/__init__.py index 5379ef4e..9f7611ed 100644 --- a/sleekxmpp/features/feature_mechanisms/__init__.py +++ b/sleekxmpp/features/feature_mechanisms/__init__.py @@ -6,8 +6,17 @@ See the file LICENSE for copying permission. """ -from sleekxmpp.features.feature_mechanisms.mechanisms import feature_mechanisms +from sleekxmpp.plugins.base import register_plugin + +from sleekxmpp.features.feature_mechanisms.mechanisms import FeatureMechanisms from sleekxmpp.features.feature_mechanisms.stanza import Mechanisms from sleekxmpp.features.feature_mechanisms.stanza import Auth from sleekxmpp.features.feature_mechanisms.stanza import Success from sleekxmpp.features.feature_mechanisms.stanza import Failure + + +register_plugin(FeatureMechanisms) + + +# Retain some backwards compatibility +feature_mechanisms = FeatureMechanisms diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py index da235e26..570b7141 100644 --- a/sleekxmpp/features/feature_mechanisms/mechanisms.py +++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py @@ -13,23 +13,23 @@ from sleekxmpp.thirdparty.suelta.exceptions import SASLCancelled, SASLError from sleekxmpp.stanza import StreamFeatures from sleekxmpp.xmlstream import RestartStream, register_stanza_plugin +from sleekxmpp.plugins import BasePlugin from sleekxmpp.xmlstream.matcher import MatchXPath from sleekxmpp.xmlstream.handler import Callback -from sleekxmpp.plugins.base import base_plugin from sleekxmpp.features.feature_mechanisms import stanza log = logging.getLogger(__name__) -class feature_mechanisms(base_plugin): +class FeatureMechanisms(BasePlugin): - def plugin_init(self): - self.name = 'SASL Mechanisms' - self.rfc = '6120' - self.description = "SASL Stream Feature" - self.stanza = stanza + name = 'feature_mechanisms' + description = 'RFC 6120: Stream Feature: SASL' + dependencies = set() + stanza = stanza + def plugin_init(self): self.use_mech = self.config.get('use_mech', None) def tls_active(): -- cgit v1.2.3