Mercurial > libervia-backend
changeset 927:cd150dd947e3
plugin text-commands: fixed name conflicts management + plugin parrot: removed now done TODO
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 24 Mar 2014 13:49:37 +0100 |
parents | d609581bf74a |
children | 73873e9b56f7 |
files | src/plugins/plugin_exp_parrot.py src/plugins/plugin_misc_text_commands.py |
diffstat | 2 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/plugin_exp_parrot.py Mon Mar 24 10:57:15 2014 +0100 +++ b/src/plugins/plugin_exp_parrot.py Mon Mar 24 13:49:37 2014 +0100 @@ -131,9 +131,6 @@ 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]
--- a/src/plugins/plugin_misc_text_commands.py Mon Mar 24 10:57:15 2014 +0100 +++ b/src/plugins/plugin_misc_text_commands.py Mon Mar 24 13:49:37 2014 +0100 @@ -66,9 +66,9 @@ 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