plcopen/plcopen.py
changeset 427 22d16c457d87
parent 417 218142afdb53
child 435 893d04aff708
equal deleted inserted replaced
426:afe2488a4635 427:22d16c457d87
  1030                 if transitions[i].getname() == name:
  1030                 if transitions[i].getname() == name:
  1031                     transitions.pop(i)
  1031                     transitions.pop(i)
  1032                     removed = True
  1032                     removed = True
  1033                 i += 1
  1033                 i += 1
  1034             if not removed:
  1034             if not removed:
  1035                 raise ValueError, _("Transition with name %s doesn't exists!")%name
  1035                 raise ValueError, _("Transition with name %s doesn't exist!")%name
  1036     setattr(cls, "removetransition", removetransition)
  1036     setattr(cls, "removetransition", removetransition)
  1037 
  1037 
  1038     def addaction(self, name, type):
  1038     def addaction(self, name, type):
  1039         if not self.actions:
  1039         if not self.actions:
  1040             self.addactions()
  1040             self.addactions()
  1068                 if actions[i].getname() == name:
  1068                 if actions[i].getname() == name:
  1069                     actions.pop(i)
  1069                     actions.pop(i)
  1070                     removed = True
  1070                     removed = True
  1071                 i += 1
  1071                 i += 1
  1072             if not removed:
  1072             if not removed:
  1073                 raise ValueError, _("Action with name %s doesn't exists!")%name
  1073                 raise ValueError, _("Action with name %s doesn't exist!")%name
  1074     setattr(cls, "removeaction", removeaction)
  1074     setattr(cls, "removeaction", removeaction)
  1075 
  1075 
  1076     def updateElementName(self, old_name, new_name):
  1076     def updateElementName(self, old_name, new_name):
  1077         if self.interface:
  1077         if self.interface:
  1078             for content in self.interface.getcontent():
  1078             for content in self.interface.getcontent():
  1324                 if elements[i]["value"].getlocalId() == id:
  1324                 if elements[i]["value"].getlocalId() == id:
  1325                     self.content["value"].removecontent(i)
  1325                     self.content["value"].removecontent(i)
  1326                     removed = True
  1326                     removed = True
  1327                 i += 1
  1327                 i += 1
  1328             if not removed:
  1328             if not removed:
  1329                 raise ValueError, _("Instance with id %d doesn't exists!")%id
  1329                 raise ValueError, _("Instance with id %d doesn't exist!")%id
  1330         else:
  1330         else:
  1331             raise TypeError, "%s body don't have instances!"%self.content["name"]
  1331             raise TypeError, "%s body don't have instances!"%self.content["name"]
  1332     setattr(cls, "removecontentInstance", removecontentInstance)
  1332     setattr(cls, "removecontentInstance", removecontentInstance)
  1333     
  1333     
  1334     def settext(self, text):
  1334     def settext(self, text):