def _parse_chips(self, module): chipname = module['id'] partno = module['partno'] method_name = 'parse_' + partno.lower() try: XObject.get_classes()[partno].parse_chip_profile( module, self._base_board_name) except AttributeError: logger.boot( 'warning: unable to parser the %s partno of the %s chip: has no the method %s' % (partno, chipname, method_name)) raise
def _parse_boards(self, board): initconfig = Profile.get_initconfig() initconfig['boards'] = initconfig.setdefault('boards', list()) board_name = board['id'] partno = board['partno'] partno_list = partno.replace('-', '_') method_name = 'parse_' + partno_list.lower() class_name = partno.replace('-', '') try: XObject.get_classes()[class_name].parse_board_profile(board) initconfig['boards'].append(board_name) except AttributeError: logger.boot( 'warning: unable to parser the %s partno of the %s board: has no the method %s' % (partno, board_name, method_name)) raise