本文整理汇总了Python中xml.dom.minidom.Document.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Document.__init__方法的具体用法?Python Document.__init__怎么用?Python Document.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml.dom.minidom.Document
的用法示例。
在下文中一共展示了Document.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, data=None):
Document.__init__(self)
if data is not None:
self.__dict__ = parseString(data).__dict__
self.annotations = { }
示例2: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, mlist, addPic, featurelist):
#def __init__(self, mlist):
Document.__init__(self)
self.mlist=mlist
self.addPic=addPic
self.featurelist=featurelist
self.generateXML()
示例3: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, mlist, addPic, waittime, resultLoc, rangeV):
#def __init__(self, mlist):
Document.__init__(self)
self.mlist=mlist
self.addPic=addPic
self.waittime=waittime
self.resultLoc=resultLoc
self.rangeV=rangeV
self.generateXML()
示例4: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self):
"""
Constructor
initialize base elements
"""
Document.__init__(self)
self.standalone = 'no'
self.rws = self.createElementNS(self.RWS_URN, 'rws')
self.rws.setAttribute('xmlns', self.RWS_URN)
self.appendChild(self.rws)
self.result_node = self.createElement('result')
self.rws.appendChild(self.result_node)
示例5: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, session):
"""
Create an empty Scenario XML Document, then populate it with
objects from the given session.
"""
Document.__init__(self)
logger.debug('Exporting to NMF XML version 1.0')
with session._objects_lock:
self.scenarioPlan = ScenarioPlan(self, session)
if session.state == EventTypes.RUNTIME_STATE.value:
deployment = CoreDeploymentWriter(self, self.scenarioPlan, session)
deployment.add_deployment()
self.scenarioPlan.setAttribute('deployed', 'true')
示例6: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, session):
''' Create an empty Scenario XML Document, then populate it with
objects from the given session.
'''
Document.__init__(self)
session.info('Exporting to NMF XML version 1.0')
with session._objslock:
self.scenarioPlan = ScenarioPlan(self, session)
if session.getstate() == coreapi.CORE_EVENT_RUNTIME_STATE:
deployment = CoreDeploymentWriter(self, self.scenarioPlan,
session)
deployment.add_deployment()
self.scenarioPlan.setAttribute('deployed', 'true')
示例7: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, styleSheetUrl="\"proviola.xsl" + "\""):
Document.__init__(self)
self.frameNumber = 0
self.film = self.createElement("film")
styleSheetRef = self.createProcessingInstruction("xml-stylesheet",\
"type=\"text/xsl\" href=" + styleSheetUrl)
self.appendChild(styleSheetRef)
movie = self.createElement("movie")
self.appendChild(movie)
movie.appendChild(self.film)
示例8: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self):
Document.__init__(self)
self.top = self.createElementNS("http://www.ctcms.nist.gov/fipy", "FiPy")
Document.appendChild(self, self.top)
self.appendChild(self.tupleToXML(sys.argv, "sys.argv"))
version = self.createElement("version")
self.appendChild(version)
version.appendChild(self.createTextNode(fipy.__version__))
path = self.createElement("path")
fipypath = os.path.dirname(fipy.__file__)
path.appendChild(self.createTextNode(fipypath))
self.appendChild(path)
self.appendChild(self.svn(fipypath))
self.appendChild(self.dictToXML(os.environ, "environ"))
pyth = self.createElement("python")
implementation = self.createElement("implementation")
if hasattr(platform, "python_implementation"):
implementation.appendChild(self.createTextNode(platform.python_implementation()))
else:
implementation.appendChild(self.createTextNode("unknown"))
pyth.appendChild(implementation)
pversion = self.createElement("version")
pversion.appendChild(self.createTextNode(platform.python_version()))
pyth.appendChild(pversion)
compiler = self.createElement("compiler")
compiler.appendChild(self.createTextNode(platform.python_compiler()))
pyth.appendChild(compiler)
pyth.appendChild(self.tupleToXML(platform.python_build(), "build",
keys=("buildno", "builddate")))
pyth.appendChild(self.tupleToXML(platform.architecture(), "architecture",
keys=("bits", "linkage")))
pyth.appendChild(self.tupleToXML(platform.uname(), "uname",
keys=("system", "node", "release", "version", "machine", "processor")))
self.appendChild(pyth)
示例9: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, alertType):
Document.__init__(self)
self.root_node = self.createElement(alertType)
self.root_node.setAttribute('version', XML_INTERFACE_VERSION)
self.authkey_node = self.createElement('authkey')
self.authkey_node.setAttribute('category', AUTH_CATEGORY)
self.date_node = self.createElement('date')
self.contact_name_node = self.createElement('contact-name')
self.contact_mail_node = self.createElement('contact-mail')
self.root_node.appendChild(self.authkey_node)
self.root_node.appendChild(self.date_node)
self.root_node.appendChild(self.contact_name_node)
self.root_node.appendChild(self.contact_mail_node)
self.appendChild(self.root_node)
示例10: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, session):
""" Create an empty Scenario XML Document, then populate it with
objects from the given session.
"""
Document.__init__(self)
self.session = session
self.scenario = self.createElement("Scenario")
self.np = self.createElement("NetworkPlan")
self.mp = self.createElement("MotionPlan")
self.sp = self.createElement("ServicePlan")
self.meta = self.createElement("CoreMetaData")
self.appendChild(self.scenario)
self.scenario.appendChild(self.np)
self.scenario.appendChild(self.mp)
self.scenario.appendChild(self.sp)
self.scenario.appendChild(self.meta)
self.populatefromsession()
示例11: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self):
Document.encoding = 'utf-8'
Document.__init__(self)
self.tree = None
self.child_tree = None
self.graph = None
示例12: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self):
Document.__init__(self)
示例13: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self, root_element):
Document.__init__(self)
self.appendChild(root_element)
示例14: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self):
Document.__init__(self)
self.coll = self.createElement("collection")
self.appendChild(self.coll)
self.__NrOfRecords = 0
示例15: __init__
# 需要导入模块: from xml.dom.minidom import Document [as 别名]
# 或者: from xml.dom.minidom.Document import __init__ [as 别名]
def __init__(self):
'''Initializes base Document DOM class'''
Document.__init__(self)