From 3b06156d711a74d3b6d0d30b620150a91ae474e8 Mon Sep 17 00:00:00 2001 From: sash713 Date: Feb 26 2020 10:55:10 +0000 Subject: Added feature to show number of newcomers per interest --- diff --git a/scripts/GetTicketInfo/README.md b/scripts/GetTicketInfo/README.md index 575fe1f..ef56204 100644 --- a/scripts/GetTicketInfo/README.md +++ b/scripts/GetTicketInfo/README.md @@ -41,5 +41,6 @@ The script's output is as follows: * Number of new comers in queue * Number of successfully joined newcomers * Number of unsuccessful joined newcomers - * User ID, Progress Check, Interests (for each ticket where newcomer has declared his/her interests) + * User ID, Progress Check, Interests (for each ticket where newcomer has declared his/her interests) + * A list of all claimed interests and the number of newcomers per interest \ No newline at end of file diff --git a/scripts/GetTicketInfo/main.py b/scripts/GetTicketInfo/main.py index c73ad9b..edc6aef 100644 --- a/scripts/GetTicketInfo/main.py +++ b/scripts/GetTicketInfo/main.py @@ -146,6 +146,7 @@ class NewComers: f.write("\n"+"-x-"*50+"\n\n") + interest_counter = {} for i in range(len(self.issues)): try: @@ -154,7 +155,12 @@ class NewComers: interest_dict[newcomer] = [[],["None"]] for x in tag_lst: if "I:" in x: - interest_dict[newcomer][0].append(x.replace('I: ', '')) + interest = x.replace('I: ', '') + interest_dict[newcomer][0].append(interest) + if interest in interest_counter: + interest_counter[interest] += 1 + else : + interest_counter[interest] = 1 if "C: Progress check" in x: interest_dict[newcomer][1] = [(x.replace('C: ', ''))] @@ -171,6 +177,12 @@ class NewComers: for j in interest_dict[i][0]: line += j+" " f.write(line+"\n\n") + + f.write("\n\nA summary of number of tickets by the interest tags:\n\n") + + for i in interest_counter: + f.write(i+" : "+str(interest_counter[i])+"\n") + f.close()