summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 00:22:42 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:20 -0700
commit6497857495d185401426ba31441e3039fb316891 (patch)
tree7465813559a8781cf3f562bdffc3210c1f72fa27
parent5a324c01de8cbca09609d7176306322bf24df414 (diff)
downloadslixmpp-6497857495d185401426ba31441e3039fb316891.tar.gz
slixmpp-6497857495d185401426ba31441e3039fb316891.tar.bz2
slixmpp-6497857495d185401426ba31441e3039fb316891.tar.xz
slixmpp-6497857495d185401426ba31441e3039fb316891.zip
Move XEP-0202 to new system.
-rw-r--r--sleekxmpp/plugins/xep_0202/__init__.py10
-rw-r--r--sleekxmpp/plugins/xep_0202/time.py17
2 files changed, 16 insertions, 11 deletions
diff --git a/sleekxmpp/plugins/xep_0202/__init__.py b/sleekxmpp/plugins/xep_0202/__init__.py
index a34b2376..cdab3665 100644
--- a/sleekxmpp/plugins/xep_0202/__init__.py
+++ b/sleekxmpp/plugins/xep_0202/__init__.py
@@ -6,7 +6,15 @@
See the file LICENSE for copying permission.
"""
+from sleekxmpp.plugins.base import register_plugin
from sleekxmpp.plugins.xep_0202 import stanza
from sleekxmpp.plugins.xep_0202.stanza import EntityTime
-from sleekxmpp.plugins.xep_0202.time import xep_0202
+from sleekxmpp.plugins.xep_0202.time import XEP_0202
+
+
+register_plugin(XEP_0202)
+
+
+# Retain some backwards compatibility
+xep_0202 = XEP_0202
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.