From 7284ceb90ccc3f612b93fa5548ba22677f869bc7 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 12 Mar 2012 20:04:11 -0700 Subject: [PATCH] Move feature_rosterver to new system. --- sleekxmpp/features/feature_rosterver/__init__.py | 11 ++++++++++- sleekxmpp/features/feature_rosterver/rosterver.py | 14 +++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sleekxmpp/features/feature_rosterver/__init__.py b/sleekxmpp/features/feature_rosterver/__init__.py index c83dd01c..33bbf416 100644 --- a/sleekxmpp/features/feature_rosterver/__init__.py +++ b/sleekxmpp/features/feature_rosterver/__init__.py @@ -6,5 +6,14 @@ See the file LICENSE for copying permission. """ -from sleekxmpp.features.feature_rosterver.rosterver import feature_rosterver +from sleekxmpp.plugins.base import register_plugin + +from sleekxmpp.features.feature_rosterver.rosterver import FeatureRosterVer from sleekxmpp.features.feature_rosterver.stanza import RosterVer + + +register_plugin(FeatureRosterVer) + + +# Retain some backwards compatibility +feature_rosterver = FeatureRosterVer diff --git a/sleekxmpp/features/feature_rosterver/rosterver.py b/sleekxmpp/features/feature_rosterver/rosterver.py index 059d20e1..9e0bb8e8 100644 --- a/sleekxmpp/features/feature_rosterver/rosterver.py +++ b/sleekxmpp/features/feature_rosterver/rosterver.py @@ -11,20 +11,20 @@ import logging from sleekxmpp.stanza import Iq, StreamFeatures from sleekxmpp.features.feature_rosterver import stanza from sleekxmpp.xmlstream import register_stanza_plugin -from sleekxmpp.plugins.base import base_plugin +from sleekxmpp.plugins.base import BasePlugin log = logging.getLogger(__name__) -class feature_rosterver(base_plugin): +class FeatureRosterVer(BasePlugin): + + name = 'feature_rosterver' + description = 'RFC 6121: Stream Feature: Roster Versioning' + dependences = set() + stanza = stanza def plugin_init(self): - self.name = 'Roster Versioning' - self.rfc = '6121' - self.description = 'Roster Versioning' - self.stanza = stanza - self.xmpp.register_feature('rosterver', self._handle_rosterver, restart=False,