plcopen/plcopen.py
changeset 1234 9623d591efb9
parent 1232 b6894285d4cc
child 1261 46425f3248b7
equal deleted inserted replaced
1233:5e6d0969bb5d 1234:9623d591efb9
  1882             raise TypeError, _("%s body don't have instances!")%self.content["name"]
  1882             raise TypeError, _("%s body don't have instances!")%self.content["name"]
  1883     setattr(cls, "getcontentInstanceByName", getcontentInstanceByName)
  1883     setattr(cls, "getcontentInstanceByName", getcontentInstanceByName)
  1884     
  1884     
  1885     def removecontentInstance(self, id):
  1885     def removecontentInstance(self, id):
  1886         if self.content["name"] in ["LD","FBD","SFC"]:
  1886         if self.content["name"] in ["LD","FBD","SFC"]:
  1887             element = self.instances_dict.get(id, None)
  1887             element = self.instances_dict.pop(id, None)
  1888             if element is not None:
  1888             if element is not None:
  1889                 self.content["value"].getcontent().remove(element)
  1889                 self.content["value"].getcontent().remove(element)
  1890             else:
  1890             else:
  1891                 raise ValueError, _("Instance with id %d doesn't exist!")%id
  1891                 raise ValueError, _("Instance with id %d doesn't exist!")%id
  1892         else:
  1892         else: