From 24ec448b7f29b6eb66818715bdbd30e09fd0ed0b Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 12 Mar 2012 19:57:20 -0700 Subject: Move feature_starttls to new system. --- sleekxmpp/features/feature_starttls/__init__.py | 11 ++++++++++- sleekxmpp/features/feature_starttls/starttls.py | 14 +++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/features/feature_starttls/__init__.py b/sleekxmpp/features/feature_starttls/__init__.py index 4ae89433..68697ce5 100644 --- a/sleekxmpp/features/feature_starttls/__init__.py +++ b/sleekxmpp/features/feature_starttls/__init__.py @@ -6,5 +6,14 @@ See the file LICENSE for copying permission. """ -from sleekxmpp.features.feature_starttls.starttls import feature_starttls +from sleekxmpp.plugins.base import register_plugin + +from sleekxmpp.features.feature_starttls.starttls import FeatureSTARTTLS from sleekxmpp.features.feature_starttls.stanza import * + + +register_plugin(FeatureSTARTTLS) + + +# Retain some backwards compatibility +feature_starttls = FeatureSTARTTLS diff --git a/sleekxmpp/features/feature_starttls/starttls.py b/sleekxmpp/features/feature_starttls/starttls.py index 24ff7436..212b9da5 100644 --- a/sleekxmpp/features/feature_starttls/starttls.py +++ b/sleekxmpp/features/feature_starttls/starttls.py @@ -10,23 +10,23 @@ import logging 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_starttls import stanza log = logging.getLogger(__name__) -class feature_starttls(base_plugin): +class FeatureSTARTTLS(BasePlugin): - def plugin_init(self): - self.name = "STARTTLS" - self.rfc = '6120' - self.description = "STARTTLS Stream Feature" - self.stanza = stanza + name = 'feature_starttls' + description = 'RFC 6120: Stream Feature: STARTTLS' + dependencies = set() + stanza = stanza + def plugin_init(self): self.xmpp.register_handler( Callback('STARTTLS Proceed', MatchXPath(stanza.Proceed.tag_name()), -- cgit v1.2.3