Пример #1
0
    def test_find(self):
        '''Test get_val methode with project template'''
        af_obj = XmlAttribFinder(self._root_el_prj_file)

        header_path = af_obj.get_val('gccXmlSettings.headerPath')
        self.assertEqual(header_path, "")

        inc_path_list = af_obj.get_val('gccXmlSettings.includePathList')
        self.assertEqual(eval(inc_path_list), [])

        inc_path_list_obj = af_obj.get_obj('gccXmlSettings.includePathList')

        self.assertTrue(inc_path_list_obj[1], [])

        self.assertRaises(AttribNotFound, af_obj.get_val,
                          ('gccXmlSettings.xxx'))
    def test_find(self):
        '''Test get_val methode with project template'''
        af_obj = XmlAttribFinder(self._root_el_prj_file)
        
        header_path = af_obj.get_val('gccXmlSettings.headerPath')
        self.assertEqual(header_path, "")
        
        inc_path_list = af_obj.get_val('gccXmlSettings.includePathList')
        self.assertEqual(eval(inc_path_list), [])
        
        inc_path_list_obj = af_obj.get_obj('gccXmlSettings.includePathList')

        self.assertTrue(inc_path_list_obj[1], [])
        
        self.assertRaises(AttribNotFound, af_obj.get_val, 
                          ('gccXmlSettings.xxx'))
Пример #3
0
    def _load(self, file_name):  #@UnusedVariable
        '''
        Load settings from given file
        @param file_name: path of file. Format is XML.
        @param ide_ui: wxPython ctrl of ide 
        @param param_obj: object holding parameters
        '''
        self._file_name = file_name

        ide_ui = self._ide_ui  #@UnusedVariable
        param_obj = self._param_obj  #@UnusedVariable

        root_element = ElementTree(file=file_name).getroot()
        attrib_finder = XmlAttribFinder(root_element)

        # Loop through our parameter list
        for xml_attrib_name, rel_obj_str in self._param_list:
            # In eval we need ide_ui and param_obj
            # print "XML:%s obj_str:%s" % (xml_attrib_name, rel_obj_str)
            param = ParameterAccess(eval(rel_obj_str))
            attrib_val = attrib_finder.get_val(xml_attrib_name)
            param.update_related_object(attrib_val)
Пример #4
0
    def _load(self, file_name):#@UnusedVariable
        '''
        Load settings from given file
        @param file_name: path of file. Format is XML.
        @param ide_ui: wxPython ctrl of ide 
        @param param_obj: object holding parameters
        '''
        self._file_name = file_name

        ide_ui = self._ide_ui #@UnusedVariable
        param_obj = self._param_obj #@UnusedVariable

        root_element = ElementTree(file=file_name).getroot()
        attrib_finder = XmlAttribFinder(root_element)
        
        # Loop through our parameter list
        for xml_attrib_name, rel_obj_str in self._param_list:
            # In eval we need ide_ui and param_obj
            # print "XML:%s obj_str:%s" % (xml_attrib_name, rel_obj_str)
            param = ParameterAccess(eval(rel_obj_str))
            attrib_val = attrib_finder.get_val(xml_attrib_name)
            param.update_related_object(attrib_val)