From 9ac686c0a9ea0bd8f9b1e20697c4b3504ab05e54 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 24 Mar 2014 13:49:37 +0100 Subject: [PATCH] plugin text-commands: fixed name conflicts management + plugin parrot: removed now done TODO --- src/plugins/plugin_exp_parrot.py | 3 --- src/plugins/plugin_misc_text_commands.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/plugin_exp_parrot.py b/src/plugins/plugin_exp_parrot.py index 64687513..14302c00 100755 --- a/src/plugins/plugin_exp_parrot.py +++ b/src/plugins/plugin_exp_parrot.py @@ -131,9 +131,6 @@ class Exp_Parrot(object): def cmd_parrot(self, mess_data, profile): """activate Parrot mode between 2 entities, in both directions.""" - #TODO: these commands must not be hardcoded, an interface should be made - # to allow plugins to register simple commands like this. - debug("Catched parrot command") txt_cmd = self.host.plugins[C.TEXT_CMDS] diff --git a/src/plugins/plugin_misc_text_commands.py b/src/plugins/plugin_misc_text_commands.py index 5e6cb2b3..cf67a207 100755 --- a/src/plugins/plugin_misc_text_commands.py +++ b/src/plugins/plugin_misc_text_commands.py @@ -66,9 +66,9 @@ class TextCommands(object): warning(_("Skipping cmd_ method")) if cmd_name in self._commands: suff=2 - while (cmd_name + suff) in self._commands: + while (cmd_name + str(suff)) in self._commands: suff+=1 - new_name = cmd_name + suff + new_name = cmd_name + str(suff) warning(_("Conflict for command [%(old_name)s], renaming it to [%(new_name)s]") % {'old_name': cmd_name, 'new_name': new_name}) cmd_name = new_name self._commands[cmd_name] = cmd