Skip to content

Commit

Permalink
don't do ugly multi-line arrays on export
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbattle committed Aug 14, 2023
1 parent 0f4ea03 commit 94bb843
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,17 @@ def write_yaml(file_name,
try:
if not use_indent_dumper:
yaml.dump(
output_dict, output_file, default_flow_style=default_flow_style)
output_dict,
output_file,
default_flow_style=default_flow_style,
width=2147483647)
else:
yaml.dump(
output_dict,
output_file,
Dumper=IndentDumper,
default_flow_style=default_flow_style)
default_flow_style=default_flow_style,
width=2147483647)
except yaml.YAMLError as exception:
print(exception)

Expand Down Expand Up @@ -388,7 +392,7 @@ class CalibrationConfig:
cam_name = 'cam{0}'.format(cam_index)
sensors_dict['ncameras'][0]['cameras'].append(
self.cameras[cam_name].get_maplab_format())
default_flow_style = False
default_flow_style = None
use_indent_dumper = True
if not self.to_ncamera:
write_yaml(self.__get_output_file_name(), sensors_dict,
Expand Down

0 comments on commit 94bb843

Please sign in to comment.