def gen_scpUsage(self): gen_str = '' fp = open(os.path.join(ModuleObj.get_genPath(), self.__fileScp), 'w') gen_str += ModuleObj.writeComment() gen_str += ModuleObj.writeHeader(self.__fileScp) gen_str += self.fill_cFile() gen_str += ModuleObj.writeTail(self.__fileScp) fp.write(gen_str) fp.close()
def gen_pinCtrl(self): gen_str = '' fp = open(os.path.join(ModuleObj.get_genPath(), self.__filePinCtrl), 'w') gen_str += ModuleObj.writeComment() gen_str += ModuleObj.writeHeader(self.__filePinCtrl) gen_str += self.fill_pinctrl_hFile() gen_str += ModuleObj.writeTail(self.__filePinCtrl) fp.write(gen_str) fp.close()
def gen_custDtsi(self): log(LogLevel.info, 'Start to generate cust_dtsi file...') fp = open(os.path.join(ModuleObj.get_genPath(), 'cust.dtsi'), 'w') gen_str = ModuleObj.writeComment() #sorted_list = sorted(self.__objs.keys()) #for tag in sorted_list: for tag in list(self.__objs.keys()): if cmp(tag, 'gpio') == 0: gpioObj = self.create_obj(tag) gen_str += ModuleObj.writeHeader(gpioObj.get_dtsiFileName()) gen_str += gpioObj.fill_mapping_dtsiFile() else: obj = self.create_obj(tag) gen_str += ModuleObj.writeHeader(obj.get_dtsiFileName()) gen_str += obj.fill_dtsiFile() gen_str += '''\n\n''' fp.write(gen_str) fp.close() log(LogLevel.info, 'Generate cust_dtsi file successfully!')