From c4a16233577110c18d276294854bd7804c6e8ce7 Mon Sep 17 00:00:00 2001 From: Olivier Giorgis Date: Tue, 19 Nov 2024 14:25:45 +0100 Subject: [PATCH] remove useless function --- treeherder/intermittents_commenter/commenter.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/treeherder/intermittents_commenter/commenter.py b/treeherder/intermittents_commenter/commenter.py index fe111839c4d..9940c936d69 100644 --- a/treeherder/intermittents_commenter/commenter.py +++ b/treeherder/intermittents_commenter/commenter.py @@ -1,4 +1,3 @@ -import json import logging import re import time @@ -48,7 +47,8 @@ def generate_bug_changes(self, startday, endday, alt_startday, alt_endday): bug_info = self.fetch_all_bug_details(bug_ids) all_bug_changes = [] - template = Template(self.open_file("comment.template", False)) + with open("treeherder/intermittents_commenter/comment.template") as template_file: + template = Template(template_file.read()) if self.weekly_mode: top_bugs = [ @@ -178,13 +178,6 @@ def print_or_submit_changes(self, all_bug_changes): ) ) - def open_file(self, filename, load): - with open(f"treeherder/intermittents_commenter/{filename}") as myfile: - if load: - return json.load(myfile) - else: - return myfile.read() - def calculate_date_strings(self, mode, num_days): """Returns a tuple of start (in YYYY-MM-DD format) and end date strings (in YYYY-MM-DD HH:MM:SS format for an inclusive day)."""