Skip to content

Commit 835f291

Browse files
baili0411Chromeos LUCI
authored and
Chromeos LUCI
committed
sound_card_init_yaml_to_xml.py: Remove parent element for lists
serde_xml_rs can parse listed items fine as long as they are listed consecutively. Remove the parent element generated when parsing YAML lists. BUG=b:377624799 TEST=`python3 sound_card_init_yaml_to_xml.py \ ${SRC}/overlays/overlay-brya/chromeos-base/chromeos-bsp-brya/files \ ../sound_card_init` Change-Id: Ia170c245d48e827610452073aa80cc3f68b16b72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/6060362 Tested-by: [email protected] <[email protected]> Commit-Queue: Baili Deng <[email protected]> Reviewed-by: Yu-Hsuan Hsu <[email protected]>
1 parent cea8077 commit 835f291

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

devtools/sound_card_init_yaml_to_xml.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def dict_to_xml_element(data, root):
3030
sub_element = ET.SubElement(root, key)
3131
dict_to_xml_element(value, sub_element)
3232
elif isinstance(value, list):
33-
sub_element = ET.SubElement(root, key + '_list')
34-
list_to_xml_element(value, sub_element, key)
33+
list_to_xml_element(value, root, key)
3534
else:
3635
ET.SubElement(root, key).text = str(value)
3736

@@ -46,7 +45,7 @@ def dict_to_xml(data, output_file):
4645
"you may not use this file except in compliance with the License.\n"
4746
"You may obtain a copy of the License at\n\n"
4847
" http://www.apache.org/licenses/LICENSE-2.0\n\n"
49-
"Unless required by applicable law or agreed to in writing, software \n"
48+
"Unless required by applicable law or agreed to in writing, software\n"
5049
"distributed under the License is distributed on an \"AS IS\" BASIS,\n"
5150
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
5251
"See the License for the specific language governing permissions and\n"

0 commit comments

Comments
 (0)