Skip to content

Commit

Permalink
Add --hidden flag to get_summary_from_bag
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesSchoenberg committed Sep 5, 2023
1 parent fba713f commit 7ba5a6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "robologs-ros-utils"
version = "0.1.1a42"
version = "0.1.1a43"
description = "robologs-ros-utils is an open source library of containerized data transformations for the robotics and drone communities"
authors = ["roboto.ai <[email protected]>"]
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@
@click.option("--output", "-o", type=str, required=True, help="Output directory, or json path")
@click.option("--file-name", "-f", type=str, default="rosbag_metadata.json", help="Output file name")
@click.option("--split", "-s", is_flag=True, help="Save individual metadata files next to each rosbag")
def get_summary(input, output, file_name, split):
@click.option("--hidden", "-h", is_flag=True, help="Output hidden JSON files with '.' prefix")
def get_summary(input, output, file_name, split, hidden):
"""Get summary of Rosbag1 data"""

input_path = input
output_path = output
output_filename = file_name
output_filename = file_name if not hidden else "." + file_name

rosbag_info_dict = ros_utils.get_bag_info_from_file_or_folder(input_path=input_path)

if split:
for bag_path, bag_info in rosbag_info_dict.items():
bag_dir = os.path.dirname(bag_path)
bag_name = "." + os.path.basename(bag_path).replace(".bag", ".json")
bag_name = os.path.basename(bag_path).replace(".bag", ".json")
if hidden:
bag_name = "." + bag_name
output_file_path = os.path.join(bag_dir, bag_name)
file_utils.save_json(data=bag_info, path=output_file_path)
else:
Expand Down

0 comments on commit 7ba5a6e

Please sign in to comment.