summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-05-05 15:45:26 +0200
committermathieui <mathieui@mathieui.net>2012-05-05 15:45:26 +0200
commit794da2a6f2fb6f532cbd5f16a26019d598a04528 (patch)
tree695780eafc269808eccf5084505b10ade7b7f977
parent6ff2f2acc6e995440f6be414680e426031d71a79 (diff)
downloadpoezio-794da2a6f2fb6f532cbd5f16a26019d598a04528.tar.gz
poezio-794da2a6f2fb6f532cbd5f16a26019d598a04528.tar.bz2
poezio-794da2a6f2fb6f532cbd5f16a26019d598a04528.tar.xz
poezio-794da2a6f2fb6f532cbd5f16a26019d598a04528.zip
Use add_tab_command in the mpd client plugin
-rw-r--r--plugins/mpd_client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mpd_client.py b/plugins/mpd_client.py
index 833599ae..4c70f066 100644
--- a/plugins/mpd_client.py
+++ b/plugins/mpd_client.py
@@ -2,11 +2,14 @@
from plugin import BasePlugin
from common import shell_split
+import tabs
import mpd
class Plugin(BasePlugin):
def init(self):
- self.add_command('mpd', self.command_mpd, "Usage: /mpd [full]\nMpd: sends a message showing the current song of an MPD instance. If full is provided, the message is more verbose.", self.completion_mpd)
+ self.add_tab_command(tabs.ConversationTab, 'mpd', self.command_mpd, "Usage: /mpd [full]\nMpd: sends a message showing the current song of an MPD instance. If full is provided, the message is more verbose.", self.completion_mpd)
+ self.add_tab_command(tabs.MucTab, 'mpd', self.command_mpd, "Usage: /mpd [full]\nMpd: sends a message showing the current song of an MPD instance. If full is provided, the message is more verbose.", self.completion_mpd)
+ self.add_tab_command(tabs.PrivateTab, 'mpd', self.command_mpd, "Usage: /mpd [full]\nMpd: sends a message showing the current song of an MPD instance. If full is provided, the message is more verbose.", self.completion_mpd)
def command_mpd(self, args):
args = shell_split(args)
@@ -23,7 +26,7 @@ class Plugin(BasePlugin):
pourcentage = int(current_time / float(current['time']) * 10)
s += ' \x192}[\x191}' + '-'*(pourcentage-1) + '\x193}+' + '\x191}' + '-' * (10-pourcentage-1) + '\x192}]\x19o'
if not self.core.send_message('%s' % (s,)):
- self.core.information('Cannot send result (%s), this is not a conversation tab' % result)
+ self.core.information('Cannot send result (%s)' % s, 'Error')
def completion_mpd(self, the_input):
return the_input.auto_completion(['full'])