From e1956533a6e04d7ba2afdbc841b48804a84120b3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 1 Mar 2013 19:25:31 +0100 Subject: Fix #2231 (update the plugins to use the new help system) And fix some imprecisions/mistakes in the help. --- plugins/admin.py | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'plugins/admin.py') diff --git a/plugins/admin.py b/plugins/admin.py index cb9ee37b..0f61007b 100644 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -13,28 +13,40 @@ class Plugin(BasePlugin): /noaffiliation """ def init(self): - for role in ['visitor', 'participant' , 'moderator']: + for role in ('visitor', 'participant' , 'moderator'): self.add_tab_command(MucTab, role, self.role(role), - '/%s \n%s: Set the role of a nick to %s.' % - (role, role.capitalize(), role), self.complete_nick) + help='Set the role of a nick to %s' % role, + usage= '', + short='Set the role to %s' % role, + completion=self.complete_nick) - for aff in ['member', 'owner', 'admin']: + for aff in ('member', 'owner', 'admin'): self.add_tab_command(MucTab, aff, self.affiliation(aff), - '/%s \n%s: set the affiliation of a nick to %s' % - (aff, aff.capitalize(), aff), self.complete_nick) + usage='', + help='Set the affiliation of a nick to %s' % aff, + short='Set the affiliation to %s' % aff, + completion=self.complete_nick) self.add_tab_command(MucTab, 'noaffiliation', self.affiliation('none'), - '/noaffiliation \nNoAffiliation: set the affiliation of a nick to none.', - self.complete_nick) + usage='', + help='Set the affiliation of a nick to none.', + short='Set the affiliation to none.', + completion=self.complete_nick) self.add_tab_command(MucTab, 'voice', self.affiliation('member'), - '/voice \nVoice: set the affiliation of a nick to member.', - self.complete_nick) + usage='', + help='Set the affiliation of a nick to member.', + short='Set the affiliation to member.', + completion=self.complete_nick) self.add_tab_command(MucTab, 'op', self.role('moderator'), - '/op \nOp: set the role of a nick to moderator.', - self.complete_nick) + usage='', + help='Set the role of a nick to moderator.', + short='Set the role to moderator.', + completion=self.complete_nick) self.add_tab_command(MucTab, 'mute', self.role('visitor'), - '/mute \nMute: set the role of a nick to visitor.', - self.complete_nick) + usage='', + help='Set the role of a nick to visitor.', + short='Set the role to visitor.', + completion=self.complete_nick) def role(self, role): return lambda args: self.core.current_tab().command_role(args+' '+role) -- cgit v1.2.3