Merge branch 'feature/support_comments_in_csv' into 'master'

nvs_util: Add support to include comments in csv file

See merge request idf/esp-idf!4656
pull/3266/head
Angus Gratton 2019-04-03 11:12:51 +08:00
commit 30e3e26834
3 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -752,7 +752,7 @@ def nvs_part_gen(input_filename=None, output_filename=None, input_part_size=None
output_file = open(output_filename, 'wb')
with nvs_open(output_file, input_size) as nvs_obj:
reader = csv.DictReader(input_file, delimiter=',')
reader = csv.DictReader(filter(lambda row: row[0] != '#',input_file), delimiter=',')
for row in reader:
try:
write_entry(nvs_obj, row["key"], row["type"], row["encoding"], row["value"])

Wyświetl plik

@ -1,3 +1,4 @@
# Sample csv file
key,type,encoding,value
dummyNamespace,namespace,,
dummyU8Key,data,u8,127

1 key # Sample csv file type encoding value
1 # Sample csv file
2 key key,type,encoding,value type encoding value
3 dummyNamespace dummyNamespace,namespace,, namespace
4 dummyU8Key dummyU8Key,data,u8,127 data u8 127

Wyświetl plik

@ -1,3 +1,4 @@
# Sample csv file
key,type,encoding,value
dummyNamespace,namespace,,
dummyU8Key,data,u8,127

1 key # Sample csv file type encoding value
1 # Sample csv file
2 key key,type,encoding,value type encoding value
3 dummyNamespace dummyNamespace,namespace,, namespace
4 dummyU8Key dummyU8Key,data,u8,127 data u8 127