本文整理汇总了Python中xml.dom.minidom.Element.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Element.__init__方法的具体用法?Python Element.__init__怎么用?Python Element.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml.dom.minidom.Element
的用法示例。
在下文中一共展示了Element.__init__方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, name, subtag_name, data, name_att='name'):
Element.__init__(self, name)
self.__data_dict__ = {}
for key, value in data.items():
self.__data_dict__[key] = TextElement(subtag_name, value)
self.__data_dict__[key].setAttribute('name', key)
self.appendChild(self.__data_dict__[key])
示例2: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, conn, path='/'):
Element.__init__(self, 'paelladatabase')
self.conn = conn
self.stmt = StatementCursor(self.conn)
self._profile_traits_ = ProfileTrait(self.conn)
self.path = path
self.aptsources = AptSourceListElement()
self.appendChild(self.aptsources)
if 'apt_sources' in self.stmt.tables():
for row in self.stmt.select(table='apt_sources', order=['apt_id']):
element = AptSourceElement(row.apt_id, row.uri, row.dist, row.sections,
row.local_path)
self.aptsources.appendChild(element)
self.suites = SuitesElement()
self.appendChild(self.suites)
for row in self._suite_rows():
args = map(str, [row.suite, row.nonus, row.updates, row.local, row.common])
element = SuiteElement(*args)
for suiteapt in self.stmt.select(table='suite_apt_sources', order=['ord'],
clause=Eq('suite', row.suite)):
element.appendChild(SuiteAptElement(row.suite,
suiteapt.apt_id, str(suiteapt.ord)))
self.suites.appendChild(element)
else:
print 'WARNING, apt_sources table does not exist, backing up anyway'
self.profiles = PaellaProfiles(self.conn)
self.family = Family(self.conn)
suites = [x.suite for x in self._suite_rows()]
for suite in suites:
self.appendChild(TraitsElement(self.conn, suite))
示例3: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, name, reference_class=None, array_size=None, qualifiers=[]):
Element.__init__(self, "PARAMETER.REFARRAY")
self.setName(name)
self.setOptionalAttribute("REFERENCECLASS", reference_class)
if array_size is not None:
self.setAttribute("ARRAYSIZE", str(array_size))
self.appendChildren(qualifiers)
示例4: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, suite, nonus=False, updates=False, local=False, common=False):
Element.__init__(self, "suite")
self.setAttribute("name", suite)
self.setAttribute("nonus", nonus)
self.setAttribute("updates", updates)
self.setAttribute("local", local)
self.setAttribute("common", common)
示例5: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, conn, machines=None):
raise RuntimeError , "ClientMachineDatabaseElement isn't working"
Element.__init__(self, 'machine_database')
self.conn = conn
if machines is not None:
self.machines = MachinesElement(conn, machines)
self.appendChild(self.machines)
示例6: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, ownerDocument, name=""):
Element.__init__(self, TAG_CATEGORY)
self.name = name
self.ownerDocument = ownerDocument
self._items = []
self.setAttribute("name", self.name)
示例7: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, name, data=None, paramtype=None,
embedded_object=None):
Element.__init__(self, 'PARAMVALUE')
self.setName(name)
self.setOptionalAttribute('PARAMTYPE', paramtype)
self.setOptionalAttribute('EmbeddedObject', embedded_object)
self.appendOptionalChild(data)
示例8: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, name):
Element.__init__(self, 'family')
self.setAttribute('name', name)
self.parents = Element('parents')
self.environ = Element('environ')
self.appendChild(self.parents)
self.appendChild(self.environ)
示例9: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self):
Element.__init__(self, 'paelladatabase')
self.aptsources = AptSourceListElement()
self.appendChild(self.aptsources)
self.suites_element = SuitesElement()
self.suites = {}
self.suite_traits = {}
self.appendChild(self.suites_element)
示例10: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, mnt_name, mnt_point, fstype, mnt_opts, dump, pass_):
Element.__init__(self, "mount")
self.setAttribute("mnt_name", mnt_name)
self.setAttribute("mnt_point", mnt_point)
self.setAttribute("fstype", fstype)
self.setAttribute("mnt_opts", mnt_opts)
self.setAttribute("dump", dump)
self.setAttribute("pass", pass_)
示例11: __init__
# 需要导入模块: from xml.dom.minidom import Element [as 别名]
# 或者: from xml.dom.minidom.Element import __init__ [as 别名]
def __init__(self, conn):
Element.__init__(self, 'profiles')
self.conn = conn
self.stmt = StatementCursor(self.conn)
self.env = ProfileEnvironment(self.conn)
self.profiletraits = ProfileTrait(self.conn)
self._profiles = {}
for row in self.stmt.select(table='profiles', order='profile'):
self._append_profile(row.profile, row.suite)