def display_s3_summary_table(self, bucket_summary):
'''
Display S3 Summary in Tabular output.
'''
# Setup table header.
header = ["Profile", "Total Bucket Count"]
table = prettytable.PrettyTable(header)
for profile in bucket_summary.keys():
row = [profile, bucket_summary[profile]['total_count']]
table.add_row(row)
print table
# Setup table header (loc constraint)
header = ["Location", "Bucket Count"]
table = prettytable.PrettyTable(header)
for profile in bucket_summary.keys():
row = ["-"*40, "-"*20]
table.add_row(row)
row = [profile, " "]
table.add_row(row)
row = ["-"*40, "-"*20]
table.add_row(row)
locs = bucket_summary[profile]['locs']
for loc in locs.keys():
row = [loc, bucket_summary[profile]['locs'][loc]]
table.add_row(row)
row = [" ", " "]
table.add_row(row)
print table
评论列表
文章目录