plcopen/plcopen.py
changeset 46 4379e98a30aa
parent 27 dae55dd9ee14
child 47 2b2f8d88e6d3
equal deleted inserted replaced
45:42637f721b5b 46:4379e98a30aa
   374             transitions = self.transitions.getTransition()
   374             transitions = self.transitions.getTransition()
   375             i = 0
   375             i = 0
   376             removed = False
   376             removed = False
   377             while i < len(transitions) and not removed:
   377             while i < len(transitions) and not removed:
   378                 if transitions[i].getName() == name:
   378                 if transitions[i].getName() == name:
   379                     transitions.removeTransition(i)
   379                     transitions.pop(i)
   380                     removed = True
   380                     removed = True
   381                 i += 1
   381                 i += 1
   382             if not removed:
   382             if not removed:
   383                 raise ValueError, "Transition with name %s doesn't exists!"%name
   383                 raise ValueError, "Transition with name %s doesn't exists!"%name
   384     setattr(cls, "removeTransition", removeTransition)
   384     setattr(cls, "removeTransition", removeTransition)
   412             actions = self.actions.getAction()
   412             actions = self.actions.getAction()
   413             i = 0
   413             i = 0
   414             removed = False
   414             removed = False
   415             while i < len(actions) and not removed:
   415             while i < len(actions) and not removed:
   416                 if actions[i].getName() == name:
   416                 if actions[i].getName() == name:
   417                     actions.removeAction(i)
   417                     actions.pop(i)
   418                     removed = True
   418                     removed = True
   419                 i += 1
   419                 i += 1
   420             if not removed:
   420             if not removed:
   421                 raise ValueError, "Action with name %s doesn't exists!"%name
   421                 raise ValueError, "Action with name %s doesn't exists!"%name
   422     setattr(cls, "removeAction", removeAction)
   422     setattr(cls, "removeAction", removeAction)