def addChild(self, child): """ Parse rpm:entry and suse:entry nodes. """ if child.getName() in ('rpm:entry', 'suse:entry'): for attr, value in child.iterAttributes(): if attr == 'kind': child.kind = value elif attr == 'name': child.name = value elif attr == 'epoch': child.epoch = value elif attr == 'ver': child.version = value elif attr == 'rel': child.release = value elif attr == 'flags': child.flags = value elif attr == 'pre': child.pre = value else: raise UnknownAttributeError(child, attr) SlotNode.addChild(self, child) else: raise UnknownElementError(child)
def addChild(self, child): """ Update child attributes. """ if child.getName() != 'package': raise UnknownElement(child) child.name = None child.arch = None child.version = None child.release = None # SLES11 updateinfo.xml doesn't provide checksums or archive sizes. child.checksum = None child.archiveSize = None child.location = '' for attr, value in child.iterAttributes(): if attr == 'name': child.name = value elif attr == 'arch': child.arch = value elif attr == 'version': child.version = value elif attr == 'release': child.release = value else: raise UnknownAttributeError(child, attr) SlotNode.addChild(self, child)
def addChild(self, child): """ Parse children of repomd element. """ # W0212 - Access to a protected member _parser of a client class # pylint: disable=W0212 name = child.getName() if name == 'revision': self.revision = child.finalize() elif name == 'tags': # FIXME: Is this complete? -jau self.tags = child.finalize() elif name == 'data': child.type = child.getAttribute('type') if child.type == 'patches': child._parser = PatchesXml(None, child.location) child.parseChildren = child._parser.parse elif child.type == 'primary': child._parser = PrimaryXml(None, child.location) child.parseChildren = child._parser.parse elif child.type == 'filelists': child._parser = FileListsXml(None, child.location) child.parseChildren = child._parser.parse elif child.type == 'updateinfo': child._parser = UpdateInfoXml(None, child.location) child.parseChildren = child._parser.parse SlotNode.addChild(self, child) else: raise UnknownElementError(child)
def addChild(self, child): """ Set attributes on child nodes. """ if child.getName() != 'update': raise UnknownElement(child) child.status = None child.emailfrom = None child.type = None child.version = None for attr, value in child.iterAttributes(): if attr == 'status': child.status = value elif attr == 'from': child.emailfrom = value elif attr == 'type': child.type = value elif attr == 'version': child.version = value else: raise UnknownAttributeError(child, attr) SlotNode.addChild(self, child)
def addChild(self, child): """ Parse children of filelists element. """ if child.getName() == 'package': child.name = child.getAttribute('name') child.arch = child.getAttribute('arch') SlotNode.addChild(self, child)
def addChild(self, child): """ Parse children of metadata element. """ if child.getName() == 'package': child.type = child.getAttribute('type') SlotNode.addChild(self, child) else: raise UnknownElementError(child)
def addChild(self, child): """ Parse children of atoms element. """ n = child.getName() if n == "package": child.type = child.getAttribute("type") SlotNode.addChild(self, child) elif n == "message": pass elif n == "script": pass else: raise UnknownElementError(child)
def addChild(self, child): """ Parse children of patches element. """ # W0212 - Access to a protected member _parser of a client class # pylint: disable=W0212 if child.getName() == 'patch': child.id = child.getAttribute('id') child._parser = PatchXml(None, child.location) child.parseChildren = child._parser.parse SlotNode.addChild(self, child) else: raise UnknownElementError(child)
def addChild(self, child): """ Parse children of atoms element. """ n = child.getName() if n == 'package': child.type = child.getAttribute('type') SlotNode.addChild(self, child) elif n == 'message': pass elif n == 'script': pass else: raise UnknownElementError(child)
def addChild(self, child): if child.getName() != 'reference': raise UnknownElementError(child) child.href = None child.id = None child.title = None child.type = None for attr, value in child.iterAttributes(): if attr == 'href': child.href = value elif attr == 'id': child.id = value elif attr == 'title': child.title = value elif attr == 'type': child.type = value else: raise UnknownAttributeError(child, attr) SlotNode.addChild(self, child)
def __init__(self, *args, **kwargs): SlotNode.__init__(self, *args, **kwargs) # Need access to this so it can be modified when syncing a # patch's timestamp across architectures. self.timestamp = self.getAttribute("timestamp")
def __init__(self, *args, **kwargs): SlotNode.__init__(self, *args, **kwargs) # Need access to this so it can be modified when syncing a # patch's timestamp across architectures. self.timestamp = self.getAttribute('timestamp')