@@ -87,12 +87,12 @@ def dicts_to_list_of_dicts(lists_of_dicts_paths_set, xml_dict, path=()):
87
87
88
88
def list_dict_consistency (xml_dict ):
89
89
"""
90
- For use with XML files opened with xmltodict.
90
+ For use with XML files opened with xmltodict.
91
91
92
- If there is only one tag, xmltodict produces a dict. If there are
93
- multiple, xmltodict produces a list of dicts. This functions replaces
94
- dicts with lists of dicts, if there exists a list of dicts for the same
95
- path elsewhere in the file.
92
+ If there is only one tag, xmltodict produces a dict. If there are
93
+ multiple, xmltodict produces a list of dicts. This functions replaces
94
+ dicts with lists of dicts, if there exists a list of dicts for the same
95
+ path elsewhere in the file.
96
96
"""
97
97
lists_of_dicts_paths_set = set (lists_of_dicts_paths (xml_dict ))
98
98
dicts_to_list_of_dicts (lists_of_dicts_paths_set , xml_dict )
@@ -214,7 +214,9 @@ def __init__(
214
214
if self .xml :
215
215
with codecs .open (json_filename , "rb" ) as xml_file :
216
216
top_dict = xmltodict .parse (
217
- xml_file , force_list = (root_list_path ,), force_cdata = True ,
217
+ xml_file ,
218
+ force_list = (root_list_path ,),
219
+ force_cdata = True ,
218
220
)
219
221
# AFAICT, this should be true for *all* XML files
220
222
assert len (top_dict ) == 1
@@ -468,13 +470,19 @@ def parse_json_dict(
468
470
self .use_titles
469
471
and parent_name + key in self .rollup
470
472
and self .schema_parser .sub_sheet_titles .get (
471
- (parent_name , key ,)
473
+ (
474
+ parent_name ,
475
+ key ,
476
+ )
472
477
)
473
478
in self .schema_parser .sub_sheets
474
479
):
475
480
relevant_subsheet = self .schema_parser .sub_sheets .get (
476
481
self .schema_parser .sub_sheet_titles .get (
477
- (parent_name , key ,)
482
+ (
483
+ parent_name ,
484
+ key ,
485
+ )
478
486
)
479
487
)
480
488
if relevant_subsheet is not None :
@@ -546,10 +554,17 @@ def parse_json_dict(
546
554
if (
547
555
self .use_titles
548
556
and self .schema_parser
549
- and (parent_name , key ,) in self .schema_parser .sub_sheet_titles
557
+ and (
558
+ parent_name ,
559
+ key ,
560
+ )
561
+ in self .schema_parser .sub_sheet_titles
550
562
):
551
563
sub_sheet_name = self .schema_parser .sub_sheet_titles [
552
- (parent_name , key ,)
564
+ (
565
+ parent_name ,
566
+ key ,
567
+ )
553
568
]
554
569
else :
555
570
sub_sheet_name = make_sub_sheet_name (
0 commit comments