Example #1
0
 def SaveXml(self):
     """
     Take a snapshot of the current Configuration/Status and write out an XML file.
     """
     l_xml = configAPI(self.m_pyhouse_obj).create_xml_config_foundation(self.m_pyhouse_obj)
     self.m_pyhouse_obj.APIs.Computer.ComputerAPI.SaveXml(l_xml)
     self.m_pyhouse_obj.APIs.House.HouseAPI.SaveXml(l_xml)
     configAPI(self.m_pyhouse_obj).write_xml_config_file(self.m_pyhouse_obj, l_xml)
     LOG.info("Saved all XML sections to config file.\n")
Example #2
0
 def SaveXml(self):
     """
     Take a snapshot of the current Configuration/Status and write out an XML file.
     """
     l_xml = configAPI(self.m_pyhouse_obj).create_xml_config_foundation(self.m_pyhouse_obj)
     self.m_pyhouse_obj.APIs.Computer.ComputerAPI.SaveXml(l_xml)
     self.m_pyhouse_obj.APIs.House.HouseAPI.SaveXml(l_xml)
     configAPI(self.m_pyhouse_obj).write_xml_config_file(self.m_pyhouse_obj, l_xml)
     LOG.info("Saved all XML sections to config file.\n")
Example #3
0
    def Start(self):
        """
        The reactor is now running.

        @param p_pyhouse_obj: is the skeleton Obj filled in some by PyHouse.py.
        """
        #  First we start up the logging system - no need for XML yes as it is at a fixrd location
        Utility._sync_startup_logging(self.m_pyhouse_obj)
        #  Next is the XML file do things can be read in and customized
        self.m_pyhouse_obj = configAPI(self.m_pyhouse_obj).read_xml_config_file(self.m_pyhouse_obj)
        #  next Starting the computer and House will load the respective divisions of the config file.
        self.m_pyhouse_obj.APIs.Computer.ComputerAPI.Start()
        self.m_pyhouse_obj.APIs.House.HouseAPI.Start()
        self.m_pyhouse_obj.Twisted.Reactor.callLater(INITIAL_DELAY, self._xml_save_loop, self.m_pyhouse_obj)
        #  LOG.debug(' PyHouseObj: {}'.format(PrettyFormatAny.form(PyHouseObj, 'PyHouseObj')))
        LOG.info("Everything has been started.\n")
Example #4
0
 def setUp(self):
     SetupMixin.setUp(self, ET.fromstring(XML_LONG))
     SetupPyHouseObj().BuildXml(self.m_xml.root)
     self.m_api = configAPI(self.m_pyhouse_obj)
Example #5
0
 def LoadXml(self, p_pyhouse_obj):
     LOG.info('Loading XML')
     p_pyhouse_obj = configAPI(p_pyhouse_obj).read_xml_config_file(p_pyhouse_obj)
     p_pyhouse_obj.APIs.Computer.ComputerAPI.LoadXml(p_pyhouse_obj)
     p_pyhouse_obj.APIs.House.HouseAPI.LoadXml(p_pyhouse_obj)
     LOG.info('Loaded XML')
Example #6
0
 def setUp(self):
     SetupMixin.setUp(self, ET.fromstring(XML_LONG))
     SetupPyHouseObj().BuildXml(self.m_xml.root)
     self.m_api = configAPI(self.m_pyhouse_obj)