BF: Raise ValueError for adding of duplicate named action

pull/189/head
Steven Hiscocks 12 years ago
parent 6d2ff47e71
commit 219860ed8e

@ -65,6 +65,9 @@ class Actions(JailThread):
# @param name The action name # @param name The action name
def addAction(self, name): def addAction(self, name):
# Check is action name already exists
if name in [action.getName() for action in self.__actions]:
raise ValueError("Action %s already exists" % name)
action = Action(name) action = Action(name)
self.__actions.append(action) self.__actions.append(action)

Loading…
Cancel
Save