# HG changeset patch # User Thinker K.F. Li # Date 1303098850 -28800 # Node ID c586981ecf1a5c1a32e5a9bc98b10f068f5c3793 # Parent 6927debad4ee49e796222c6d776f4eff4aa5e1d5 Avoid duplication in state names diff -r 6927debad4ee -r c586981ecf1a pyink/domview.py --- a/pyink/domview.py Mon Apr 18 11:47:52 2011 +0800 +++ b/pyink/domview.py Mon Apr 18 11:54:10 2011 +0800 @@ -445,6 +445,10 @@ doc = self._comp_mgr._doc + if name in self.fsm_states: + raise KeyError, \ + 'Add a state with a name (%s) been used' % (name) + state = State() state.name = name self.fsm_states[name] = state