From 6497857495d185401426ba31441e3039fb316891 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 12 Mar 2012 00:22:42 -0700 Subject: Move XEP-0202 to new system. --- sleekxmpp/plugins/xep_0202/time.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'sleekxmpp/plugins/xep_0202/time.py') diff --git a/sleekxmpp/plugins/xep_0202/time.py b/sleekxmpp/plugins/xep_0202/time.py index 2c6faa4b..ca388c5b 100644 --- a/sleekxmpp/plugins/xep_0202/time.py +++ b/sleekxmpp/plugins/xep_0202/time.py @@ -12,7 +12,7 @@ from sleekxmpp.stanza.iq import Iq from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.xmlstream.handler import Callback from sleekxmpp.xmlstream.matcher import StanzaPath -from sleekxmpp.plugins.base import base_plugin +from sleekxmpp.plugins import BasePlugin from sleekxmpp.plugins import xep_0082 from sleekxmpp.plugins.xep_0202 import stanza @@ -20,18 +20,19 @@ from sleekxmpp.plugins.xep_0202 import stanza log = logging.getLogger(__name__) -class xep_0202(base_plugin): +class XEP_0202(BasePlugin): """ XEP-0202: Entity Time """ + name = 'xep_0202' + description = 'XEP-0202: Entity Time' + dependencies = set(['xep_0030', 'xep_0082']) + stanza = stanza + def plugin_init(self): """Start the XEP-0203 plugin.""" - self.xep = '0202' - self.description = 'Entity Time' - self.stanza = stanza - self.tz_offset = self.config.get('tz_offset', 0) # As a default, respond to time requests with the @@ -48,12 +49,8 @@ class xep_0202(base_plugin): self._handle_time_request)) register_stanza_plugin(Iq, stanza.EntityTime) - def post_init(self): - """Handle cross-plugin interactions.""" - base_plugin.post_init(self) self.xmpp['xep_0030'].add_feature('urn:xmpp:time') - def _handle_time_request(self, iq): """ Respond to a request for the local time. -- cgit v1.2.3