Ejemplo n.º 1
0
	def __init__(self, data=None):
		Document.__init__(self)

		if data is not None:
			self.__dict__ = parseString(data).__dict__

		self.annotations = { }
    def __init__(self, mlist, addPic, featurelist):
		#def __init__(self, mlist):
		Document.__init__(self)
		self.mlist=mlist
		self.addPic=addPic
		self.featurelist=featurelist
		self.generateXML()
Ejemplo n.º 3
0
    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)
    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()
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
 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')
Ejemplo n.º 8
0
 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')
Ejemplo n.º 9
0
 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')
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 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')
Ejemplo n.º 12
0
    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)
Ejemplo n.º 13
0
    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()
Ejemplo n.º 14
0
    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)
Ejemplo n.º 15
0
    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)
Ejemplo n.º 16
0
    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()
Ejemplo n.º 17
0
 def __init__(self):
     Document.__init__(self)
Ejemplo n.º 18
0
 def __init__(self):
     Document.__init__(self)
     self.coll = self.createElement("collection")
     self.appendChild(self.coll)
     self.__NrOfRecords = 0
Ejemplo n.º 19
0
 def __init__(self, root_element):
     Document.__init__(self)
     self.appendChild(root_element)
Ejemplo n.º 20
0
 def __init__(self):
     Document.encoding = 'utf-8'
     Document.__init__(self)
     self.tree = None
     self.child_tree = None
     self.graph = None
Ejemplo n.º 21
0
Archivo: som.py Proyecto: lcrees/psilib
 def __init__(self):
     '''Initializes base Document DOM class'''
     Document.__init__(self)
Ejemplo n.º 22
0
 def __init__(self):
     Document.encoding = 'utf-8'
     Document.__init__(self)
     self.tree = None
     self.child_tree = None
     self.graph = None
Ejemplo n.º 23
0
 def __init__(self):
     Document.__init__(self)