(dataframe, output_file, header_comment)
| 138 | file.write(df.to_markdown(index=False)) |
| 139 | |
| 140 | def output_to_yaml(dataframe, output_file, header_comment): |
| 141 | data = dataframe.to_dict(orient='records') |
| 142 | yaml_data = {} |
| 143 | for item in data: |
| 144 | folder = item.pop('Folder') |
| 145 | filtered_item = {k: v for k, v in item.items() if v is True or isinstance(v, str)} |
| 146 | yaml_data[folder] = filtered_item |
| 147 | with open(output_file, 'w', encoding='utf-8') as file: |
| 148 | file.write(f"# {header_comment}\n") |
| 149 | yaml.dump(yaml_data, file, default_flow_style=False, allow_unicode=True) |
| 150 | |
| 151 | # Find the rt-thread root directory |
| 152 | rtt_root = os.getcwd() |
no test coverage detected