From 36c57a9970b3703fa73edab2ef9f7ff2785914ec Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Mon, 17 Dec 2018 17:38:28 +0100 Subject: [PATCH] Add count_slot_usage argument for sensitivity By default, report when a slot has less than a weekly slot available, but allow users to specify another sensitivity. Change-Id: I8a52d9fb39039af049f419ac31b3281d6b057dac --- tools/count_slot_usage.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/count_slot_usage.py b/tools/count_slot_usage.py index 6d0fcbce..ae72848c 100755 --- a/tools/count_slot_usage.py +++ b/tools/count_slot_usage.py @@ -51,7 +51,7 @@ def main(): print("Day\tUTC Hour") available_slots = 2 * len(CHANNELS) - full_time_slot = available_slots - 1 + full_time_slot = available_slots - args.sensitivity for day in WEEKDAYS: for hour in range(24): slot_usage = len(meeting_counts[hour][day]) @@ -166,6 +166,11 @@ def parse_args(): parser.add_argument( '--csv', metavar='FILE_NAME', help='If specified, write counts to the specified CSV file') + parser.add_argument( + '--sensitivity', type=int, default=1, + help='Sensitivity of reporting. ' + 'Defaults to 1, which means report if no weekly slot is ' + 'available at the time slots considered.') args = parser.parse_args() return args