def __init__(self, trait, data): Element.__init__(self, 'debconf') self.setAttribute('trait', trait) self.dc = Debconf_object() self.dc.name = TextElement('name', data['name']) self.appendChild(self.dc.name) self.dc.template = TextElement('template', data['template']) self.appendChild(self.dc.template) self.dc.owners = TextElement('owners', data['owners']) self.appendChild(self.dc.owners) self.dc.value = TextElement('value', data['value']) self.appendChild(self.dc.value)
def __init__(self, conn, suite): self.conn = conn self.cursor = StatementCursor(self.conn, name='_Trait_') Element.__init__(self, 'trait') self.desc_element = TextElement('description', None) self.parent_element = Element('parents') self.pkg_element = Element('packages') self.env_element = Element('environ') self.templ_element = Element('templates') self.scripts_element = Element('scripts') self.debconf_element = DebConfigurationElement() self.appendChild(self.desc_element) self.appendChild(self.parent_element) self.appendChild(self.pkg_element) self.appendChild(self.env_element) self.appendChild(self.templ_element) self.appendChild(self.debconf_element) self.appendChild(self.scripts_element) self.set_suite(suite)
def append_parents(self, parents): for parent in parents: pelement = TextElement('parent', parent) #pelement.setAttribute('ord', str(trait.ord)) self.parents.appendChild(pelement)
def append_families(self, rows): for row in rows: felement = TextElement('family', row.family) self.families.appendChild(felement)
def append_traits(self, trait_rows): for trait in trait_rows: telement = TextElement('trait', trait.trait) telement.setAttribute('ord', str(trait.ord)) self.traits.appendChild(telement)