def close(self): object_history.close(self.history)
p.wait() old_of = sys.stdout sys.stdout = open(header_file, "w") yin_parser.process(yin_file, history_file) sys.stdout.close() sys.stdout = old_of object_history.init(cfg_file + ".hist") name = os.path.basename(cfg_file) if name.rfind(".") != -1: name = name[:name.rfind(".")] f = open(out_path + "/" + name + ".h", "w") yin_utils.header_file_open(cfg_file, name, f) f.write("typedef enum " + model_list_name + " { \n") en = object_history.get().get_enum(model_list_name) for entry in model_list: f.write(" " + entry + " = " + str(en.get_value(entry)) + ", \n") f.write("} " + model_list_name + "; \n") yin_utils.header_file_close(f) f.close() object_history.close()