summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 19:21:54 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:20 -0700
commit32d6f856498dadaa0d7b1e01c9c83bd820d8767b (patch)
tree6f3eb68804d5c37c11f0b1dfc6b55f52d7be17e6 /sleekxmpp
parenta2b47e57493fbd399df371c3feac7aa54f928f98 (diff)
downloadslixmpp-32d6f856498dadaa0d7b1e01c9c83bd820d8767b.tar.gz
slixmpp-32d6f856498dadaa0d7b1e01c9c83bd820d8767b.tar.bz2
slixmpp-32d6f856498dadaa0d7b1e01c9c83bd820d8767b.tar.xz
slixmpp-32d6f856498dadaa0d7b1e01c9c83bd820d8767b.zip
Move XEP-0118 to the new system.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/xep_0118/__init__.py7
-rw-r--r--sleekxmpp/plugins/xep_0118/user_tune.py24
2 files changed, 14 insertions, 17 deletions
diff --git a/sleekxmpp/plugins/xep_0118/__init__.py b/sleekxmpp/plugins/xep_0118/__init__.py
index f8560211..565f7844 100644
--- a/sleekxmpp/plugins/xep_0118/__init__.py
+++ b/sleekxmpp/plugins/xep_0118/__init__.py
@@ -6,6 +6,11 @@
See the file LICENSE for copying permission.
"""
+from sleekxmpp.plugins.base import register_plugin
+
from sleekxmpp.plugins.xep_0118 import stanza
from sleekxmpp.plugins.xep_0118.stanza import UserTune
-from sleekxmpp.plugins.xep_0118.user_tune import xep_0118
+from sleekxmpp.plugins.xep_0118.user_tune import XEP_0118
+
+
+register_plugin(XEP_0118)
diff --git a/sleekxmpp/plugins/xep_0118/user_tune.py b/sleekxmpp/plugins/xep_0118/user_tune.py
index e8b96ed9..c848eaa8 100644
--- a/sleekxmpp/plugins/xep_0118/user_tune.py
+++ b/sleekxmpp/plugins/xep_0118/user_tune.py
@@ -8,34 +8,26 @@
import logging
-from sleekxmpp.xmlstream import register_stanza_plugin
-from sleekxmpp.xmlstream.handler import Callback
-from sleekxmpp.xmlstream.matcher import MatchXPath
-from sleekxmpp.plugins.base import base_plugin
+from sleekxmpp.plugins.base import BasePlugin
from sleekxmpp.plugins.xep_0118 import stanza, UserTune
log = logging.getLogger(__name__)
-class xep_0118(base_plugin):
+class XEP_0118(BasePlugin):
"""
XEP-0118: User Tune
"""
- def plugin_init(self):
- self.xep = '0118'
- self.description = 'User Tune'
- self.stanza = stanza
+ name = 'xep_0118'
+ description = 'XEP-0118: User Tune'
+ dependencies = set(['xep_0163'])
+ stanza = stanza
- def post_init(self):
- base_plugin.post_init(self)
- pubsub_stanza = self.xmpp['xep_0060'].stanza
- register_stanza_plugin(pubsub_stanza.EventItem, UserTune)
- self.xmpp['xep_0030'].add_feature(UserTune.namespace)
- self.xmpp['xep_0163'].add_interest(UserTune.namespace)
- self.xmpp['xep_0060'].map_node_event(UserTune.namespace, 'user_tune')
+ def plugin_init(self):
+ self.xmpp['xep_0163'].register_pep('user_tune', UserTune)
def publish_tune(self, artist=None, length=None, rating=None, source=None,
title=None, track=None, uri=None, options=None,