Skip to content

Commit 84d83cb

Browse files
authored
Merge pull request #395 from OpenDataServices/update-black
Update black, to avoid click import error
2 parents 4c58e2f + 24308f7 commit 84d83cb

14 files changed

+882
-166
lines changed

flattentool/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ def to_list(self):
11501150

11511151

11521152
def temporarydicts_to_lists(nested_dict):
1153-
""" Recursively transforms TemporaryDicts to lists inplace. """
1153+
"""Recursively transforms TemporaryDicts to lists inplace."""
11541154
for key, value in nested_dict.items():
11551155
if isinstance(value, Cell):
11561156
continue

flattentool/json_input.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ def dicts_to_list_of_dicts(lists_of_dicts_paths_set, xml_dict, path=()):
8787

8888
def list_dict_consistency(xml_dict):
8989
"""
90-
For use with XML files opened with xmltodict.
90+
For use with XML files opened with xmltodict.
9191
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.
9696
"""
9797
lists_of_dicts_paths_set = set(lists_of_dicts_paths(xml_dict))
9898
dicts_to_list_of_dicts(lists_of_dicts_paths_set, xml_dict)
@@ -214,7 +214,9 @@ def __init__(
214214
if self.xml:
215215
with codecs.open(json_filename, "rb") as xml_file:
216216
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,
218220
)
219221
# AFAICT, this should be true for *all* XML files
220222
assert len(top_dict) == 1
@@ -468,13 +470,19 @@ def parse_json_dict(
468470
self.use_titles
469471
and parent_name + key in self.rollup
470472
and self.schema_parser.sub_sheet_titles.get(
471-
(parent_name, key,)
473+
(
474+
parent_name,
475+
key,
476+
)
472477
)
473478
in self.schema_parser.sub_sheets
474479
):
475480
relevant_subsheet = self.schema_parser.sub_sheets.get(
476481
self.schema_parser.sub_sheet_titles.get(
477-
(parent_name, key,)
482+
(
483+
parent_name,
484+
key,
485+
)
478486
)
479487
)
480488
if relevant_subsheet is not None:
@@ -546,10 +554,17 @@ def parse_json_dict(
546554
if (
547555
self.use_titles
548556
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
550562
):
551563
sub_sheet_name = self.schema_parser.sub_sheet_titles[
552-
(parent_name, key,)
564+
(
565+
parent_name,
566+
key,
567+
)
553568
]
554569
else:
555570
sub_sheet_name = make_sub_sheet_name(

flattentool/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def open(self):
105105
self.workbook = OpenDocumentSpreadsheet()
106106

107107
def _make_cell(self, value):
108-
""" Util for creating an ods cell """
108+
"""Util for creating an ods cell"""
109109

110110
if value:
111111
try:

flattentool/schema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ def parse_schema_dict(
315315
path_separator=":",
316316
)
317317
self.sub_sheet_titles[
318-
(parent_path, property_name,)
318+
(
319+
parent_path,
320+
property_name,
321+
)
319322
] = sub_sheet_name
320323
else:
321324
sub_sheet_name = make_sub_sheet_name(

0 commit comments

Comments
 (0)