comparison src/plugins/plugin_misc_text_commands.py @ 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
comparison
equal deleted inserted replaced
926:d609581bf74a 927:cd150dd947e3
64 cmd_name = attr[4:] 64 cmd_name = attr[4:]
65 if not cmd_name: 65 if not cmd_name:
66 warning(_("Skipping cmd_ method")) 66 warning(_("Skipping cmd_ method"))
67 if cmd_name in self._commands: 67 if cmd_name in self._commands:
68 suff=2 68 suff=2
69 while (cmd_name + suff) in self._commands: 69 while (cmd_name + str(suff)) in self._commands:
70 suff+=1 70 suff+=1
71 new_name = cmd_name + suff 71 new_name = cmd_name + str(suff)
72 warning(_("Conflict for command [%(old_name)s], renaming it to [%(new_name)s]") % {'old_name': cmd_name, 'new_name': new_name}) 72 warning(_("Conflict for command [%(old_name)s], renaming it to [%(new_name)s]") % {'old_name': cmd_name, 'new_name': new_name})
73 cmd_name = new_name 73 cmd_name = new_name
74 self._commands[cmd_name] = cmd 74 self._commands[cmd_name] = cmd
75 info(_("Registered text command [%s]") % cmd_name) 75 info(_("Registered text command [%s]") % cmd_name)
76 76