Index: media/tools/layout_tests/layouttest_analyzer_helpers.py |
diff --git a/media/tools/layout_tests/layouttest_analyzer_helpers.py b/media/tools/layout_tests/layouttest_analyzer_helpers.py |
index f06e9feaff12a820f888c5865883e876981ebc7d..3f14eca8b9f43b19fc6d591f9d587797fdd21eb2 100644 |
--- a/media/tools/layout_tests/layouttest_analyzer_helpers.py |
+++ b/media/tools/layout_tests/layouttest_analyzer_helpers.py |
@@ -265,7 +265,7 @@ class AnalyzerResultMap: |
def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map, |
- bug_anno_map, receiver_email_address): |
+ bug_anno_map, receiver_email_address, testname_group_name): |
dennis_jeffrey
2011/08/30 20:57:48
I think we can just call the variable "test_group_
imasaki1
2011/08/30 21:47:39
Done.
|
"""Send status email. |
Args: |
@@ -277,6 +277,7 @@ def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map, |
bug_anno_map: bug annotation map where bug name and annotations are |
stored. |
receiver_email_address: receiver's email address. |
+ testname_group_name: a name string of test name group such as 'media'. |
dennis_jeffrey
2011/08/30 20:57:48
test_group_name: string representing the test grou
imasaki1
2011/08/30 21:47:39
Done.
|
""" |
diff_map = analyzer_result_map.CompareToOtherResultMap( |
prev_analyzer_result_map) |
@@ -310,9 +311,11 @@ def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map, |
str += '</ul></ul>' |
localtime = time.asctime(time.localtime(time.time())) |
# TODO(imasaki): remove my name from here. |
+ subject = 'Layout Test Analyzer Result (%s) : %s' % (testname_group_name, |
dennis_jeffrey
2011/08/30 20:57:48
optional nit: remove the space right before the ':
imasaki1
2011/08/30 21:47:39
Done.
|
+ localtime) |
SendEmail('imasaki@chromium.org', 'Kenji Imasaki', |
- [receiver_email_address], ['Layout Test Analyzer Result'], |
- 'Layout Test Analyzer Result : ' + localtime, str) |
+ [receiver_email_address], ['Layout Test Analyzer Result'], subject, |
+ str) |
def SendEmail(sender_email_address, sender_name, receivers_email_addresses, |
@@ -369,20 +372,28 @@ def FindLatestTime(time_list): |
|RESULT_DIR|. |
Args: |
- time_list: a list of time string in the form of '2011-10-23-23'. |
+ time_list: a list of time string in the form of '2011-10-23-23'. Strings |
dennis_jeffrey
2011/08/30 20:57:48
Instead of giving only the example '2011-10-23-23'
imasaki1
2011/08/30 21:47:39
Done.
|
+ in another format are ignored. |
dennis_jeffrey
2011/08/30 20:57:48
'in another' -->
'not in this'
imasaki1
2011/08/30 21:47:39
Done.
|
Returns: |
a string representing latest time among the time_list or None if |
- |time_list| is empty. |
+ |time_list| is empty or no valid date string in |time_list|. |
""" |
if not time_list: |
return None |
latest_date = None |
for t in time_list: |
- item_date = datetime.strptime(t, '%Y-%m-%d-%H') |
- if latest_date == None or latest_date < item_date: |
- latest_date = item_date |
- return latest_date.strftime('%Y-%m-%d-%H') |
+ try: |
+ item_date = datetime.strptime(t, '%Y-%m-%d-%H') |
+ if latest_date == None or latest_date < item_date: |
dennis_jeffrey
2011/08/30 20:57:48
The goal of this function is to find the most rece
imasaki1
2011/08/30 21:47:39
? I think this is working as intended.
dennis_jeffrey
2011/08/30 22:49:07
You're right - it is working as intended and there
|
+ latest_date = item_date |
+ except ValueError: |
+ # Do nothing. |
+ pass |
+ if latest_date: |
+ return latest_date.strftime('%Y-%m-%d-%H') |
+ else: |
+ return None |
def FindLatestResult(result_dir): |