def reform(self, element): name = element.tagName.encode() if name != 'package': raise Error, 'bad package tag' package = element.firstChild.data.encode() action = element.getAttribute('action').encode() TextElement.__init__(self, package, action)
def reform(self, element): name = element.tagName.encode() if name != "package": raise Error, "bad package tag" package = element.firstChild.data.encode() action = element.getAttribute("action").encode() TextElement.__init__(self, package, action)
def __init__(self, package, template, mode='0100644', owner='root', grp_owner='root'): TextElement.__init__(self, 'template', template) self.setAttribute('package', package) self.setAttribute('mode', mode) self.setAttribute('owner', owner) self.setAttribute('grp_owner', grp_owner)
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 __init__(self, etype, trait, name, value): TextElement.__init__(self, etype, value) self.setAttribute('trait', trait) self.setAttribute('name', name)
def __init__(self, package, action='install'): TextElement.__init__(self, 'package', package) self.setAttribute('action', action) self.package = package self.action = action
def append_families(self, rows): for row in rows: felement = TextElement('family', row.family) self.families.appendChild(felement)
def __init__(self, name): TextElement.__init__(self, 'kernel', name)
def __init__(self, package, action="install"): TextElement.__init__(self, "package", package) self.setAttribute("action", action) self.package = package self.action = action
def __init__(self, trait, name, value): TextElement.__init__(self, "profile_variable", value) self.setAttribute("trait", trait) self.setAttribute("name", name)
def __init__(self, mtype, module, order): TextElement.__init__(self, 'module', module) self.setAttribute('machine_type', mtype) self.setAttribute('order', order)
def __init__(self, machine, machine_type, kernel, profile, filesystem): TextElement.__init__(self, 'machine', machine) self.setAttribute('machine_type', machine_type) self.setAttribute('kernel', kernel) self.setAttribute('profile', profile) self.setAttribute('filesystem', filesystem)
def __init__(self, package, template, mode="0100644", owner="root", grp_owner="root"): TextElement.__init__(self, "template", template) self.setAttribute("package", package) self.setAttribute("mode", mode) self.setAttribute("owner", owner) self.setAttribute("grp_owner", grp_owner)
def __init__(self, parent): TextElement.__init__(self, "parent", parent)
def __init__(self, parent): TextElement.__init__(self, 'parent', parent)
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)
def __init__(self, trait, name, value): TextElement.__init__(self, 'profile_variable', value) self.setAttribute('trait', trait) self.setAttribute('name', name)