Chromium Code Reviews| Index: media/tools/layout_tests/layouttest_analyzer.py |
| diff --git a/media/tools/layout_tests/layouttest_analyzer.py b/media/tools/layout_tests/layouttest_analyzer.py |
| index 7d6ae2a37682811917ac57fbf4878a09a592689a..2f88666ff77c7940a22b44a226227d82896c3af8 100644 |
| --- a/media/tools/layout_tests/layouttest_analyzer.py |
| +++ b/media/tools/layout_tests/layouttest_analyzer.py |
| @@ -21,6 +21,8 @@ from trend_graph import TrendGraph |
| DEFAULT_RESULT_DIR = 'result' |
| DEFAULT_ANNO_FILE = os.path.join('anno', 'anno.csv') |
| DEFAULT_GRAPH_FILE = os.path.join('graph', 'graph.html') |
| +DEFAULT_STATS_CSV_FILENAME = 'stats.csv' |
| +DEFAULT_ISSUES_CSV_FILENAME = 'issues.csv' |
| # Predefined result files for debug. |
| CUR_TIME_FOR_DEBUG = '2011-09-11-19' |
| CURRENT_RESULT_FILE_FOR_DEBUG = os.path.join(DEFAULT_RESULT_DIR, |
| @@ -196,7 +198,8 @@ def ReadEmailInformation(bug_annotation_file_location, |
| else: |
| data = csv.reader(file_object) |
| for row in data: |
| - anno_map[row[0]] = row[1] |
| + if len(row) > 1: |
| + anno_map[row[0]] = row[1] |
| file_object.close() |
| appended_text_to_email = '' |
| @@ -273,7 +276,8 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, |
| layouttest_analyzer_helpers.SendStatusEmail( |
| prev_time, analyzer_result_map, diff_map, anno_map, |
| receiver_email_address, test_group_name, |
| - appended_text_to_email, email_content, rev_str) |
| + appended_text_to_email, email_content, rev_str, |
| + email_only_change_mode) |
| if simple_rev_str: |
| simple_rev_str = '\'' + simple_rev_str + '\'' |
| else: |
| @@ -284,6 +288,9 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, |
| result_change = True |
| diff_map = None |
| simple_rev_str = 'undefined' |
| + prev_time = None |
|
dennis_jeffrey
2011/11/11 00:01:36
I think we could remove this line and just put 'No
imasaki1
2011/11/11 00:25:52
Done.
|
| + email_content = analyzer_result_map.ConvertToString(prev_time, diff_map, |
| + anno_map) |
| return (result_change, diff_map, simple_rev_str, rev, rev_date, |
| email_content) |
| @@ -454,6 +461,17 @@ def main(): |
| anno_map, appended_text_to_email, |
| options.email_only_change_mode, options.debug, |
| options.receiver_email_address, options.test_group_name)) |
| + # Create CSV texts and save them for bug spreadsheet. |
|
dennis_jeffrey
2011/11/11 00:01:36
I recommend adding a blank line right above this,
imasaki1
2011/11/11 00:25:52
Done.
|
| + (stats, issues_txt) = analyzer_result_map.ConvertToCSVText( |
| + start_time.strftime('%Y-%m-%d-%H')) |
| + file_object = open(os.path.join(options.result_directory_location, |
| + DEFAULT_STATS_CSV_FILENAME), 'wb') |
| + file_object.write(stats) |
| + file_object.close() |
| + file_object = open(os.path.join(options.result_directory_location, |
| + DEFAULT_ISSUES_CSV_FILENAME), 'wb') |
| + file_object.write(issues_txt) |
| + file_object.close() |
| if not options.debug and (result_change or not prev_analyzer_result_map): |
| # Save the current result when result is changed or the script is |
| # executed for the first time. |