Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
disable_local_refs=disable_local_refs,
truncation_length=truncation_length,
exclude_deprecated_fields=no_deprecated_fields,
)
parser.parse()
def spreadsheet_output(spreadsheet_output_class, name):
spreadsheet_output = spreadsheet_output_class(
parser=parser, main_sheet_name=main_sheet_name, output_name=name
)
spreadsheet_output.write_sheets()
if output_format == "all":
if not output_name:
output_name = "template"
for format_name, spreadsheet_output_class in OUTPUT_FORMATS.items():
spreadsheet_output(
spreadsheet_output_class, output_name + FORMATS_SUFFIX[format_name]
)
elif output_format in OUTPUT_FORMATS.keys(): # in dictionary of allowed formats
if not output_name:
output_name = "template" + FORMATS_SUFFIX[output_format]
spreadsheet_output(OUTPUT_FORMATS[output_format], output_name)
else:
raise Exception("The requested format is not available")
)
parser.parse()
def spreadsheet_output(spreadsheet_output_class, name):
spreadsheet_output = spreadsheet_output_class(
parser=parser,
main_sheet_name=main_sheet_name,
output_name=name,
sheet_prefix=sheet_prefix,
)
spreadsheet_output.write_sheets()
if output_format == "all":
if not output_name:
output_name = "flattened"
for format_name, spreadsheet_output_class in OUTPUT_FORMATS.items():
spreadsheet_output(
spreadsheet_output_class, output_name + FORMATS_SUFFIX[format_name]
)
elif output_format in OUTPUT_FORMATS.keys(): # in dictionary of allowed formats
if not output_name:
output_name = "flattened" + FORMATS_SUFFIX[output_format]
spreadsheet_output(OUTPUT_FORMATS[output_format], output_name)
else:
raise Exception("The requested format is not available")