MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / output_to_yaml

Function output_to_yaml

tools/ci/bsp_detail.py:140–149  ·  view source on GitHub ↗
(dataframe, output_file, header_comment)

Source from the content-addressed store, hash-verified

138 file.write(df.to_markdown(index=False))
139
140def 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
152rtt_root = os.getcwd()

Callers 1

bsp_detail.pyFile · 0.85

Calls 3

openFunction · 0.50
writeMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected