plcopen/plcopen.py
changeset 1318 758801f4b296
parent 1313 85c167bfff93
child 1322 0a9227f743b3
equal deleted inserted replaced
1317:177d7cd76a3e 1318:758801f4b296
  1623             raise TypeError, _("%s body don't have instances!")%self.content.getLocalTag()
  1623             raise TypeError, _("%s body don't have instances!")%self.content.getLocalTag()
  1624     setattr(cls, "getcontentInstanceByName", getcontentInstanceByName)
  1624     setattr(cls, "getcontentInstanceByName", getcontentInstanceByName)
  1625     
  1625     
  1626     def removecontentInstance(self, local_id):
  1626     def removecontentInstance(self, local_id):
  1627         if self.content.getLocalTag() in ["LD","FBD","SFC"]:
  1627         if self.content.getLocalTag() in ["LD","FBD","SFC"]:
  1628             instance = instance_by_id_xpath(self.content)
  1628             instance = instance_by_id_xpath(self.content, localId=local_id)
  1629             if len(instance) > 0:
  1629             if len(instance) > 0:
  1630                 self.content.remove(instance[0])
  1630                 self.content.remove(instance[0])
  1631             else:
  1631             else:
  1632                 raise ValueError, _("Instance with id %d doesn't exist!")%id
  1632                 raise ValueError, _("Instance with id %d doesn't exist!")%id
  1633         else:
  1633         else: